Changeset 39266 in webkit for trunk/JavaScriptCore/jit/JITPropertyAccess.cpp
- Timestamp:
- Dec 12, 2008, 7:18:10 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JITPropertyAccess.cpp
r39261 r39266 47 47 #if !ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS) 48 48 49 void JIT::compileGetByIdHotPath(int resultVReg, int baseVReg, Identifier* ident, unsigned i, unsigned)49 void JIT::compileGetByIdHotPath(int resultVReg, int baseVReg, Identifier* ident, unsigned) 50 50 { 51 51 // As for put_by_id, get_by_id requires the offset of the Structure and the offset of the access to be repatched. … … 54 54 // to jump back to if one of these trampolies finds a match. 55 55 56 emitGetVirtualRegister(baseVReg, X86::eax , i);56 emitGetVirtualRegister(baseVReg, X86::eax); 57 57 58 58 emitPutCTIArg(X86::eax, 0); 59 59 emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 4); 60 emitCTICall( i,Interpreter::cti_op_get_by_id_generic);60 emitCTICall(Interpreter::cti_op_get_by_id_generic); 61 61 emitPutVirtualRegister(resultVReg); 62 62 } 63 63 64 64 65 void JIT::compileGetByIdSlowCase(int, int, Identifier*, unsigned,Vector<SlowCaseEntry>::iterator&, unsigned)65 void JIT::compileGetByIdSlowCase(int, int, Identifier*, Vector<SlowCaseEntry>::iterator&, unsigned) 66 66 { 67 67 ASSERT_NOT_REACHED(); 68 68 } 69 69 70 void JIT::compilePutByIdHotPath(int baseVReg, Identifier* ident, int valueVReg, unsigned i, unsigned)70 void JIT::compilePutByIdHotPath(int baseVReg, Identifier* ident, int valueVReg, unsigned) 71 71 { 72 72 // In order to be able to repatch both the Structure, and the object offset, we store one pointer, … … 74 74 // such that the Structure & offset are always at the same distance from this. 75 75 76 emitGetVirtualRegisters(baseVReg, X86::eax, valueVReg, X86::edx , i);76 emitGetVirtualRegisters(baseVReg, X86::eax, valueVReg, X86::edx); 77 77 78 78 emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 4); 79 79 emitPutCTIArg(X86::eax, 0); 80 80 emitPutCTIArg(X86::edx, 8); 81 emitCTICall( i,Interpreter::cti_op_put_by_id_generic);82 } 83 84 void JIT::compilePutByIdSlowCase(int, Identifier*, int, unsigned,Vector<SlowCaseEntry>::iterator&, unsigned)81 emitCTICall(Interpreter::cti_op_put_by_id_generic); 82 } 83 84 void JIT::compilePutByIdSlowCase(int, Identifier*, int, Vector<SlowCaseEntry>::iterator&, unsigned) 85 85 { 86 86 ASSERT_NOT_REACHED(); … … 89 89 #else 90 90 91 void JIT::compileGetByIdHotPath(int resultVReg, int baseVReg, Identifier*, unsigned i, unsignedpropertyAccessInstructionIndex)91 void JIT::compileGetByIdHotPath(int resultVReg, int baseVReg, Identifier*, unsigned propertyAccessInstructionIndex) 92 92 { 93 93 // As for put_by_id, get_by_id requires the offset of the Structure and the offset of the access to be repatched. … … 96 96 // to jump back to if one of these trampolies finds a match. 97 97 98 emitGetVirtualRegister(baseVReg, X86::eax , i);99 100 emitJumpSlowCaseIfNotJSCell(X86::eax, i,baseVReg);98 emitGetVirtualRegister(baseVReg, X86::eax); 99 100 emitJumpSlowCaseIfNotJSCell(X86::eax, baseVReg); 101 101 102 102 JmpDst hotPathBegin = __ label(); … … 105 105 __ cmpl_i32m(repatchGetByIdDefaultStructure, FIELD_OFFSET(JSCell, m_structure), X86::eax); 106 106 ASSERT(X86Assembler::getDifferenceBetweenLabels(hotPathBegin, __ label()) == repatchOffsetGetByIdStructure); 107 m_slowCases.append(SlowCaseEntry(__ jne(), i));107 addSlowCase(__ jne()); 108 108 ASSERT(X86Assembler::getDifferenceBetweenLabels(hotPathBegin, __ label()) == repatchOffsetGetByIdBranchToSlowCase); 109 109 … … 115 115 116 116 117 void JIT::compileGetByIdSlowCase(int resultVReg, int baseVReg, Identifier* ident, unsigned i,Vector<SlowCaseEntry>::iterator& iter, unsigned propertyAccessInstructionIndex)117 void JIT::compileGetByIdSlowCase(int resultVReg, int baseVReg, Identifier* ident, Vector<SlowCaseEntry>::iterator& iter, unsigned propertyAccessInstructionIndex) 118 118 { 119 119 // As for the hot path of get_by_id, above, we ensure that we can use an architecture specific offset … … 131 131 emitPutCTIArg(X86::eax, 0); 132 132 emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 4); 133 JmpSrc call = emitCTICall( i,Interpreter::cti_op_get_by_id);133 JmpSrc call = emitCTICall(Interpreter::cti_op_get_by_id); 134 134 ASSERT(X86Assembler::getDifferenceBetweenLabels(coldPathBegin, call) == repatchOffsetGetByIdSlowCaseCall); 135 135 emitPutVirtualRegister(resultVReg); … … 139 139 } 140 140 141 void JIT::compilePutByIdHotPath(int baseVReg, Identifier*, int valueVReg, unsigned i, unsignedpropertyAccessInstructionIndex)141 void JIT::compilePutByIdHotPath(int baseVReg, Identifier*, int valueVReg, unsigned propertyAccessInstructionIndex) 142 142 { 143 143 // In order to be able to repatch both the Structure, and the object offset, we store one pointer, … … 145 145 // such that the Structure & offset are always at the same distance from this. 146 146 147 emitGetVirtualRegisters(baseVReg, X86::eax, valueVReg, X86::edx , i);147 emitGetVirtualRegisters(baseVReg, X86::eax, valueVReg, X86::edx); 148 148 149 149 // Jump to a slow case if either the base object is an immediate, or if the Structure does not match. 150 emitJumpSlowCaseIfNotJSCell(X86::eax, i,baseVReg);150 emitJumpSlowCaseIfNotJSCell(X86::eax, baseVReg); 151 151 152 152 JmpDst hotPathBegin = __ label(); … … 156 156 __ cmpl_i32m(repatchGetByIdDefaultStructure, FIELD_OFFSET(JSCell, m_structure), X86::eax); 157 157 ASSERT(X86Assembler::getDifferenceBetweenLabels(hotPathBegin, __ label()) == repatchOffsetPutByIdStructure); 158 m_slowCases.append(SlowCaseEntry(__ jne(), i));158 addSlowCase(__ jne()); 159 159 160 160 // Plant a load from a bogus ofset in the object's property map; we will patch this later, if it is to be used. … … 164 164 } 165 165 166 void JIT::compilePutByIdSlowCase(int baseVReg, Identifier* ident, int, unsigned i,Vector<SlowCaseEntry>::iterator& iter, unsigned propertyAccessInstructionIndex)166 void JIT::compilePutByIdSlowCase(int baseVReg, Identifier* ident, int, Vector<SlowCaseEntry>::iterator& iter, unsigned propertyAccessInstructionIndex) 167 167 { 168 168 linkSlowCaseIfNotJSCell(iter, baseVReg); … … 172 172 emitPutCTIArg(X86::eax, 0); 173 173 emitPutCTIArg(X86::edx, 8); 174 JmpSrc call = emitCTICall( i,Interpreter::cti_op_put_by_id);174 JmpSrc call = emitCTICall(Interpreter::cti_op_put_by_id); 175 175 176 176 // Track the location of the call; this will be used to recover repatch information.
Note:
See TracChangeset
for help on using the changeset viewer.