Changeset 36016 in webkit for trunk/JavaScriptCore/VM/CodeGenerator.cpp
- Timestamp:
- Sep 1, 2008, 2:22:54 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/CodeGenerator.cpp
r35813 r36016 201 201 , m_lastOpcodeID(op_end) 202 202 { 203 codeBlock->globalData = m_globalData; 204 203 205 // FIXME: Move code that modifies the global object to Machine::execute. 204 206 … … 226 228 for (size_t i = 0; i < functionStack.size(); ++i) { 227 229 FuncDeclNode* funcDecl = functionStack[i].get(); 228 globalObject->removeDirect(funcDecl->m_ident); // Make sure our new function is not shadowed by an old property. 230 if (globalObject->getDirect(funcDecl->m_ident)) 231 globalObject->removeDirect(funcDecl->m_ident); // Make sure our new function is not shadowed by an old property. 229 232 emitNewFunction(addGlobalVar(funcDecl->m_ident, false), funcDecl); 230 233 } … … 264 267 , m_lastOpcodeID(op_end) 265 268 { 269 codeBlock->globalData = m_globalData; 270 266 271 m_codeBlock->numConstants = functionBody->neededConstants(); 267 272 … … 310 315 , m_lastOpcodeID(op_end) 311 316 { 317 codeBlock->globalData = m_globalData; 318 312 319 m_codeBlock->numConstants = evalNode->neededConstants(); 313 320 m_codeBlock->numVars = 1; // Allocate space for "this" … … 666 673 instructions().append(dst->index()); 667 674 instructions().append(addUnexpectedConstant(jsNumber(globalExec(), d))); 668 return dst;669 }670 671 RegisterID* CodeGenerator::emitNullaryOp(OpcodeID opcode, RegisterID* dst)672 {673 emitOpcode(opcode);674 instructions().append(dst->index());675 675 return dst; 676 676 } … … 789 789 RegisterID* CodeGenerator::emitGetById(RegisterID* dst, RegisterID* base, const Identifier& property) 790 790 { 791 m_codeBlock->structureIDInstructions.append(instructions().size()); 792 791 793 emitOpcode(op_get_by_id); 792 794 instructions().append(dst->index()); 793 795 instructions().append(base->index()); 794 796 instructions().append(addConstant(property)); 797 instructions().append(0); 798 instructions().append(0); 799 instructions().append(0); 800 instructions().append(0); 795 801 return dst; 796 802 } … … 798 804 RegisterID* CodeGenerator::emitPutById(RegisterID* base, const Identifier& property, RegisterID* value) 799 805 { 806 m_codeBlock->structureIDInstructions.append(instructions().size()); 807 800 808 emitOpcode(op_put_by_id); 801 809 instructions().append(base->index()); 802 810 instructions().append(addConstant(property)); 803 811 instructions().append(value->index()); 812 instructions().append(0); 813 instructions().append(0); 804 814 return value; 805 815 } … … 866 876 instructions().append(value->index()); 867 877 return value; 878 } 879 880 RegisterID* CodeGenerator::emitNewObject(RegisterID* dst) 881 { 882 emitOpcode(op_new_object); 883 instructions().append(dst->index()); 884 return dst; 868 885 } 869 886
Note:
See TracChangeset
for help on using the changeset viewer.