Changeset 175508 in webkit
- Timestamp:
- Nov 3, 2014 7:36:28 PM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r175493 r175508 1 2014-11-03 Michael Saboff <msaboff@apple.com> 2 3 Add "get scope" byte code 4 https://bugs.webkit.org/show_bug.cgi?id=138326 5 6 Reviewed by Mark Lam. 7 8 Added op_get_scope. Added implementations for the LLInt and baseline JIT. 9 Provided nop implementation for DFG and FTL. The new byte code is emitted 10 after op_enter for any function, program or eval. It is expected that the 11 DFG will be implemented such that unneeded op_get_scope would be eliminated 12 during DFG compilation. 13 14 * bytecode/BytecodeList.json: 15 * bytecode/BytecodeUseDef.h: 16 (JSC::computeUsesForBytecodeOffset): 17 (JSC::computeDefsForBytecodeOffset): 18 Added new op_get_scope bytecode. 19 20 * bytecompiler/BytecodeGenerator.cpp: 21 (JSC::BytecodeGenerator::BytecodeGenerator): 22 (JSC::BytecodeGenerator::emitGetScope): 23 * bytecompiler/BytecodeGenerator.h: 24 Emit new op_get_scope bytecode. 25 26 * dfg/DFGByteCodeParser.cpp: 27 (JSC::DFG::ByteCodeParser::parseBlock): 28 * dfg/DFGCapabilities.cpp: 29 (JSC::DFG::capabilityLevel): 30 Added framework for new op_get_scope bytecode. 31 32 * bytecode/CodeBlock.cpp: 33 (JSC::CodeBlock::dumpBytecode): 34 * jit/JIT.cpp: 35 (JSC::JIT::privateCompileMainPass): 36 * jit/JIT.h: 37 * jit/JITOpcodes.cpp: 38 (JSC::JIT::emit_op_get_scope): 39 * jit/JITOpcodes32_64.cpp: 40 (JSC::JIT::emit_op_get_scope): 41 * llint/LowLevelInterpreter32_64.asm: 42 * llint/LowLevelInterpreter64.asm: 43 Implementation of op_get_scope bytecode. 44 1 45 2014-11-03 Joseph Pecoraro <pecoraro@apple.com> 2 46 -
trunk/Source/JavaScriptCore/bytecode/BytecodeList.json
r175471 r175508 6 6 { "name" : "op_enter", "length" : 1 }, 7 7 { "name" : "op_create_lexical_environment", "length" : 2 }, 8 { "name" : "op_get_scope", "length" : 2 }, 8 9 { "name" : "op_touch_entry", "length" : 1 }, 9 10 { "name" : "op_init_lazy_reg", "length" : 2 }, -
trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h
r174401 r175508 60 60 case op_new_func: 61 61 case op_create_lexical_environment: 62 case op_get_scope: 62 63 case op_create_arguments: 63 64 case op_to_this: … … 366 367 case op_init_lazy_reg: 367 368 case op_create_lexical_environment: 369 case op_get_scope: 368 370 case op_create_arguments: 369 371 case op_del_by_id: -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r175471 r175508 747 747 int r0 = (++it)->u.operand; 748 748 printLocationOpAndRegisterOperand(out, exec, location, it, "create_lexical_environment", r0); 749 break; 750 } 751 case op_get_scope: { 752 int r0 = (++it)->u.operand; 753 printLocationOpAndRegisterOperand(out, exec, location, it, "get_scope", r0); 749 754 break; 750 755 } -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r175471 r175508 191 191 emitOpcode(op_enter); 192 192 193 emitGetScope(); 194 193 195 const VarStack& varStack = programNode->varStack(); 194 196 const FunctionStack& functionStack = programNode->functionStack(); … … 249 251 250 252 emitOpcode(op_enter); 253 254 emitGetScope(); 255 251 256 if (m_codeBlock->needsFullScopeChain() || m_shouldEmitDebugHooks) { 252 257 m_lexicalEnvironmentRegister = addVar(); … … 473 478 474 479 emitOpcode(op_enter); 480 481 emitGetScope(); 475 482 476 483 const DeclarationStacks::FunctionStack& functionStack = evalNode->functionStack(); … … 2054 2061 instructions().append(dst->index()); 2055 2062 instructions().append(src->index()); 2063 } 2064 2065 void BytecodeGenerator::emitGetScope() 2066 { 2067 emitOpcode(op_get_scope); 2068 instructions().append(scopeRegister()->index()); 2056 2069 } 2057 2070 -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
r175426 r175508 542 542 void emitPushCatchScope(RegisterID* dst, const Identifier& property, RegisterID* value, unsigned attributes); 543 543 544 void emitGetScope(); 544 545 RegisterID* emitPushWithScope(RegisterID* dst, RegisterID* scope); 545 546 void emitPopScope(RegisterID* srcDst); -
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r175471 r175508 3400 3400 } 3401 3401 3402 case op_get_scope: { 3403 NEXT_OPCODE(op_get_scope); 3404 } 3405 3402 3406 case op_create_arguments: { 3403 3407 m_graph.m_hasArguments = true; -
trunk/Source/JavaScriptCore/dfg/DFGCapabilities.cpp
r175471 r175508 193 193 case op_switch_char: 194 194 case op_in: 195 case op_get_scope: 195 196 case op_get_from_scope: 196 197 case op_get_enumerable_length: -
trunk/Source/JavaScriptCore/jit/JIT.cpp
r174933 r175508 211 211 DEFINE_OP(op_enter) 212 212 DEFINE_OP(op_create_lexical_environment) 213 DEFINE_OP(op_get_scope) 213 214 DEFINE_OP(op_eq) 214 215 DEFINE_OP(op_eq_null) -
trunk/Source/JavaScriptCore/jit/JIT.h
r174401 r175508 476 476 void emit_op_enter(Instruction*); 477 477 void emit_op_create_lexical_environment(Instruction*); 478 void emit_op_get_scope(Instruction*); 478 479 void emit_op_eq(Instruction*); 479 480 void emit_op_eq_null(Instruction*); -
trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp
r175426 r175508 671 671 } 672 672 673 void JIT::emit_op_get_scope(Instruction* currentInstruction) 674 { 675 int dst = currentInstruction[1].u.operand; 676 emitGetFromCallFrameHeaderPtr(JSStack::Callee, regT0); 677 loadPtr(Address(regT0, JSFunction::offsetOfScopeChain()), regT0); 678 emitStoreCell(dst, regT0); 679 } 680 673 681 void JIT::emit_op_create_arguments(Instruction* currentInstruction) 674 682 { -
trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
r175426 r175508 895 895 } 896 896 897 void JIT::emit_op_get_scope(Instruction* currentInstruction) 898 { 899 int dst = currentInstruction[1].u.operand; 900 emitGetFromCallFrameHeaderPtr(JSStack::Callee, regT0); 901 loadPtr(Address(regT0, JSFunction::offsetOfScopeChain()), regT0); 902 emitStoreCell(dst, regT0); 903 } 904 897 905 void JIT::emit_op_create_arguments(Instruction* currentInstruction) 898 906 { -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
r175471 r175508 724 724 loadi 4[PC], t0 725 725 callSlowPath(_llint_slow_path_create_lexical_environment) 726 dispatch(2) 727 728 729 _llint_op_get_scope: 730 traceExecution() 731 loadi Callee + PayloadOffset[cfr], t0 732 loadi JSCallee::m_scope[t0], t0 733 loadisFromInstruction(1, t1) 734 storei CellTag, TagOffset[cfr, t1, 8] 735 storei t0, PayloadOffset[cfr, t1, 8] 726 736 dispatch(2) 727 737 -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
r175471 r175508 612 612 loadisFromInstruction(1, t0) 613 613 callSlowPath(_llint_slow_path_create_lexical_environment) 614 dispatch(2) 615 616 617 _llint_op_get_scope: 618 traceExecution() 619 loadp Callee[cfr], t0 620 loadp JSCallee::m_scope[t0], t0 621 loadisFromInstruction(1, t1) 622 storeq t0, [cfr, t1, 8] 614 623 dispatch(2) 615 624
Note: See TracChangeset
for help on using the changeset viewer.