summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/runtime')
-rw-r--r--Source/JavaScriptCore/runtime/Executable.h24
-rw-r--r--Source/JavaScriptCore/runtime/GCActivityCallbackBlackBerry.cpp19
-rw-r--r--Source/JavaScriptCore/runtime/JSValue.h22
3 files changed, 46 insertions, 19 deletions
diff --git a/Source/JavaScriptCore/runtime/Executable.h b/Source/JavaScriptCore/runtime/Executable.h
index e5f6de438..2f6c6a253 100644
--- a/Source/JavaScriptCore/runtime/Executable.h
+++ b/Source/JavaScriptCore/runtime/Executable.h
@@ -176,6 +176,30 @@ namespace JSC {
return intrinsic();
return NoIntrinsic;
}
+
+ static ptrdiff_t offsetOfJITCodeFor(CodeSpecializationKind kind)
+ {
+ if (kind == CodeForCall)
+ return OBJECT_OFFSETOF(ExecutableBase, m_jitCodeForCall);
+ ASSERT(kind == CodeForConstruct);
+ return OBJECT_OFFSETOF(ExecutableBase, m_jitCodeForConstruct);
+ }
+
+ static ptrdiff_t offsetOfJITCodeWithArityCheckFor(CodeSpecializationKind kind)
+ {
+ if (kind == CodeForCall)
+ return OBJECT_OFFSETOF(ExecutableBase, m_jitCodeForCallWithArityCheck);
+ ASSERT(kind == CodeForConstruct);
+ return OBJECT_OFFSETOF(ExecutableBase, m_jitCodeForConstructWithArityCheck);
+ }
+
+ static ptrdiff_t offsetOfNumParametersFor(CodeSpecializationKind kind)
+ {
+ if (kind == CodeForCall)
+ return OBJECT_OFFSETOF(ExecutableBase, m_numParametersForCall);
+ ASSERT(kind == CodeForConstruct);
+ return OBJECT_OFFSETOF(ExecutableBase, m_numParametersForConstruct);
+ }
#endif
protected:
diff --git a/Source/JavaScriptCore/runtime/GCActivityCallbackBlackBerry.cpp b/Source/JavaScriptCore/runtime/GCActivityCallbackBlackBerry.cpp
index 3b0b5a751..d9f96fa1e 100644
--- a/Source/JavaScriptCore/runtime/GCActivityCallbackBlackBerry.cpp
+++ b/Source/JavaScriptCore/runtime/GCActivityCallbackBlackBerry.cpp
@@ -20,39 +20,40 @@
#include "GCActivityCallback.h"
#include "Heap.h"
+#include "JSGlobalData.h"
#include <BlackBerryPlatformMemory.h>
namespace JSC {
+static const size_t bytesWorthGC = 4 * 1024 * 1024;
+
DefaultGCActivityCallback::DefaultGCActivityCallback(Heap* heap)
: GCActivityCallback(heap->globalData())
{
}
-DefaultGCActivityCallback::doWork()
+void DefaultGCActivityCallback::doWork()
{
+ m_globalData->heap.collect(Heap::DoNotSweep);
}
void DefaultGCActivityCallback::didAllocate(size_t bytesAllocated)
{
- if (!BlackBerry::Platform::isMemoryLow())
- return;
-
- if (bytesAllocated < 1 * 1024 * 1024)
+ if (bytesAllocated < bytesWorthGC || m_timer.started())
return;
- if (m_globalData->heap.isBusy() || !m_globalData->heap.isSafeToCollect())
- return;
-
- m_globalData->heap.collect(Heap::DoNotSweep);
+ // Try using ~5% CPU time.
+ m_timer.start(m_globalData->heap.lastGCLength() * 20);
}
void DefaultGCActivityCallback::willCollect()
{
+ cancel();
}
void DefaultGCActivityCallback::cancel()
{
+ m_timer.stop();
}
}
diff --git a/Source/JavaScriptCore/runtime/JSValue.h b/Source/JavaScriptCore/runtime/JSValue.h
index f74bfad90..6f98bd6f7 100644
--- a/Source/JavaScriptCore/runtime/JSValue.h
+++ b/Source/JavaScriptCore/runtime/JSValue.h
@@ -124,6 +124,18 @@ namespace JSC {
friend class LLInt::Data;
public:
+#if USE(JSVALUE32_64)
+ enum { Int32Tag = 0xffffffff };
+ enum { BooleanTag = 0xfffffffe };
+ enum { NullTag = 0xfffffffd };
+ enum { UndefinedTag = 0xfffffffc };
+ enum { CellTag = 0xfffffffb };
+ enum { EmptyValueTag = 0xfffffffa };
+ enum { DeletedValueTag = 0xfffffff9 };
+
+ enum { LowestTag = DeletedValueTag };
+#endif
+
static EncodedJSValue encode(JSValue);
static JSValue decode(EncodedJSValue);
@@ -278,16 +290,6 @@ namespace JSC {
* cell, integer and bool values the lower 32 bits (the 'payload') contain the pointer
* integer or boolean value; in the case of all other tags the payload is 0.
*/
- enum { Int32Tag = 0xffffffff };
- enum { BooleanTag = 0xfffffffe };
- enum { NullTag = 0xfffffffd };
- enum { UndefinedTag = 0xfffffffc };
- enum { CellTag = 0xfffffffb };
- enum { EmptyValueTag = 0xfffffffa };
- enum { DeletedValueTag = 0xfffffff9 };
-
- enum { LowestTag = DeletedValueTag };
-
uint32_t tag() const;
int32_t payload() const;
#elif USE(JSVALUE64)