| Index: JavaScriptCore/interpreter/Interpreter.cpp
|
| ===================================================================
|
| --- JavaScriptCore/interpreter/Interpreter.cpp (revision 10232)
|
| +++ JavaScriptCore/interpreter/Interpreter.cpp (working copy)
|
| @@ -347,52 +347,11 @@
|
|
|
| Interpreter::Interpreter()
|
| : m_sampler(0)
|
| -#if ENABLE(JIT)
|
| - , m_ctiArrayLengthTrampoline(0)
|
| - , m_ctiStringLengthTrampoline(0)
|
| - , m_ctiVirtualCallPreLink(0)
|
| - , m_ctiVirtualCallLink(0)
|
| - , m_ctiVirtualCall(0)
|
| -#endif
|
| , m_reentryDepth(0)
|
| {
|
| privateExecute(InitializeAndReturn, 0, 0, 0);
|
| -
|
| - // Bizarrely, calling fastMalloc here is faster than allocating space on the stack.
|
| - void* storage = fastMalloc(sizeof(CollectorBlock));
|
| -
|
| - JSCell* jsArray = new (storage) JSArray(JSArray::createStructure(jsNull()));
|
| - m_jsArrayVptr = jsArray->vptr();
|
| - jsArray->~JSCell();
|
| -
|
| - JSCell* jsByteArray = new (storage) JSByteArray(JSByteArray::VPtrStealingHack);
|
| - m_jsByteArrayVptr = jsByteArray->vptr();
|
| - jsByteArray->~JSCell();
|
| -
|
| - JSCell* jsString = new (storage) JSString(JSString::VPtrStealingHack);
|
| - m_jsStringVptr = jsString->vptr();
|
| - jsString->~JSCell();
|
| -
|
| - JSCell* jsFunction = new (storage) JSFunction(JSFunction::createStructure(jsNull()));
|
| - m_jsFunctionVptr = jsFunction->vptr();
|
| - jsFunction->~JSCell();
|
| -
|
| - fastFree(storage);
|
| }
|
|
|
| -void Interpreter::initialize(JSGlobalData* globalData)
|
| -{
|
| -#if ENABLE(JIT)
|
| - JIT::compileCTIMachineTrampolines(globalData);
|
| -#else
|
| - UNUSED_PARAM(globalData);
|
| -#endif
|
| -}
|
| -
|
| -Interpreter::~Interpreter()
|
| -{
|
| -}
|
| -
|
| #ifndef NDEBUG
|
|
|
| void Interpreter::dumpCallFrame(CallFrame* callFrame)
|
| @@ -962,12 +921,13 @@
|
| return;
|
| }
|
|
|
| - if (isJSArray(baseValue) && propertyName == callFrame->propertyNames().length) {
|
| + JSGlobalData* globalData = &callFrame->globalData();
|
| + if (isJSArray(globalData, baseValue) && propertyName == callFrame->propertyNames().length) {
|
| vPC[0] = getOpcode(op_get_array_length);
|
| return;
|
| }
|
|
|
| - if (isJSString(baseValue) && propertyName == callFrame->propertyNames().length) {
|
| + if (isJSString(globalData, baseValue) && propertyName == callFrame->propertyNames().length) {
|
| vPC[0] = getOpcode(op_get_string_length);
|
| return;
|
| }
|
| @@ -2273,7 +2233,7 @@
|
|
|
| int base = vPC[2].u.operand;
|
| JSValuePtr baseValue = callFrame[base].jsValue(callFrame);
|
| - if (LIKELY(isJSArray(baseValue))) {
|
| + if (LIKELY(isJSArray(globalData, baseValue))) {
|
| int dst = vPC[1].u.operand;
|
| callFrame[dst] = JSValuePtr(jsNumber(callFrame, asArray(baseValue)->length()));
|
| vPC += 8;
|
| @@ -2293,7 +2253,7 @@
|
|
|
| int base = vPC[2].u.operand;
|
| JSValuePtr baseValue = callFrame[base].jsValue(callFrame);
|
| - if (LIKELY(isJSString(baseValue))) {
|
| + if (LIKELY(isJSString(globalData, baseValue))) {
|
| int dst = vPC[1].u.operand;
|
| callFrame[dst] = JSValuePtr(jsNumber(callFrame, asString(baseValue)->value().size()));
|
| vPC += 8;
|
| @@ -2475,15 +2435,15 @@
|
|
|
| if (LIKELY(subscript.isUInt32Fast())) {
|
| uint32_t i = subscript.getUInt32Fast();
|
| - if (isJSArray(baseValue)) {
|
| + if (isJSArray(globalData, baseValue)) {
|
| JSArray* jsArray = asArray(baseValue);
|
| if (jsArray->canGetIndex(i))
|
| result = jsArray->getIndex(i);
|
| else
|
| result = jsArray->JSArray::get(callFrame, i);
|
| - } else if (isJSString(baseValue) && asString(baseValue)->canGetIndex(i))
|
| + } else if (isJSString(globalData, baseValue) && asString(baseValue)->canGetIndex(i))
|
| result = asString(baseValue)->getIndex(&callFrame->globalData(), i);
|
| - else if (isJSByteArray(baseValue) && asByteArray(baseValue)->canAccessIndex(i))
|
| + else if (isJSByteArray(globalData, baseValue) && asByteArray(baseValue)->canAccessIndex(i))
|
| result = asByteArray(baseValue)->getIndex(callFrame, i);
|
| else
|
| result = baseValue.get(callFrame, i);
|
| @@ -2517,13 +2477,13 @@
|
|
|
| if (LIKELY(subscript.isUInt32Fast())) {
|
| uint32_t i = subscript.getUInt32Fast();
|
| - if (isJSArray(baseValue)) {
|
| + if (isJSArray(globalData, baseValue)) {
|
| JSArray* jsArray = asArray(baseValue);
|
| if (jsArray->canSetIndex(i))
|
| jsArray->setIndex(i, callFrame[value].jsValue(callFrame));
|
| else
|
| jsArray->JSArray::put(callFrame, i, callFrame[value].jsValue(callFrame));
|
| - } else if (isJSByteArray(baseValue) && asByteArray(baseValue)->canAccessIndex(i)) {
|
| + } else if (isJSByteArray(globalData, baseValue) && asByteArray(baseValue)->canAccessIndex(i)) {
|
| JSByteArray* jsByteArray = asByteArray(baseValue);
|
| double dValue = 0;
|
| JSValuePtr jsValue = callFrame[value].jsValue(callFrame);
|
|
|