Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (157558 => 157559)
--- trunk/Source/_javascript_Core/ChangeLog 2013-10-17 03:47:27 UTC (rev 157558)
+++ trunk/Source/_javascript_Core/ChangeLog 2013-10-17 07:20:20 UTC (rev 157559)
@@ -1,3 +1,43 @@
+2013-10-16 Mark Lam <mark....@apple.com>
+
+ Transition remaining op_get* JITStubs to JIT operations.
+ https://bugs.webkit.org/show_bug.cgi?id=122925.
+
+ Reviewed by Geoffrey Garen.
+
+ Transitioning:
+ cti_op_get_by_id_generic
+ cti_op_get_by_val
+ cti_op_get_by_val_generic
+ cti_op_get_by_val_string
+
+ * dfg/DFGOperations.cpp:
+ * dfg/DFGOperations.h:
+ * jit/JIT.h:
+ * jit/JITInlines.h:
+ (JSC::JIT::callOperation):
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emitSlow_op_get_arguments_length):
+ (JSC::JIT::emitSlow_op_get_argument_by_val):
+ * jit/JITOpcodes32_64.cpp:
+ (JSC::JIT::emitSlow_op_get_arguments_length):
+ (JSC::JIT::emitSlow_op_get_argument_by_val):
+ * jit/JITOperations.cpp:
+ * jit/JITOperations.h:
+ * jit/JITPropertyAccess.cpp:
+ (JSC::JIT::emitSlow_op_get_by_val):
+ (JSC::JIT::emitSlow_op_get_by_pname):
+ (JSC::JIT::privateCompileGetByVal):
+ * jit/JITPropertyAccess32_64.cpp:
+ (JSC::JIT::emitSlow_op_get_by_val):
+ (JSC::JIT::emitSlow_op_get_by_pname):
+ * jit/JITStubs.cpp:
+ * jit/JITStubs.h:
+ * runtime/Executable.cpp:
+ (JSC::setupLLInt): Added some UNUSED_PARAMs to fix the no LLINT build.
+ * runtime/Options.cpp:
+ (JSC::Options::initialize):
+
2013-10-16 Filip Pizlo <fpi...@apple.com>
libllvmForJSC shouldn't call exit(1) on report_fatal_error()
Modified: trunk/Source/_javascript_Core/dfg/DFGOperations.cpp (157558 => 157559)
--- trunk/Source/_javascript_Core/dfg/DFGOperations.cpp 2013-10-17 03:47:27 UTC (rev 157558)
+++ trunk/Source/_javascript_Core/dfg/DFGOperations.cpp 2013-10-17 07:20:20 UTC (rev 157559)
@@ -699,18 +699,6 @@
jsCast<Arguments*>(argumentsCell)->tearOff(exec, inlineCallFrame);
}
-EncodedJSValue JIT_OPERATION operationGetArgumentsLength(ExecState* exec, int32_t argumentsRegister)
-{
- VM& vm = exec->vm();
- NativeCallFrameTracer tracer(&vm, exec);
- // Here we can assume that the argumernts were created. Because otherwise the JIT code would
- // have not made this call.
- Identifier ident(&vm, "length");
- JSValue baseValue = exec->uncheckedR(argumentsRegister).jsValue();
- PropertySlot slot(baseValue);
- return JSValue::encode(baseValue.get(exec, ident, slot));
-}
-
EncodedJSValue JIT_OPERATION operationGetArgumentByVal(ExecState* exec, int32_t argumentsRegister, int32_t index)
{
VM& vm = exec->vm();
Modified: trunk/Source/_javascript_Core/dfg/DFGOperations.h (157558 => 157559)
--- trunk/Source/_javascript_Core/dfg/DFGOperations.h 2013-10-17 03:47:27 UTC (rev 157558)
+++ trunk/Source/_javascript_Core/dfg/DFGOperations.h 2013-10-17 07:20:20 UTC (rev 157559)
@@ -92,7 +92,6 @@
size_t JIT_OPERATION operationCompareStrictEq(ExecState*, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) WTF_INTERNAL;
JSCell* JIT_OPERATION operationCreateInlinedArguments(ExecState*, InlineCallFrame*) WTF_INTERNAL;
void JIT_OPERATION operationTearOffInlinedArguments(ExecState*, JSCell*, JSCell*, InlineCallFrame*) WTF_INTERNAL;
-EncodedJSValue JIT_OPERATION operationGetArgumentsLength(ExecState*, int32_t) WTF_INTERNAL;
EncodedJSValue JIT_OPERATION operationGetInlinedArgumentByVal(ExecState*, int32_t, InlineCallFrame*, int32_t) WTF_INTERNAL;
EncodedJSValue JIT_OPERATION operationGetArgumentByVal(ExecState*, int32_t, int32_t) WTF_INTERNAL;
JSCell* JIT_OPERATION operationNewFunctionNoCheck(ExecState*, JSCell*) WTF_INTERNAL;
Modified: trunk/Source/_javascript_Core/jit/JIT.h (157558 => 157559)
--- trunk/Source/_javascript_Core/jit/JIT.h 2013-10-17 03:47:27 UTC (rev 157558)
+++ trunk/Source/_javascript_Core/jit/JIT.h 2013-10-17 07:20:20 UTC (rev 157559)
@@ -787,6 +787,11 @@
#endif
MacroAssembler::Call callOperation(J_JITOperation_EJIdc, int, GPRReg, const Identifier*);
MacroAssembler::Call callOperation(J_JITOperation_EJJ, int, GPRReg, GPRReg);
+#if USE(JSVALUE64)
+ MacroAssembler::Call callOperation(WithProfileTag, J_JITOperation_EJJ, int, GPRReg, GPRReg);
+#else
+ MacroAssembler::Call callOperation(WithProfileTag, J_JITOperation_EJJ, int, GPRReg, GPRReg, GPRReg, GPRReg);
+#endif
MacroAssembler::Call callOperation(J_JITOperation_EP, int, void*);
MacroAssembler::Call callOperation(WithProfileTag, J_JITOperation_EPc, int, Instruction*);
MacroAssembler::Call callOperation(J_JITOperation_EZ, int, int32_t);
Modified: trunk/Source/_javascript_Core/jit/JITInlines.h (157558 => 157559)
--- trunk/Source/_javascript_Core/jit/JITInlines.h 2013-10-17 03:47:27 UTC (rev 157558)
+++ trunk/Source/_javascript_Core/jit/JITInlines.h 2013-10-17 07:20:20 UTC (rev 157559)
@@ -217,6 +217,12 @@
setupArgumentsWithExecState(arg1, TrustedImmPtr(uid));
return appendCallWithExceptionCheckSetJSValueResultWithProfile(operation, dst);
}
+
+ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(JIT::WithProfileTag, J_JITOperation_EJJ operation, int dst, GPRReg arg1, GPRReg arg2)
+{
+ setupArgumentsWithExecState(arg1, arg2);
+ return appendCallWithExceptionCheckSetJSValueResultWithProfile(operation, dst);
+}
#endif
ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(J_JITOperation_E operation, int dst)
@@ -459,6 +465,12 @@
return appendCallWithExceptionCheckSetJSValueResult(operation, dst);
}
+ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(JIT::WithProfileTag, J_JITOperation_EJJ operation, int dst, GPRReg arg1Tag, GPRReg arg1Payload, GPRReg arg2Tag, GPRReg arg2Payload)
+{
+ setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1Payload, arg1Tag, SH4_32BIT_DUMMY_ARG arg2Payload, arg2Tag);
+ return appendCallWithExceptionCheckSetJSValueResultWithProfile(operation, dst);
+}
+
ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(P_JITOperation_EJS operation, GPRReg arg1Tag, GPRReg arg1Payload, size_t arg2)
{
setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1Payload, arg1Tag, TrustedImmPtr(arg2));
Modified: trunk/Source/_javascript_Core/jit/JITOpcodes.cpp (157558 => 157559)
--- trunk/Source/_javascript_Core/jit/JITOpcodes.cpp 2013-10-17 03:47:27 UTC (rev 157558)
+++ trunk/Source/_javascript_Core/jit/JITOpcodes.cpp 2013-10-17 07:20:20 UTC (rev 157559)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009, 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2009, 2012, 2013 Apple Inc. All rights reserved.
* Copyright (C) 2010 Patrick Gansterer <par...@paroga.com>
*
* Redistribution and use in source and binary forms, with or without
@@ -1069,13 +1069,7 @@
linkSlowCase(iter);
int dst = currentInstruction[1].u.operand;
int base = currentInstruction[2].u.operand;
- const Identifier* ident = &(m_codeBlock->identifier(currentInstruction[3].u.operand));
-
- emitGetVirtualRegister(base, regT0);
- JITStubCall stubCall(this, cti_op_get_by_id_generic);
- stubCall.addArgument(regT0);
- stubCall.addArgument(TrustedImmPtr(ident));
- stubCall.call(dst);
+ callOperation(operationGetArgumentsLength, dst, base);
}
void JIT::emit_op_get_argument_by_val(Instruction* currentInstruction)
@@ -1113,10 +1107,9 @@
emitStoreCell(unmodifiedArgumentsRegister(VirtualRegister(arguments)), returnValueRegister);
skipArgumentsCreation.link(this);
- JITStubCall stubCall(this, cti_op_get_by_val_generic);
- stubCall.addArgument(arguments, regT2);
- stubCall.addArgument(property, regT2);
- stubCall.callWithValueProfiling(dst);
+ emitGetVirtualRegister(arguments, regT0);
+ emitGetVirtualRegister(property, regT1);
+ callOperation(WithProfile, operationGetByValGeneric, dst, regT0, regT1);
}
#endif // USE(JSVALUE64)
Modified: trunk/Source/_javascript_Core/jit/JITOpcodes32_64.cpp (157558 => 157559)
--- trunk/Source/_javascript_Core/jit/JITOpcodes32_64.cpp 2013-10-17 03:47:27 UTC (rev 157558)
+++ trunk/Source/_javascript_Core/jit/JITOpcodes32_64.cpp 2013-10-17 07:20:20 UTC (rev 157559)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009, 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2009, 2012, 2013 Apple Inc. All rights reserved.
* Copyright (C) 2010 Patrick Gansterer <par...@paroga.com>
*
* Redistribution and use in source and binary forms, with or without
@@ -1192,12 +1192,7 @@
linkSlowCase(iter);
int dst = currentInstruction[1].u.operand;
int base = currentInstruction[2].u.operand;
- int ident = currentInstruction[3].u.operand;
-
- JITStubCall stubCall(this, cti_op_get_by_id_generic);
- stubCall.addArgument(base);
- stubCall.addArgument(TrustedImmPtr(&(m_codeBlock->identifier(ident))));
- stubCall.call(dst);
+ callOperation(operationGetArgumentsLength, dst, base);
}
void JIT::emit_op_get_argument_by_val(Instruction* currentInstruction)
@@ -1236,10 +1231,9 @@
emitStoreCell(unmodifiedArgumentsRegister(VirtualRegister(arguments)).offset(), returnValueRegister);
skipArgumentsCreation.link(this);
- JITStubCall stubCall(this, cti_op_get_by_val_generic);
- stubCall.addArgument(arguments);
- stubCall.addArgument(property);
- stubCall.callWithValueProfiling(dst);
+ emitLoad(arguments, regT1, regT0);
+ emitLoad(property, regT3, regT2);
+ callOperation(WithProfile, operationGetByValGeneric, dst, regT1, regT0, regT3, regT2);
}
} // namespace JSC
Modified: trunk/Source/_javascript_Core/jit/JITOperations.cpp (157558 => 157559)
--- trunk/Source/_javascript_Core/jit/JITOperations.cpp 2013-10-17 03:47:27 UTC (rev 157558)
+++ trunk/Source/_javascript_Core/jit/JITOperations.cpp 2013-10-17 07:20:20 UTC (rev 157559)
@@ -1295,6 +1295,124 @@
return result;
}
+EncodedJSValue JIT_OPERATION operationGetArgumentsLength(ExecState* exec, int32_t argumentsRegister)
+{
+ VM& vm = exec->vm();
+ NativeCallFrameTracer tracer(&vm, exec);
+ // Here we can assume that the argumernts were created. Because otherwise the JIT code would
+ // have not made this call.
+ Identifier ident(&vm, "length");
+ JSValue baseValue = exec->uncheckedR(argumentsRegister).jsValue();
+ PropertySlot slot(baseValue);
+ return JSValue::encode(baseValue.get(exec, ident, slot));
+}
+
+static JSValue getByVal(ExecState* exec, JSValue baseValue, JSValue subscript, ReturnAddressPtr returnAddress)
+{
+ if (LIKELY(baseValue.isCell() && subscript.isString())) {
+ if (JSValue result = baseValue.asCell()->fastGetOwnProperty(exec, asString(subscript)->value(exec)))
+ return result;
+ }
+
+ if (subscript.isUInt32()) {
+ uint32_t i = subscript.asUInt32();
+ if (isJSString(baseValue) && asString(baseValue)->canGetIndex(i)) {
+ ctiPatchCallByReturnAddress(exec->codeBlock(), returnAddress, FunctionPtr(operationGetByValString));
+ return asString(baseValue)->getIndex(exec, i);
+ }
+ return baseValue.get(exec, i);
+ }
+
+ if (isName(subscript))
+ return baseValue.get(exec, jsCast<NameInstance*>(subscript.asCell())->privateName());
+
+ Identifier property(exec, subscript.toString(exec)->value(exec));
+ return baseValue.get(exec, property);
+}
+
+EncodedJSValue JIT_OPERATION operationGetByValGeneric(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedSubscript)
+{
+ VM& vm = exec->vm();
+ NativeCallFrameTracer tracer(&vm, exec);
+ JSValue baseValue = JSValue::decode(encodedBase);
+ JSValue subscript = JSValue::decode(encodedSubscript);
+
+ JSValue result = getByVal(exec, baseValue, subscript, ReturnAddressPtr(OUR_RETURN_ADDRESS));
+ return JSValue::encode(result);
+}
+
+EncodedJSValue JIT_OPERATION operationGetByValDefault(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedSubscript)
+{
+ VM& vm = exec->vm();
+ NativeCallFrameTracer tracer(&vm, exec);
+ JSValue baseValue = JSValue::decode(encodedBase);
+ JSValue subscript = JSValue::decode(encodedSubscript);
+
+ if (baseValue.isObject() && subscript.isInt32()) {
+ // See if it's worth optimizing this at all.
+ JSObject* object = asObject(baseValue);
+ bool didOptimize = false;
+
+ unsigned bytecodeOffset = exec->locationAsBytecodeOffset();
+ ASSERT(bytecodeOffset);
+ ByValInfo& byValInfo = exec->codeBlock()->getByValInfo(bytecodeOffset - 1);
+ ASSERT(!byValInfo.stubRoutine);
+
+ if (hasOptimizableIndexing(object->structure())) {
+ // Attempt to optimize.
+ JITArrayMode arrayMode = jitArrayModeForStructure(object->structure());
+ if (arrayMode != byValInfo.arrayMode) {
+ JIT::compileGetByVal(&vm, exec->codeBlock(), &byValInfo, ReturnAddressPtr(OUR_RETURN_ADDRESS), arrayMode);
+ didOptimize = true;
+ }
+ }
+
+ if (!didOptimize) {
+ // If we take slow path more than 10 times without patching then make sure we
+ // never make that mistake again. Or, if we failed to patch and we have some object
+ // that intercepts indexed get, then don't even wait until 10 times. For cases
+ // where we see non-index-intercepting objects, this gives 10 iterations worth of
+ // opportunity for us to observe that the get_by_val may be polymorphic.
+ if (++byValInfo.slowPathCount >= 10
+ || object->structure()->typeInfo().interceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero()) {
+ // Don't ever try to optimize.
+ RepatchBuffer repatchBuffer(exec->codeBlock());
+ repatchBuffer.relinkCallerToFunction(ReturnAddressPtr(OUR_RETURN_ADDRESS), FunctionPtr(operationGetByValGeneric));
+ }
+ }
+ }
+
+ JSValue result = getByVal(exec, baseValue, subscript, ReturnAddressPtr(OUR_RETURN_ADDRESS));
+ return JSValue::encode(result);
+}
+
+EncodedJSValue JIT_OPERATION operationGetByValString(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedSubscript)
+{
+ VM& vm = exec->vm();
+ NativeCallFrameTracer tracer(&vm, exec);
+ JSValue baseValue = JSValue::decode(encodedBase);
+ JSValue subscript = JSValue::decode(encodedSubscript);
+
+ JSValue result;
+ if (LIKELY(subscript.isUInt32())) {
+ uint32_t i = subscript.asUInt32();
+ if (isJSString(baseValue) && asString(baseValue)->canGetIndex(i))
+ result = asString(baseValue)->getIndex(exec, i);
+ else {
+ result = baseValue.get(exec, i);
+ if (!isJSString(baseValue))
+ ctiPatchCallByReturnAddress(exec->codeBlock(), ReturnAddressPtr(OUR_RETURN_ADDRESS), FunctionPtr(operationGetByValDefault));
+ }
+ } else if (isName(subscript))
+ result = baseValue.get(exec, jsCast<NameInstance*>(subscript.asCell())->privateName());
+ else {
+ Identifier property(exec, subscript.toString(exec)->value(exec));
+ result = baseValue.get(exec, property);
+ }
+
+ return JSValue::encode(result);
+}
+
void JIT_OPERATION operationTearOffActivation(ExecState* exec, JSCell* activationCell)
{
VM& vm = exec->vm();
Modified: trunk/Source/_javascript_Core/jit/JITOperations.h (157558 => 157559)
--- trunk/Source/_javascript_Core/jit/JITOperations.h 2013-10-17 03:47:27 UTC (rev 157558)
+++ trunk/Source/_javascript_Core/jit/JITOperations.h 2013-10-17 07:20:20 UTC (rev 157559)
@@ -278,6 +278,10 @@
EncodedJSValue JIT_OPERATION operationCheckHasInstance(ExecState*, EncodedJSValue, EncodedJSValue baseVal) WTF_INTERNAL;
JSCell* JIT_OPERATION operationCreateActivation(ExecState*, int32_t offset) WTF_INTERNAL;
JSCell* JIT_OPERATION operationCreateArguments(ExecState*) WTF_INTERNAL;
+EncodedJSValue JIT_OPERATION operationGetArgumentsLength(ExecState*, int32_t) WTF_INTERNAL;
+EncodedJSValue JIT_OPERATION operationGetByValDefault(ExecState*, EncodedJSValue encodedBase, EncodedJSValue encodedSubscript) WTF_INTERNAL;
+EncodedJSValue JIT_OPERATION operationGetByValGeneric(ExecState*, EncodedJSValue encodedBase, EncodedJSValue encodedSubscript) WTF_INTERNAL;
+EncodedJSValue JIT_OPERATION operationGetByValString(ExecState*, EncodedJSValue encodedBase, EncodedJSValue encodedSubscript) WTF_INTERNAL;
void JIT_OPERATION operationTearOffActivation(ExecState*, JSCell*) WTF_INTERNAL;
void JIT_OPERATION operationTearOffArguments(ExecState*, JSCell*, JSCell*) WTF_INTERNAL;
EncodedJSValue JIT_OPERATION operationDeleteById(ExecState*, EncodedJSValue base, const Identifier*) WTF_INTERNAL;
Modified: trunk/Source/_javascript_Core/jit/JITPropertyAccess.cpp (157558 => 157559)
--- trunk/Source/_javascript_Core/jit/JITPropertyAccess.cpp 2013-10-17 03:47:27 UTC (rev 157558)
+++ trunk/Source/_javascript_Core/jit/JITPropertyAccess.cpp 2013-10-17 07:20:20 UTC (rev 157559)
@@ -230,10 +230,9 @@
Label slowPath = label();
- JITStubCall stubCall(this, cti_op_get_by_val);
- stubCall.addArgument(base, regT2);
- stubCall.addArgument(property, regT2);
- Call call = stubCall.call(dst);
+ emitGetVirtualRegister(base, regT0);
+ emitGetVirtualRegister(property, regT1);
+ Call call = callOperation(operationGetByValDefault, dst, regT0, regT1);
m_byValCompilationInfo[m_byValInstructionIndex].slowPathTarget = slowPath;
m_byValCompilationInfo[m_byValInstructionIndex].returnAddress = call;
@@ -307,10 +306,9 @@
linkSlowCase(iter);
linkSlowCase(iter);
- JITStubCall stubCall(this, cti_op_get_by_val_generic);
- stubCall.addArgument(base, regT2);
- stubCall.addArgument(property, regT2);
- stubCall.call(dst);
+ emitGetVirtualRegister(base, regT0);
+ emitGetVirtualRegister(property, regT1);
+ callOperation(operationGetByValGeneric, dst, regT0, regT1);
}
void JIT::emit_op_put_by_val(Instruction* currentInstruction)
@@ -992,7 +990,7 @@
RepatchBuffer repatchBuffer(m_codeBlock);
repatchBuffer.relink(byValInfo->badTypeJump, CodeLocationLabel(byValInfo->stubRoutine->code().code()));
- repatchBuffer.relinkCallerToFunction(returnAddress, FunctionPtr(cti_op_get_by_val_generic));
+ repatchBuffer.relinkCallerToFunction(returnAddress, FunctionPtr(operationGetByValGeneric));
}
void JIT::privateCompilePutByVal(ByValInfo* byValInfo, ReturnAddressPtr returnAddress, JITArrayMode arrayMode)
Modified: trunk/Source/_javascript_Core/jit/JITPropertyAccess32_64.cpp (157558 => 157559)
--- trunk/Source/_javascript_Core/jit/JITPropertyAccess32_64.cpp 2013-10-17 03:47:27 UTC (rev 157558)
+++ trunk/Source/_javascript_Core/jit/JITPropertyAccess32_64.cpp 2013-10-17 07:20:20 UTC (rev 157559)
@@ -262,10 +262,9 @@
Label slowPath = label();
- JITStubCall stubCall(this, cti_op_get_by_val);
- stubCall.addArgument(base);
- stubCall.addArgument(property);
- Call call = stubCall.call(dst);
+ emitLoad(base, regT1, regT0);
+ emitLoad(property, regT3, regT2);
+ Call call = callOperation(operationGetByValDefault, dst, regT1, regT0, regT3, regT2);
m_byValCompilationInfo[m_byValInstructionIndex].slowPathTarget = slowPath;
m_byValCompilationInfo[m_byValInstructionIndex].returnAddress = call;
@@ -702,10 +701,9 @@
linkSlowCase(iter);
linkSlowCase(iter);
- JITStubCall stubCall(this, cti_op_get_by_val_generic);
- stubCall.addArgument(base);
- stubCall.addArgument(property);
- stubCall.call(dst);
+ emitLoad(base, regT1, regT0);
+ emitLoad(property, regT3, regT2);
+ callOperation(operationGetByValGeneric, dst, regT1, regT0, regT3, regT2);
}
void JIT::emitVarInjectionCheck(bool needsVarInjectionChecks)
Modified: trunk/Source/_javascript_Core/jit/JITStubs.cpp (157558 => 157559)
--- trunk/Source/_javascript_Core/jit/JITStubs.cpp 2013-10-17 03:47:27 UTC (rev 157558)
+++ trunk/Source/_javascript_Core/jit/JITStubs.cpp 2013-10-17 07:20:20 UTC (rev 157559)
@@ -272,139 +272,6 @@
#define DEFINE_STUB_FUNCTION(rtype, op) rtype JIT_STUB cti_##op(STUB_ARGS_DECLARATION)
#endif
-// FIXME: This is still used by get_arguments_length, but other than that it's dead.
-DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id_generic)
-{
- STUB_INIT_STACK_FRAME(stackFrame);
-
- CallFrame* callFrame = stackFrame.callFrame;
- Identifier& ident = stackFrame.args[1].identifier();
-
- JSValue baseValue = stackFrame.args[0].jsValue();
- PropertySlot slot(baseValue);
- JSValue result = baseValue.get(callFrame, ident, slot);
-
- CHECK_FOR_EXCEPTION_AT_END();
- return JSValue::encode(result);
-}
-
-static JSValue getByVal(
- CallFrame* callFrame, JSValue baseValue, JSValue subscript, ReturnAddressPtr returnAddress)
-{
- if (LIKELY(baseValue.isCell() && subscript.isString())) {
- if (JSValue result = baseValue.asCell()->fastGetOwnProperty(callFrame, asString(subscript)->value(callFrame)))
- return result;
- }
-
- if (subscript.isUInt32()) {
- uint32_t i = subscript.asUInt32();
- if (isJSString(baseValue) && asString(baseValue)->canGetIndex(i)) {
- ctiPatchCallByReturnAddress(callFrame->codeBlock(), returnAddress, FunctionPtr(cti_op_get_by_val_string));
- return asString(baseValue)->getIndex(callFrame, i);
- }
- return baseValue.get(callFrame, i);
- }
-
- if (isName(subscript))
- return baseValue.get(callFrame, jsCast<NameInstance*>(subscript.asCell())->privateName());
-
- Identifier property(callFrame, subscript.toString(callFrame)->value(callFrame));
- return baseValue.get(callFrame, property);
-}
-
-DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_val)
-{
- STUB_INIT_STACK_FRAME(stackFrame);
-
- CallFrame* callFrame = stackFrame.callFrame;
-
- JSValue baseValue = stackFrame.args[0].jsValue();
- JSValue subscript = stackFrame.args[1].jsValue();
-
- if (baseValue.isObject() && subscript.isInt32()) {
- // See if it's worth optimizing this at all.
- JSObject* object = asObject(baseValue);
- bool didOptimize = false;
-
- unsigned bytecodeOffset = callFrame->locationAsBytecodeOffset();
- ASSERT(bytecodeOffset);
- ByValInfo& byValInfo = callFrame->codeBlock()->getByValInfo(bytecodeOffset - 1);
- ASSERT(!byValInfo.stubRoutine);
-
- if (hasOptimizableIndexing(object->structure())) {
- // Attempt to optimize.
- JITArrayMode arrayMode = jitArrayModeForStructure(object->structure());
- if (arrayMode != byValInfo.arrayMode) {
- JIT::compileGetByVal(&callFrame->vm(), callFrame->codeBlock(), &byValInfo, STUB_RETURN_ADDRESS, arrayMode);
- didOptimize = true;
- }
- }
-
- if (!didOptimize) {
- // If we take slow path more than 10 times without patching then make sure we
- // never make that mistake again. Or, if we failed to patch and we have some object
- // that intercepts indexed get, then don't even wait until 10 times. For cases
- // where we see non-index-intercepting objects, this gives 10 iterations worth of
- // opportunity for us to observe that the get_by_val may be polymorphic.
- if (++byValInfo.slowPathCount >= 10
- || object->structure()->typeInfo().interceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero()) {
- // Don't ever try to optimize.
- RepatchBuffer repatchBuffer(callFrame->codeBlock());
- repatchBuffer.relinkCallerToFunction(STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_val_generic));
- }
- }
- }
-
- JSValue result = getByVal(callFrame, baseValue, subscript, STUB_RETURN_ADDRESS);
- CHECK_FOR_EXCEPTION();
- return JSValue::encode(result);
-}
-
-DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_val_generic)
-{
- STUB_INIT_STACK_FRAME(stackFrame);
-
- CallFrame* callFrame = stackFrame.callFrame;
-
- JSValue baseValue = stackFrame.args[0].jsValue();
- JSValue subscript = stackFrame.args[1].jsValue();
-
- JSValue result = getByVal(callFrame, baseValue, subscript, STUB_RETURN_ADDRESS);
- CHECK_FOR_EXCEPTION();
- return JSValue::encode(result);
-}
-
-DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_val_string)
-{
- STUB_INIT_STACK_FRAME(stackFrame);
-
- CallFrame* callFrame = stackFrame.callFrame;
-
- JSValue baseValue = stackFrame.args[0].jsValue();
- JSValue subscript = stackFrame.args[1].jsValue();
-
- JSValue result;
-
- if (LIKELY(subscript.isUInt32())) {
- uint32_t i = subscript.asUInt32();
- if (isJSString(baseValue) && asString(baseValue)->canGetIndex(i))
- result = asString(baseValue)->getIndex(callFrame, i);
- else {
- result = baseValue.get(callFrame, i);
- if (!isJSString(baseValue))
- ctiPatchCallByReturnAddress(callFrame->codeBlock(), STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_val));
- }
- } else if (isName(subscript))
- result = baseValue.get(callFrame, jsCast<NameInstance*>(subscript.asCell())->privateName());
- else {
- Identifier property(callFrame, subscript.toString(callFrame)->value(callFrame));
- result = baseValue.get(callFrame, property);
- }
-
- CHECK_FOR_EXCEPTION_AT_END();
- return JSValue::encode(result);
-}
-
DEFINE_STUB_FUNCTION(void*, op_throw)
{
STUB_INIT_STACK_FRAME(stackFrame);
Modified: trunk/Source/_javascript_Core/jit/JITStubs.h (157558 => 157559)
--- trunk/Source/_javascript_Core/jit/JITStubs.h 2013-10-17 03:47:27 UTC (rev 157558)
+++ trunk/Source/_javascript_Core/jit/JITStubs.h 2013-10-17 07:20:20 UTC (rev 157559)
@@ -355,10 +355,6 @@
void performPlatformSpecificJITAssertions(VM*);
extern "C" {
-EncodedJSValue JIT_STUB cti_op_get_by_id_generic(STUB_ARGS_DECLARATION) WTF_INTERNAL;
-EncodedJSValue JIT_STUB cti_op_get_by_val(STUB_ARGS_DECLARATION) WTF_INTERNAL;
-EncodedJSValue JIT_STUB cti_op_get_by_val_generic(STUB_ARGS_DECLARATION) WTF_INTERNAL;
-EncodedJSValue JIT_STUB cti_op_get_by_val_string(STUB_ARGS_DECLARATION) WTF_INTERNAL;
void JIT_STUB cti_op_throw_static_error(STUB_ARGS_DECLARATION) WTF_INTERNAL;
void* JIT_STUB cti_op_throw(STUB_ARGS_DECLARATION) WTF_INTERNAL;
void* JIT_STUB cti_vm_throw(STUB_ARGS_DECLARATION) REFERENCED_FROM_ASM WTF_INTERNAL;
Modified: trunk/Source/_javascript_Core/runtime/Executable.cpp (157558 => 157559)
--- trunk/Source/_javascript_Core/runtime/Executable.cpp 2013-10-17 03:47:27 UTC (rev 157558)
+++ trunk/Source/_javascript_Core/runtime/Executable.cpp 2013-10-17 07:20:20 UTC (rev 157559)
@@ -265,6 +265,8 @@
#if ENABLE(LLINT)
LLInt::setEntrypoint(vm, codeBlock);
#else
+ UNUSED_PARAM(vm);
+ UNUSED_PARAM(codeBlock);
UNREACHABLE_FOR_PLATFORM();
#endif
}