summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/dfg/DFGOperations.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-10-16 14:56:46 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-10-16 14:57:30 +0200
commitb297e0fa5c217c9467033b7c8b46891a52870120 (patch)
tree43fc14689295e9e64f2719d05aad94e3049f6cd7 /Source/JavaScriptCore/dfg/DFGOperations.cpp
parent69d517dbfa69903d8593cc1737f0474b21e3251e (diff)
downloadqtwebkit-b297e0fa5c217c9467033b7c8b46891a52870120.tar.gz
Revert "Imported WebKit commit 0dc6cd75e1d4836eaffbb520be96fac4847cc9d2 (http://svn.webkit.org/repository/webkit/trunk@131300)"
This reverts commit 5466563f4b5b6b86523e3f89bb7f77e5b5270c78. Caused OOM issues on some CI machines :(
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGOperations.cpp')
-rw-r--r--Source/JavaScriptCore/dfg/DFGOperations.cpp76
1 files changed, 25 insertions, 51 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGOperations.cpp b/Source/JavaScriptCore/dfg/DFGOperations.cpp
index db736feeb..eaa0f47f7 100644
--- a/Source/JavaScriptCore/dfg/DFGOperations.cpp
+++ b/Source/JavaScriptCore/dfg/DFGOperations.cpp
@@ -49,7 +49,7 @@
#if ENABLE(DFG_JIT)
-#if COMPILER(GCC) && CPU(X86_64)
+#if CPU(X86_64)
#define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, register) \
asm( \
@@ -64,7 +64,7 @@
#define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJI(function) FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, rcx)
#define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(function) FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, r8)
-#elif COMPILER(GCC) && CPU(X86)
+#elif CPU(X86)
#define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, offset) \
asm( \
@@ -556,7 +556,9 @@ void DFG_OPERATION operationPutByValBeyondArrayBoundsStrict(ExecState* exec, JSO
NativeCallFrameTracer tracer(globalData, exec);
if (index >= 0) {
- array->putByIndexInline(exec, index, JSValue::decode(encodedValue), true);
+ // We should only get here if index is outside the existing vector.
+ ASSERT(!array->canSetIndexQuickly(index));
+ array->methodTable()->putByIndex(array, exec, index, JSValue::decode(encodedValue), true);
return;
}
@@ -571,7 +573,9 @@ void DFG_OPERATION operationPutByValBeyondArrayBoundsNonStrict(ExecState* exec,
NativeCallFrameTracer tracer(globalData, exec);
if (index >= 0) {
- array->putByIndexInline(exec, index, JSValue::decode(encodedValue), false);
+ // We should only get here if index is outside the existing vector.
+ ASSERT(!array->canSetIndexQuickly(index));
+ array->methodTable()->putByIndex(array, exec, index, JSValue::decode(encodedValue), false);
return;
}
@@ -597,16 +601,6 @@ EncodedJSValue DFG_OPERATION operationArrayPop(ExecState* exec, JSArray* array)
return JSValue::encode(array->pop(exec));
}
-EncodedJSValue DFG_OPERATION operationArrayPopAndRecoverLength(ExecState* exec, JSArray* array)
-{
- JSGlobalData* globalData = &exec->globalData();
- NativeCallFrameTracer tracer(globalData, exec);
-
- array->butterfly()->setPublicLength(array->butterfly()->publicLength() + 1);
-
- return JSValue::encode(array->pop(exec));
-}
-
EncodedJSValue DFG_OPERATION operationRegExpExec(ExecState* exec, JSCell* base, JSCell* argument)
{
JSGlobalData& globalData = exec->globalData();
@@ -1106,35 +1100,29 @@ EncodedJSValue DFG_OPERATION operationStrCat(ExecState* exec, void* buffer, size
return JSValue::encode(jsString(exec, static_cast<Register*>(buffer), size));
}
-char* DFG_OPERATION operationNewArray(ExecState* exec, Structure* arrayStructure, void* buffer, size_t size)
+EncodedJSValue DFG_OPERATION operationNewArray(ExecState* exec, Structure* arrayStructure, void* buffer, size_t size)
{
JSGlobalData* globalData = &exec->globalData();
NativeCallFrameTracer tracer(globalData, exec);
-
- return bitwise_cast<char*>(constructArray(exec, arrayStructure, static_cast<JSValue*>(buffer), size));
+
+ return JSValue::encode(constructArray(exec, arrayStructure, static_cast<JSValue*>(buffer), size));
}
-char* DFG_OPERATION operationNewEmptyArray(ExecState* exec, Structure* arrayStructure)
+EncodedJSValue DFG_OPERATION operationNewEmptyArray(ExecState* exec, Structure* arrayStructure)
{
- JSGlobalData* globalData = &exec->globalData();
- NativeCallFrameTracer tracer(globalData, exec);
-
- return bitwise_cast<char*>(JSArray::create(*globalData, arrayStructure));
+ return JSValue::encode(JSArray::create(exec->globalData(), arrayStructure));
}
-char* DFG_OPERATION operationNewArrayWithSize(ExecState* exec, Structure* arrayStructure, int32_t size)
+EncodedJSValue DFG_OPERATION operationNewArrayWithSize(ExecState* exec, Structure* arrayStructure, int32_t size)
{
- JSGlobalData* globalData = &exec->globalData();
- NativeCallFrameTracer tracer(globalData, exec);
-
- return bitwise_cast<char*>(JSArray::create(*globalData, arrayStructure, size));
+ return JSValue::encode(JSArray::create(exec->globalData(), arrayStructure, size));
}
-char* DFG_OPERATION operationNewArrayBuffer(ExecState* exec, Structure* arrayStructure, size_t start, size_t size)
+EncodedJSValue DFG_OPERATION operationNewArrayBuffer(ExecState* exec, size_t start, size_t size)
{
JSGlobalData& globalData = exec->globalData();
NativeCallFrameTracer tracer(&globalData, exec);
- return bitwise_cast<char*>(constructArray(exec, arrayStructure, exec->codeBlock()->constantBuffer(start), size));
+ return JSValue::encode(constructArray(exec, exec->codeBlock()->constantBuffer(start), size));
}
EncodedJSValue DFG_OPERATION operationNewRegexp(ExecState* exec, void* regexpPtr)
@@ -1321,14 +1309,6 @@ char* DFG_OPERATION operationReallocateButterflyToGrowPropertyStorage(ExecState*
return reinterpret_cast<char*>(result);
}
-char* DFG_OPERATION operationEnsureContiguous(ExecState* exec, JSObject* object)
-{
- JSGlobalData& globalData = exec->globalData();
- NativeCallFrameTracer tracer(&globalData, exec);
-
- return reinterpret_cast<char*>(object->ensureContiguous(globalData));
-}
-
char* DFG_OPERATION operationEnsureArrayStorage(ExecState* exec, JSObject* object)
{
JSGlobalData& globalData = exec->globalData();
@@ -1337,16 +1317,6 @@ char* DFG_OPERATION operationEnsureArrayStorage(ExecState* exec, JSObject* objec
return reinterpret_cast<char*>(object->ensureArrayStorage(globalData));
}
-char* DFG_OPERATION operationEnsureContiguousOrArrayStorage(ExecState* exec, JSObject* object, int32_t index)
-{
- JSGlobalData& globalData = exec->globalData();
- NativeCallFrameTracer tracer(&globalData, exec);
-
- if (static_cast<unsigned>(index) >= MIN_SPARSE_ARRAY_INDEX)
- return reinterpret_cast<char*>(object->ensureArrayStorage(globalData));
- return reinterpret_cast<char*>(object->ensureIndexedStorage(globalData));
-}
-
double DFG_OPERATION operationFModOnInts(int32_t a, int32_t b)
{
return fmod(a, b);
@@ -1455,9 +1425,11 @@ extern "C" void DFG_OPERATION triggerReoptimizationNow(CodeBlock* codeBlock)
#endif // ENABLE(DFG_JIT)
+#if COMPILER(GCC)
+
namespace JSC {
-#if COMPILER(GCC) && CPU(X86_64)
+#if CPU(X86_64)
asm (
".globl " SYMBOL_STRING(getHostCallReturnValue) "\n"
HIDE_SYMBOL(getHostCallReturnValue) "\n"
@@ -1466,7 +1438,7 @@ SYMBOL_STRING(getHostCallReturnValue) ":" "\n"
"mov %r13, %rdi\n"
"jmp " LOCAL_REFERENCE(getHostCallReturnValueWithExecState) "\n"
);
-#elif COMPILER(GCC) && CPU(X86)
+#elif CPU(X86)
asm (
".text" "\n" \
".globl " SYMBOL_STRING(getHostCallReturnValue) "\n"
@@ -1476,7 +1448,7 @@ SYMBOL_STRING(getHostCallReturnValue) ":" "\n"
"mov %edi, 4(%esp)\n"
"jmp " LOCAL_REFERENCE(getHostCallReturnValueWithExecState) "\n"
);
-#elif COMPILER(GCC) && CPU(ARM_THUMB2)
+#elif CPU(ARM_THUMB2)
asm (
".text" "\n"
".align 2" "\n"
@@ -1489,7 +1461,7 @@ SYMBOL_STRING(getHostCallReturnValue) ":" "\n"
"mov r0, r5" "\n"
"b " LOCAL_REFERENCE(getHostCallReturnValueWithExecState) "\n"
);
-#elif COMPILER(GCC) && CPU(ARM_TRADITIONAL)
+#elif CPU(ARM_TRADITIONAL)
asm (
".text" "\n"
".globl " SYMBOL_STRING(getHostCallReturnValue) "\n"
@@ -1511,4 +1483,6 @@ extern "C" EncodedJSValue HOST_CALL_RETURN_VALUE_OPTION getHostCallReturnValueWi
} // namespace JSC
+#endif // COMPILER(GCC)
+
#endif // ENABLE(JIT)