mirror of
https://github.com/servo/servo.git
synced 2025-08-02 12:10:29 +01:00
Cargoify servo
This commit is contained in:
parent
db2f642c32
commit
c6ab60dbfc
1761 changed files with 8423 additions and 2294 deletions
7
etc/patches/README
Normal file
7
etc/patches/README
Normal file
|
@ -0,0 +1,7 @@
|
|||
Patches live here for submodules that should remain as pristine as possible.
|
||||
This will allow us to unconditionally update them, then apply necessary
|
||||
patches as needed.
|
||||
|
||||
* mozjs-stack-bounds.diff:
|
||||
add a public API to overwrite the engine's computed stack bounds for
|
||||
GC scanning.
|
77
etc/patches/mozjs-stack-bounds.diff
Normal file
77
etc/patches/mozjs-stack-bounds.diff
Normal file
|
@ -0,0 +1,77 @@
|
|||
diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp
|
||||
index 5571fc0..7e1e30d 100644
|
||||
--- a/js/src/jsapi.cpp
|
||||
+++ b/js/src/jsapi.cpp
|
||||
@@ -735,6 +735,7 @@ JSRuntime::JSRuntime()
|
||||
#endif
|
||||
selfHostedGlobal_(NULL),
|
||||
nativeStackBase(0),
|
||||
+ nativeStackEnd(0),
|
||||
nativeStackQuota(0),
|
||||
interpreterFrames(NULL),
|
||||
cxCallback(NULL),
|
||||
@@ -7084,6 +7085,18 @@ JS_SetRuntimeThread(JSRuntime *rt)
|
||||
#endif
|
||||
}
|
||||
|
||||
+extern JS_PUBLIC_API(void)
|
||||
+JS_SetNativeStackBounds(JSRuntime *rt, uintptr_t minValue, uintptr_t maxValue)
|
||||
+{
|
||||
+#if JS_STACK_GROWTH_DIRECTION < 0
|
||||
+ rt->nativeStackBase = maxValue;
|
||||
+ rt->nativeStackEnd = minValue;
|
||||
+#else
|
||||
+ rt->nativeStackBase = minValue;
|
||||
+ rt->nativeStackEnd = maxValue;
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
extern JS_NEVER_INLINE JS_PUBLIC_API(void)
|
||||
JS_AbortIfWrongThread(JSRuntime *rt)
|
||||
{
|
||||
diff --git a/js/src/jsapi.h b/js/src/jsapi.h
|
||||
index c8ab0f0..9ac582e 100644
|
||||
--- a/js/src/jsapi.h
|
||||
+++ b/js/src/jsapi.h
|
||||
@@ -6248,6 +6248,9 @@ JS_ClearRuntimeThread(JSRuntime *rt);
|
||||
extern JS_PUBLIC_API(void)
|
||||
JS_SetRuntimeThread(JSRuntime *rt);
|
||||
|
||||
+extern JS_PUBLIC_API(void)
|
||||
+JS_SetNativeStackBounds(JSRuntime *rt, uintptr_t minValue, uintptr_t maxValue);
|
||||
+
|
||||
#ifdef __cplusplus
|
||||
JS_END_EXTERN_C
|
||||
|
||||
diff --git a/js/src/jscntxt.h b/js/src/jscntxt.h
|
||||
index 0bb6d1c..32e016e 100644
|
||||
--- a/js/src/jscntxt.h
|
||||
+++ b/js/src/jscntxt.h
|
||||
@@ -439,6 +439,9 @@ struct JSRuntime : js::RuntimeFriendFields
|
||||
/* Base address of the native stack for the current thread. */
|
||||
uintptr_t nativeStackBase;
|
||||
|
||||
+ /* Base address of the native stack for the current thread. */
|
||||
+ uintptr_t nativeStackEnd;
|
||||
+
|
||||
/* The native stack size limit that runtime should not exceed. */
|
||||
size_t nativeStackQuota;
|
||||
|
||||
diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp
|
||||
index f5cbc62..eae29da 100644
|
||||
--- a/js/src/jsgc.cpp
|
||||
+++ b/js/src/jsgc.cpp
|
||||
@@ -1177,9 +1177,11 @@ MarkConservativeStackRoots(JSTracer *trc, bool useSavedRoots)
|
||||
uintptr_t *stackMin, *stackEnd;
|
||||
#if JS_STACK_GROWTH_DIRECTION > 0
|
||||
stackMin = rt->nativeStackBase;
|
||||
- stackEnd = cgcd->nativeStackTop;
|
||||
+ stackEnd = rt->nativeStackEnd ? reinterpret_cast<uintptr_t*>(rt->nativeStackEnd)
|
||||
+ : cgcd->nativeStackTop;
|
||||
#else
|
||||
- stackMin = cgcd->nativeStackTop + 1;
|
||||
+ stackMin = rt->nativeStackEnd ? reinterpret_cast<uintptr_t*>(rt->nativeStackEnd)
|
||||
+ : cgcd->nativeStackTop + 1;
|
||||
stackEnd = reinterpret_cast<uintptr_t *>(rt->nativeStackBase);
|
||||
#endif
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue