WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
138707.patch (text/plain), 26.58 KB, created by
Michael Saboff
on 2014-11-13 14:48:54 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Michael Saboff
Created:
2014-11-13 14:48:54 PST
Size:
26.58 KB
patch
obsolete
>Index: Source/JavaScriptCore/ChangeLog >=================================================================== >--- Source/JavaScriptCore/ChangeLog (revision 176092) >+++ Source/JavaScriptCore/ChangeLog (working copy) >@@ -1,3 +1,65 @@ >+2014-11-13 Michael Saboff <msaboff@apple.com> >+ >+ Add scope operand to op_new_func* byte codes >+ https://bugs.webkit.org/show_bug.cgi?id=138707 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Added scope operand to op_new_func and op_new_func_expr to replace the implicit use >+ of exec->scope(). >+ >+ * bytecode/BytecodeList.json: Increased size of op_new_func & op_new_func_expr bytecodes. >+ >+ * bytecode/CodeBlock.cpp: >+ (JSC::CodeBlock::dumpBytecode): Added scope operand to dump output. >+ >+ * bytecompiler/BytecodeGenerator.cpp: >+ (JSC::BytecodeGenerator::emitNewFunctionInternal): >+ (JSC::BytecodeGenerator::emitNewFunctionExpression): >+ Emit scope operand. >+ >+ * dfg/DFGByteCodeParser.cpp: >+ (JSC::DFG::ByteCodeParser::parseBlock): >+ * dfg/DFGFixupPhase.cpp: >+ (JSC::DFG::FixupPhase::fixupNode): >+ Added new scope source nodes to NewFunction, NewFunctionExpression & NewFunctionNoCheck. >+ >+ * dfg/DFGSpeculativeJIT.cpp: >+ (JSC::DFG::SpeculativeJIT::compileNewFunctionNoCheck): >+ (JSC::DFG::SpeculativeJIT::compileNewFunctionExpression): >+ * dfg/DFGSpeculativeJIT32_64.cpp: >+ (JSC::DFG::SpeculativeJIT::compile): >+ * dfg/DFGSpeculativeJIT64.cpp: >+ (JSC::DFG::SpeculativeJIT::compile): >+ Use scope children when making new function JIT_Operation calls. Use JSScope* value instead of >+ exec->scope(). >+ >+ * dfg/DFGOperations.h: >+ * dfg/DFGOperations.cpp: >+ * dfg/DFGSpeculativeJIT.h: >+ (JSC::DFG::SpeculativeJIT::callOperation): >+ * jit/JIT.h: >+ * jit/JITInlines.h: >+ (JSC::JIT::callOperation): >+ * jit/JITOpcodes.cpp: >+ (JSC::JIT::emit_op_new_func): >+ (JSC::JIT::emit_op_new_func_exp): >+ * jit/JITOperations.cpp: >+ * jit/JITOperations.h: >+ Added new Jsc JIT_Operation parameter type for JSScope* values. Created declarations and >+ definitions for new JIT_Operations with Jsc parameters. Use the JSScope* parameters in lieu >+ of exec->scope() in operationNewFunction(). >+ Removed comment for unused Jsa (JSLexicalEnvironment*) JIT_Operation parameter type. >+ >+ * llint/LLIntSlowPaths.cpp: >+ (JSC::LLInt::LLINT_SLOW_PATH_DECL): >+ Use the scope operand instead of exec->scope(). >+ >+ * llint/LowLevelInterpreter.asm: >+ * llint/LowLevelInterpreter32_64.asm: >+ * llint/LowLevelInterpreter64.asm: >+ Changed the operand indecies for added scope operand. >+ > 2014-11-13 Juergen Ributzka <juergen@apple.com> > > Update WebKit to build with LLVM TOT >Index: Source/JavaScriptCore/bytecode/BytecodeList.json >=================================================================== >--- Source/JavaScriptCore/bytecode/BytecodeList.json (revision 176004) >+++ Source/JavaScriptCore/bytecode/BytecodeList.json (working copy) >@@ -93,8 +93,8 @@ > { "name" : "op_switch_imm", "length" : 4 }, > { "name" : "op_switch_char", "length" : 4 }, > { "name" : "op_switch_string", "length" : 4 }, >- { "name" : "op_new_func", "length" : 4 }, >- { "name" : "op_new_func_exp", "length" : 3 }, >+ { "name" : "op_new_func", "length" : 5 }, >+ { "name" : "op_new_func_exp", "length" : 4 }, > { "name" : "op_call", "length" : 9 }, > { "name" : "op_call_eval", "length" : 9 }, > { "name" : "op_call_varargs", "length" : 9 }, >Index: Source/JavaScriptCore/bytecode/CodeBlock.cpp >=================================================================== >--- Source/JavaScriptCore/bytecode/CodeBlock.cpp (revision 176004) >+++ Source/JavaScriptCore/bytecode/CodeBlock.cpp (working copy) >@@ -1271,17 +1271,19 @@ void CodeBlock::dumpBytecode( > } > case op_new_func: { > int r0 = (++it)->u.operand; >+ int r1 = (++it)->u.operand; > int f0 = (++it)->u.operand; > int shouldCheck = (++it)->u.operand; > printLocationAndOp(out, exec, location, it, "new_func"); >- out.printf("%s, f%d, %s", registerName(r0).data(), f0, shouldCheck ? "<Checked>" : "<Unchecked>"); >+ out.printf("%s, %s, f%d, %s", registerName(r0).data(), registerName(r1).data(), f0, shouldCheck ? "<Checked>" : "<Unchecked>"); > break; > } > case op_new_func_exp: { > int r0 = (++it)->u.operand; >+ int r1 = (++it)->u.operand; > int f0 = (++it)->u.operand; > printLocationAndOp(out, exec, location, it, "new_func_exp"); >- out.printf("%s, f%d", registerName(r0).data(), f0); >+ out.printf("%s, %s, f%d", registerName(r0).data(), registerName(r1).data(), f0); > break; > } > case op_call: { >Index: Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp >=================================================================== >--- Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp (revision 176004) >+++ Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp (working copy) >@@ -1715,6 +1715,7 @@ RegisterID* BytecodeGenerator::emitNewFu > { > emitOpcode(op_new_func); > instructions().append(dst->index()); >+ instructions().append(scopeRegister()->index()); > instructions().append(index); > instructions().append(doNullCheck); > return dst; >@@ -1735,6 +1736,7 @@ RegisterID* BytecodeGenerator::emitNewFu > > emitOpcode(op_new_func_exp); > instructions().append(r0->index()); >+ instructions().append(scopeRegister()->index()); > instructions().append(index); > return r0; > } >Index: Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp >=================================================================== >--- Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp (revision 176005) >+++ Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp (working copy) >@@ -3433,22 +3433,22 @@ bool ByteCodeParser::parseBlock(unsigned > } > > case op_new_func: { >- if (!currentInstruction[3].u.operand) { >+ if (!currentInstruction[4].u.operand) { > set(VirtualRegister(currentInstruction[1].u.operand), >- addToGraph(NewFunctionNoCheck, OpInfo(currentInstruction[2].u.operand))); >+ addToGraph(NewFunctionNoCheck, OpInfo(currentInstruction[3].u.operand), get(VirtualRegister(currentInstruction[2].u.operand)))); > } else { > set(VirtualRegister(currentInstruction[1].u.operand), > addToGraph( > NewFunction, >- OpInfo(currentInstruction[2].u.operand), >- get(VirtualRegister(currentInstruction[1].u.operand)))); >+ OpInfo(currentInstruction[3].u.operand), >+ get(VirtualRegister(currentInstruction[1].u.operand)), get(VirtualRegister(currentInstruction[2].u.operand)))); > } > NEXT_OPCODE(op_new_func); > } > > case op_new_func_exp: { > set(VirtualRegister(currentInstruction[1].u.operand), >- addToGraph(NewFunctionExpression, OpInfo(currentInstruction[2].u.operand))); >+ addToGraph(NewFunctionExpression, OpInfo(currentInstruction[3].u.operand), get(VirtualRegister(currentInstruction[2].u.operand)))); > NEXT_OPCODE(op_new_func_exp); > } > >Index: Source/JavaScriptCore/dfg/DFGFixupPhase.cpp >=================================================================== >--- Source/JavaScriptCore/dfg/DFGFixupPhase.cpp (revision 176004) >+++ Source/JavaScriptCore/dfg/DFGFixupPhase.cpp (working copy) >@@ -1172,6 +1172,16 @@ private: > > break; > } >+ case NewFunction: { >+ fixEdge<CellUse>(node->child2()); >+ break; >+ } >+ >+ case NewFunctionNoCheck: >+ case NewFunctionExpression: { >+ fixEdge<CellUse>(node->child1()); >+ break; >+ } > > #if !ASSERT_DISABLED > // Have these no-op cases here to ensure that nobody forgets to add handlers for new opcodes. >@@ -1213,9 +1223,6 @@ private: > case GetMyArgumentsLength: > case GetMyArgumentsLengthSafe: > case CheckArgumentsNotCreated: >- case NewFunction: >- case NewFunctionNoCheck: >- case NewFunctionExpression: > case Jump: > case Return: > case Throw: >Index: Source/JavaScriptCore/dfg/DFGOperations.cpp >=================================================================== >--- Source/JavaScriptCore/dfg/DFGOperations.cpp (revision 176004) >+++ Source/JavaScriptCore/dfg/DFGOperations.cpp (working copy) >@@ -820,12 +820,12 @@ EncodedJSValue JIT_OPERATION operationGe > return JSValue::encode(argumentsValue.get(exec, index)); > } > >-JSCell* JIT_OPERATION operationNewFunctionNoCheck(ExecState* exec, JSCell* functionExecutable) >+JSCell* JIT_OPERATION operationNewFunctionNoCheck(ExecState* exec, JSScope* scope, JSCell* functionExecutable) > { > ASSERT(functionExecutable->inherits(FunctionExecutable::info())); > VM& vm = exec->vm(); > NativeCallFrameTracer tracer(&vm, exec); >- return JSFunction::create(vm, static_cast<FunctionExecutable*>(functionExecutable), exec->scope()); >+ return JSFunction::create(vm, static_cast<FunctionExecutable*>(functionExecutable), scope); > } > > size_t JIT_OPERATION operationIsObject(ExecState* exec, EncodedJSValue value) >Index: Source/JavaScriptCore/dfg/DFGOperations.h >=================================================================== >--- Source/JavaScriptCore/dfg/DFGOperations.h (revision 176004) >+++ Source/JavaScriptCore/dfg/DFGOperations.h (working copy) >@@ -101,7 +101,7 @@ JSCell* JIT_OPERATION operationCreateInl > void JIT_OPERATION operationTearOffInlinedArguments(ExecState*, JSCell*, JSCell*, InlineCallFrame*) 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; >+JSCell* JIT_OPERATION operationNewFunctionNoCheck(ExecState*, JSScope*, JSCell*) WTF_INTERNAL; > double JIT_OPERATION operationFModOnInts(int32_t, int32_t) WTF_INTERNAL; > size_t JIT_OPERATION operationIsObject(ExecState*, EncodedJSValue) WTF_INTERNAL; > size_t JIT_OPERATION operationIsFunction(EncodedJSValue) WTF_INTERNAL; >Index: Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp >=================================================================== >--- Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp (revision 176004) >+++ Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp (working copy) >@@ -4516,7 +4516,9 @@ void SpeculativeJIT::compile(Node* node) > GPRReg valuePayloadGPR = value.payloadGPR(); > GPRReg resultTagGPR = resultTag.gpr(); > GPRReg resultPayloadGPR = resultPayload.gpr(); >- >+ SpeculateCellOperand scope(this, node->child2()); >+ GPRReg scopeGPR = scope.gpr(); >+ > m_jit.move(valuePayloadGPR, resultPayloadGPR); > m_jit.move(valueTagGPR, resultTagGPR); > >@@ -4524,7 +4526,7 @@ void SpeculativeJIT::compile(Node* node) > > addSlowPathGenerator( > slowPathCall( >- notCreated, this, operationNewFunction, JSValueRegs(resultTagGPR, resultPayloadGPR), >+ notCreated, this, operationNewFunction, JSValueRegs(resultTagGPR, resultPayloadGPR), scopeGPR, > m_jit.codeBlock()->functionDecl(node->functionDeclIndex()))); > > jsValueResult(resultTagGPR, resultPayloadGPR, node); >Index: Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp >=================================================================== >--- Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp (revision 176004) >+++ Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp (working copy) >@@ -4546,6 +4546,8 @@ void SpeculativeJIT::compile(Node* node) > case NewFunction: { > JSValueOperand value(this, node->child1()); > GPRTemporary result(this, Reuse, value); >+ SpeculateCellOperand scope(this, node->child2()); >+ GPRReg scopeGPR = scope.gpr(); > > GPRReg valueGPR = value.gpr(); > GPRReg resultGPR = result.gpr(); >@@ -4557,7 +4559,7 @@ void SpeculativeJIT::compile(Node* node) > addSlowPathGenerator( > slowPathCall( > notCreated, this, operationNewFunction, >- resultGPR, m_jit.codeBlock()->functionDecl(node->functionDeclIndex()))); >+ resultGPR, scopeGPR, m_jit.codeBlock()->functionDecl(node->functionDeclIndex()))); > > jsValueResult(resultGPR, node); > break; >Index: Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp >=================================================================== >--- Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp (revision 176004) >+++ Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp (working copy) >@@ -4159,9 +4159,11 @@ void SpeculativeJIT::compileNewFunctionN > { > GPRFlushedCallResult result(this); > GPRReg resultGPR = result.gpr(); >+ SpeculateCellOperand scope(this, node->child1()); >+ GPRReg scopeGPR = scope.gpr(); > flushRegisters(); > callOperation( >- operationNewFunctionNoCheck, resultGPR, m_jit.codeBlock()->functionDecl(node->functionDeclIndex())); >+ operationNewFunctionNoCheck, resultGPR, scopeGPR, m_jit.codeBlock()->functionDecl(node->functionDeclIndex())); > cellResult(resultGPR, node); > } > >@@ -4169,10 +4171,12 @@ void SpeculativeJIT::compileNewFunctionE > { > GPRFlushedCallResult result(this); > GPRReg resultGPR = result.gpr(); >+ SpeculateCellOperand scope(this, node->child1()); >+ GPRReg scopeGPR = scope.gpr(); > flushRegisters(); > callOperation( > operationNewFunctionNoCheck, >- resultGPR, >+ resultGPR, scopeGPR, > m_jit.codeBlock()->functionExpr(node->functionExprIndex())); > cellResult(resultGPR, node); > } >Index: Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h >=================================================================== >--- Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h (revision 176004) >+++ Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h (working copy) >@@ -1049,7 +1049,7 @@ public: > m_jit.setupArgumentsWithExecState(arg1, arg2, arg3); > return appendCallWithExceptionCheckSetResult(operation, result); > } >- JITCompiler::Call callOperation(C_JITOperation_ECC operation, GPRReg result, GPRReg arg1, JSCell* cell) >+ JITCompiler::Call callOperation(C_JITOperation_EJscC operation, GPRReg result, GPRReg arg1, JSCell* cell) > { > m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(cell)); > return appendCallWithExceptionCheckSetResult(operation, result); >@@ -1288,6 +1288,11 @@ public: > m_jit.setupArgumentsWithExecState(arg1, arg2); > return appendCallWithExceptionCheckSetResult(operation, result); > } >+ JITCompiler::Call callOperation(J_JITOperation_EJscC operation, GPRReg result, GPRReg arg1, JSCell* cell) >+ { >+ m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(cell)); >+ return appendCallWithExceptionCheckSetResult(operation, result); >+ } > JITCompiler::Call callOperation(J_JITOperation_ESsiCI operation, GPRReg result, StructureStubInfo* stubInfo, GPRReg arg1, const StringImpl* uid) > { > m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1, TrustedImmPtr(uid)); >@@ -1595,6 +1600,11 @@ public: > m_jit.setupArgumentsWithExecState(arg1, arg2); > return appendCallWithExceptionCheckSetResult(operation, resultPayload, resultTag); > } >+ JITCompiler::Call callOperation(J_JITOperation_EJscC operation, GPRReg resultTag, GPRReg resultPayload, GPRReg arg1, JSCell* cell) >+ { >+ m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(cell)); >+ return appendCallWithExceptionCheckSetResult(operation, resultPayload, resultTag); >+ } > JITCompiler::Call callOperation(J_JITOperation_ESsiCI operation, GPRReg resultTag, GPRReg resultPayload, StructureStubInfo* stubInfo, GPRReg arg1, const StringImpl* uid) > { > m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1, TrustedImmPtr(uid)); >Index: Source/JavaScriptCore/jit/JIT.h >=================================================================== >--- Source/JavaScriptCore/jit/JIT.h (revision 176004) >+++ Source/JavaScriptCore/jit/JIT.h (working copy) >@@ -697,6 +697,7 @@ namespace JSC { > #endif > MacroAssembler::Call callOperation(J_JITOperation_EJIdc, int, GPRReg, const Identifier*); > MacroAssembler::Call callOperation(J_JITOperation_EJJ, int, GPRReg, GPRReg); >+ MacroAssembler::Call callOperation(J_JITOperation_EJscC, int, GPRReg, JSCell*); > #if USE(JSVALUE64) > MacroAssembler::Call callOperation(WithProfileTag, J_JITOperation_EJJ, int, GPRReg, GPRReg); > #else >Index: Source/JavaScriptCore/jit/JITInlines.h >=================================================================== >--- Source/JavaScriptCore/jit/JITInlines.h (revision 176004) >+++ Source/JavaScriptCore/jit/JITInlines.h (working copy) >@@ -258,6 +258,12 @@ ALWAYS_INLINE MacroAssembler::Call JIT:: > return appendCallWithExceptionCheck(operation); > } > >+ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(J_JITOperation_EJscC operation, int dst, GPRReg arg1, JSCell* cell) >+{ >+ setupArgumentsWithExecState(arg1, TrustedImmPtr(cell)); >+ return appendCallWithExceptionCheckSetJSValueResult(operation, dst); >+} >+ > ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(J_JITOperation_EP operation, int dst, void* pointer) > { > setupArgumentsWithExecState(TrustedImmPtr(pointer)); >Index: Source/JavaScriptCore/jit/JITOpcodes.cpp >=================================================================== >--- Source/JavaScriptCore/jit/JITOpcodes.cpp (revision 176004) >+++ Source/JavaScriptCore/jit/JITOpcodes.cpp (working copy) >@@ -1034,7 +1034,7 @@ void JIT::emit_op_new_func(Instruction* > { > Jump lazyJump; > int dst = currentInstruction[1].u.operand; >- if (currentInstruction[3].u.operand) { >+ if (currentInstruction[4].u.operand) { > #if USE(JSVALUE32_64) > lazyJump = branch32(NotEqual, tagFor(dst), TrustedImm32(JSValue::EmptyValueTag)); > #else >@@ -1042,18 +1042,28 @@ void JIT::emit_op_new_func(Instruction* > #endif > } > >- FunctionExecutable* funcExec = m_codeBlock->functionDecl(currentInstruction[2].u.operand); >- callOperation(operationNewFunction, dst, funcExec); >+#if USE(JSVALUE64) >+ emitGetVirtualRegister(currentInstruction[2].u.operand, regT0); >+#else >+ emitLoadPayload(currentInstruction[2].u.operand, regT0); >+#endif >+ FunctionExecutable* funcExec = m_codeBlock->functionDecl(currentInstruction[3].u.operand); >+ callOperation(operationNewFunction, dst, regT0, funcExec); > >- if (currentInstruction[3].u.operand) >+ if (currentInstruction[4].u.operand) > lazyJump.link(this); > } > > void JIT::emit_op_new_func_exp(Instruction* currentInstruction) > { > int dst = currentInstruction[1].u.operand; >- FunctionExecutable* funcExpr = m_codeBlock->functionExpr(currentInstruction[2].u.operand); >- callOperation(operationNewFunction, dst, funcExpr); >+#if USE(JSVALUE64) >+ emitGetVirtualRegister(currentInstruction[2].u.operand, regT0); >+#else >+ emitLoadPayload(currentInstruction[2].u.operand, regT0); >+#endif >+ FunctionExecutable* funcExpr = m_codeBlock->functionExpr(currentInstruction[3].u.operand); >+ callOperation(operationNewFunction, dst, regT0, funcExpr); > } > > void JIT::emit_op_new_array(Instruction* currentInstruction) >Index: Source/JavaScriptCore/jit/JITOperations.cpp >=================================================================== >--- Source/JavaScriptCore/jit/JITOperations.cpp (revision 176004) >+++ Source/JavaScriptCore/jit/JITOperations.cpp (working copy) >@@ -947,12 +947,12 @@ EncodedJSValue JIT_OPERATION operationNe > return JSValue::encode(constructArrayWithSizeQuirk(exec, profile, exec->lexicalGlobalObject(), sizeValue)); > } > >-EncodedJSValue JIT_OPERATION operationNewFunction(ExecState* exec, JSCell* functionExecutable) >+EncodedJSValue JIT_OPERATION operationNewFunction(ExecState* exec, JSScope* scope, JSCell* functionExecutable) > { > ASSERT(functionExecutable->inherits(FunctionExecutable::info())); > VM& vm = exec->vm(); > NativeCallFrameTracer tracer(&vm, exec); >- return JSValue::encode(JSFunction::create(vm, static_cast<FunctionExecutable*>(functionExecutable), exec->scope())); >+ return JSValue::encode(JSFunction::create(vm, static_cast<FunctionExecutable*>(functionExecutable), scope)); > } > > JSCell* JIT_OPERATION operationNewObject(ExecState* exec, Structure* structure) >Index: Source/JavaScriptCore/jit/JITOperations.h >=================================================================== >--- Source/JavaScriptCore/jit/JITOperations.h (revision 176004) >+++ Source/JavaScriptCore/jit/JITOperations.h (working copy) >@@ -69,7 +69,7 @@ extern "C" { > Idc: const Identifier* > J: EncodedJSValue > Jcp: const JSValue* >- Jsa: JSLexicalEnvironment* >+ Jsc: JSScope* > Jss: JSString* > O: JSObject* > P: pointer (char*) >@@ -113,6 +113,7 @@ typedef EncodedJSValue JIT_OPERATION (*J > typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EPP)(ExecState*, void*, void*); > typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EPS)(ExecState*, void*, size_t); > typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EPc)(ExecState*, Instruction*); >+typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EJscC)(ExecState*, JSScope*, JSCell*); > typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_ESS)(ExecState*, size_t, size_t); > typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_ESsiCI)(ExecState*, StructureStubInfo*, JSCell*, StringImpl*); > typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_ESsiJI)(ExecState*, StructureStubInfo*, EncodedJSValue, StringImpl*); >@@ -127,6 +128,7 @@ typedef JSCell* JIT_OPERATION (*C_JITOpe > typedef JSCell* JIT_OPERATION (*C_JITOperation_ECC)(ExecState*, JSCell*, JSCell*); > typedef JSCell* JIT_OPERATION (*C_JITOperation_EIcf)(ExecState*, InlineCallFrame*); > typedef JSCell* JIT_OPERATION (*C_JITOperation_EJ)(ExecState*, EncodedJSValue); >+typedef JSCell* JIT_OPERATION (*C_JITOperation_EJscC)(ExecState*, JSScope*, JSCell*); > typedef JSCell* JIT_OPERATION (*C_JITOperation_EJZ)(ExecState*, EncodedJSValue, int32_t); > typedef JSCell* JIT_OPERATION (*C_JITOperation_EJZC)(ExecState*, EncodedJSValue, int32_t, JSCell*); > typedef JSCell* JIT_OPERATION (*C_JITOperation_EJJC)(ExecState*, EncodedJSValue, EncodedJSValue, JSCell*); >@@ -266,7 +268,7 @@ size_t JIT_OPERATION operationHasPropert > EncodedJSValue JIT_OPERATION operationNewArrayWithProfile(ExecState*, ArrayAllocationProfile*, const JSValue* values, int32_t size) WTF_INTERNAL; > EncodedJSValue JIT_OPERATION operationNewArrayBufferWithProfile(ExecState*, ArrayAllocationProfile*, const JSValue* values, int32_t size) WTF_INTERNAL; > EncodedJSValue JIT_OPERATION operationNewArrayWithSizeAndProfile(ExecState*, ArrayAllocationProfile*, EncodedJSValue size) WTF_INTERNAL; >-EncodedJSValue JIT_OPERATION operationNewFunction(ExecState*, JSCell*) WTF_INTERNAL; >+EncodedJSValue JIT_OPERATION operationNewFunction(ExecState*, JSScope*, JSCell*) WTF_INTERNAL; > JSCell* JIT_OPERATION operationNewObject(ExecState*, Structure*) WTF_INTERNAL; > EncodedJSValue JIT_OPERATION operationNewRegexp(ExecState*, void*) WTF_INTERNAL; > void JIT_OPERATION operationHandleWatchdogTimer(ExecState*) WTF_INTERNAL; >Index: Source/JavaScriptCore/llint/LLIntSlowPaths.cpp >=================================================================== >--- Source/JavaScriptCore/llint/LLIntSlowPaths.cpp (revision 176004) >+++ Source/JavaScriptCore/llint/LLIntSlowPaths.cpp (working copy) >@@ -1001,18 +1001,20 @@ LLINT_SLOW_PATH_DECL(slow_path_new_func) > LLINT_BEGIN(); > CodeBlock* codeBlock = exec->codeBlock(); > ASSERT(codeBlock->codeType() != FunctionCode || !codeBlock->needsActivation() || exec->hasActivation()); >+ JSScope* scope = exec->uncheckedR(pc[2].u.operand).Register::scope(); > #if LLINT_SLOW_PATH_TRACING > dataLogF("Creating function!\n"); > #endif >- LLINT_RETURN(JSFunction::create(vm, codeBlock->functionDecl(pc[2].u.operand), exec->scope())); >+ LLINT_RETURN(JSFunction::create(vm, codeBlock->functionDecl(pc[3].u.operand), scope)); > } > > LLINT_SLOW_PATH_DECL(slow_path_new_func_exp) > { > LLINT_BEGIN(); > CodeBlock* codeBlock = exec->codeBlock(); >- FunctionExecutable* function = codeBlock->functionExpr(pc[2].u.operand); >- JSFunction* func = JSFunction::create(vm, function, exec->scope()); >+ JSScope* scope = exec->uncheckedR(pc[2].u.operand).Register::scope(); >+ FunctionExecutable* function = codeBlock->functionExpr(pc[3].u.operand); >+ JSFunction* func = JSFunction::create(vm, function, scope); > > LLINT_RETURN(func); > } >Index: Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm >=================================================================== >--- Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm (revision 176004) >+++ Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm (working copy) >@@ -1911,13 +1911,13 @@ _llint_op_switch_char: > > _llint_op_new_func: > traceExecution() >- btiz 12[PC], .opNewFuncUnchecked >+ btiz 16[PC], .opNewFuncUnchecked > loadi 4[PC], t1 > bineq TagOffset[cfr, t1, 8], EmptyValueTag, .opNewFuncDone > .opNewFuncUnchecked: > callSlowPath(_llint_slow_path_new_func) > .opNewFuncDone: >- dispatch(4) >+ dispatch(5) > > macro arrayProfileForCall() > loadi 16[PC], t3 >Index: Source/JavaScriptCore/llint/LowLevelInterpreter64.asm >=================================================================== >--- Source/JavaScriptCore/llint/LowLevelInterpreter64.asm (revision 176004) >+++ Source/JavaScriptCore/llint/LowLevelInterpreter64.asm (working copy) >@@ -1769,14 +1769,14 @@ _llint_op_switch_char: > > _llint_op_new_func: > traceExecution() >- loadisFromInstruction(3, t2) >+ loadisFromInstruction(4, t2) > btiz t2, .opNewFuncUnchecked > loadisFromInstruction(1, t1) > btqnz [cfr, t1, 8], .opNewFuncDone > .opNewFuncUnchecked: > callSlowPath(_llint_slow_path_new_func) > .opNewFuncDone: >- dispatch(4) >+ dispatch(5) > > macro arrayProfileForCall() > loadisFromInstruction(4, t3) >Index: Source/JavaScriptCore/llint/LowLevelInterpreter.asm >=================================================================== >--- Source/JavaScriptCore/llint/LowLevelInterpreter.asm (revision 176004) >+++ Source/JavaScriptCore/llint/LowLevelInterpreter.asm (working copy) >@@ -1132,7 +1132,7 @@ _llint_op_switch_string: > _llint_op_new_func_exp: > traceExecution() > callSlowPath(_llint_slow_path_new_func_exp) >- dispatch(3) >+ dispatch(4) > > > _llint_op_call:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
mark.lam
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 138707
: 241505