Changeset 81040 in webkit
- Timestamp:
- Mar 14, 2011 11:16:36 AM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r80995 r81040 1 2011-03-11 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Gavin Barraclough. 4 5 Ensure all values are correctly tagged in the registerfile 6 https://bugs.webkit.org/show_bug.cgi?id=56214 7 8 This patch makes sure that all JSCell pointers written to 9 the registerfile are correctly tagged as JSCells, and replaces 10 raw int usage with the immediate representation. 11 12 For performance, register pressure, and general saneness reasons 13 I've added abstractions for reading and writing the tag 14 and payload of integer registers directly for the JSVALUE64 15 encoding. 16 17 * interpreter/Register.h: 18 (JSC::Register::withInt): 19 (JSC::Register::withCallee): 20 (JSC::Register::operator=): 21 (JSC::Register::i): 22 (JSC::Register::activation): 23 (JSC::Register::function): 24 (JSC::Register::propertyNameIterator): 25 (JSC::Register::scopeChain): 26 * jit/JIT.h: 27 * jit/JITCall.cpp: 28 (JSC::JIT::compileOpCallInitializeCallFrame): 29 (JSC::JIT::compileOpCallVarargs): 30 (JSC::JIT::compileOpCall): 31 * jit/JITCall32_64.cpp: 32 (JSC::JIT::compileOpCallInitializeCallFrame): 33 (JSC::JIT::compileOpCallVarargs): 34 (JSC::JIT::compileOpCall): 35 (JSC::JIT::compileOpCallSlowCase): 36 * jit/JITInlineMethods.h: 37 (JSC::JIT::emitPutToCallFrameHeader): 38 (JSC::JIT::emitPutCellToCallFrameHeader): 39 (JSC::JIT::emitPutIntToCallFrameHeader): 40 * jit/JITOpcodes.cpp: 41 (JSC::JIT::privateCompileCTINativeCall): 42 (JSC::JIT::emit_op_get_pnames): 43 (JSC::JIT::emit_op_next_pname): 44 (JSC::JIT::emit_op_load_varargs): 45 (JSC::JIT::emitSlow_op_load_varargs): 46 * jit/JITOpcodes32_64.cpp: 47 (JSC::JIT::privateCompileCTINativeCall): 48 (JSC::JIT::emit_op_get_pnames): 49 (JSC::JIT::emit_op_next_pname): 50 * jit/JSInterfaceJIT.h: 51 (JSC::JSInterfaceJIT::intPayloadFor): 52 (JSC::JSInterfaceJIT::intTagFor): 53 * jit/SpecializedThunkJIT.h: 54 (JSC::SpecializedThunkJIT::returnJSValue): 55 (JSC::SpecializedThunkJIT::returnDouble): 56 (JSC::SpecializedThunkJIT::returnInt32): 57 (JSC::SpecializedThunkJIT::returnJSCell): 58 1 59 2011-03-13 Geoffrey Garen <ggaren@apple.com> 2 60 -
trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.cpp
r80938 r81040 27 27 #include "StructureStubInfo.h" 28 28 29 #include "JSObject.h" 29 30 #include "ScopeChain.h" 30 31 -
trunk/Source/JavaScriptCore/interpreter/Register.h
r80969 r81040 57 57 EncodedJSValue encodedJSValue() const; 58 58 59 Register& operator=(JSActivation*);60 59 Register& operator=(CallFrame*); 61 60 Register& operator=(CodeBlock*); 62 Register& operator=(JSPropertyNameIterator*);63 61 Register& operator=(ScopeChainNode*); 64 62 Register& operator=(Instruction*); … … 75 73 static Register withInt(int32_t i) 76 74 { 77 Register r; 78 r.u.i = i; 75 Register r = jsNumber(i); 79 76 return r; 80 77 } 81 78 82 static Register withCallee(JSObject* callee) 83 { 84 Register r; 85 r.u.function = callee; 86 return r; 87 } 79 static inline Register withCallee(JSObject* callee); 88 80 89 81 private: 90 82 union { 91 int32_t i;92 83 EncodedJSValue value; 93 94 JSActivation* activation;95 84 CallFrame* callFrame; 96 85 CodeBlock* codeBlock; 97 JSObject* function;98 JSPropertyNameIterator* propertyNameIterator;99 ScopeChainNode* scopeChain;100 86 Instruction* vPC; 101 87 } u; … … 138 124 // Interpreter functions 139 125 140 ALWAYS_INLINE Register& Register::operator=(JSActivation* activation)141 {142 u.activation = activation;143 return *this;144 }145 146 126 ALWAYS_INLINE Register& Register::operator=(CallFrame* callFrame) 147 127 { … … 162 142 } 163 143 164 ALWAYS_INLINE Register& Register::operator=(ScopeChainNode* scopeChain)144 ALWAYS_INLINE int32_t Register::i() const 165 145 { 166 u.scopeChain = scopeChain; 167 return *this; 146 return jsValue().asInt32(); 168 147 } 169 148 170 ALWAYS_INLINE Register& Register::operator=(JSPropertyNameIterator* propertyNameIterator)171 {172 u.propertyNameIterator = propertyNameIterator;173 return *this;174 }175 176 ALWAYS_INLINE int32_t Register::i() const177 {178 return u.i;179 }180 181 ALWAYS_INLINE JSActivation* Register::activation() const182 {183 return u.activation;184 }185 186 149 ALWAYS_INLINE CallFrame* Register::callFrame() const 187 150 { … … 193 156 return u.codeBlock; 194 157 } 195 196 ALWAYS_INLINE JSObject* Register::function() const 197 { 198 return u.function; 199 } 200 201 ALWAYS_INLINE JSPropertyNameIterator* Register::propertyNameIterator() const 202 { 203 return u.propertyNameIterator; 204 } 205 206 ALWAYS_INLINE ScopeChainNode* Register::scopeChain() const 207 { 208 return u.scopeChain; 209 } 210 158 211 159 ALWAYS_INLINE Instruction* Register::vPC() const 212 160 { -
trunk/Source/JavaScriptCore/jit/JIT.h
r80938 r81040 854 854 855 855 void emitPutToCallFrameHeader(RegisterID from, RegisterFile::CallFrameHeaderEntry entry); 856 void emitPutCellToCallFrameHeader(RegisterID from, RegisterFile::CallFrameHeaderEntry); 857 void emitPutIntToCallFrameHeader(RegisterID from, RegisterFile::CallFrameHeaderEntry); 856 858 void emitPutImmediateToCallFrameHeader(void* value, RegisterFile::CallFrameHeaderEntry entry); 857 859 void emitGetFromCallFrameHeaderPtr(RegisterFile::CallFrameHeaderEntry entry, RegisterID to, RegisterID from = callFrameRegister); -
trunk/Source/JavaScriptCore/jit/JITCall.cpp
r80938 r81040 49 49 void JIT::compileOpCallInitializeCallFrame() 50 50 { 51 store32(regT1, Address(callFrameRegister, RegisterFile::ArgumentCount * static_cast<int>(sizeof(Register)))); 52 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_scopeChain)), regT3); // newScopeChain 53 storePtr(regT0, Address(callFrameRegister, RegisterFile::Callee * static_cast<int>(sizeof(Register)))); 54 storePtr(regT3, Address(callFrameRegister, RegisterFile::ScopeChain * static_cast<int>(sizeof(Register)))); 51 // regT0 holds callee, regT1 holds argCount 52 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_scopeChain)), regT3); // scopeChain 53 emitPutIntToCallFrameHeader(regT1, RegisterFile::ArgumentCount); 54 emitPutCellToCallFrameHeader(regT0, RegisterFile::Callee); 55 emitPutCellToCallFrameHeader(regT3, RegisterFile::ScopeChain); 55 56 } 56 57 … … 68 69 69 70 emitGetVirtualRegister(argCountRegister, regT1); 71 emitFastArithImmToInt(regT1); 70 72 emitGetVirtualRegister(callee, regT0); 71 73 addPtr(Imm32(registerOffset), regT1, regT2); … … 200 202 201 203 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_scopeChain)), regT1); // newScopeChain 202 203 store32(Imm32(argCount), Address(callFrameRegister, (registerOffset + RegisterFile::ArgumentCount) * static_cast<int>(sizeof(Register)))); 204 205 store32(Imm32(Int32Tag), intTagFor(registerOffset + RegisterFile::ArgumentCount)); 206 store32(Imm32(argCount), intPayloadFor(registerOffset + RegisterFile::ArgumentCount)); 204 207 storePtr(callFrameRegister, Address(callFrameRegister, (registerOffset + RegisterFile::CallerFrame) * static_cast<int>(sizeof(Register)))); 205 208 storePtr(regT0, Address(callFrameRegister, (registerOffset + RegisterFile::Callee) * static_cast<int>(sizeof(Register)))); -
trunk/Source/JavaScriptCore/jit/JITCall32_64.cpp
r80969 r81040 50 50 { 51 51 // regT0 holds callee, regT1 holds argCount 52 store32(regT1, Address(callFrameRegister, RegisterFile::ArgumentCount * static_cast<int>(sizeof(Register))));53 52 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_scopeChain)), regT3); // scopeChain 54 storePtr(regT0, Address(callFrameRegister, RegisterFile::Callee * static_cast<int>(sizeof(Register)))); // callee 55 storePtr(regT3, Address(callFrameRegister, RegisterFile::ScopeChain * static_cast<int>(sizeof(Register)))); // scopeChain 53 emitPutIntToCallFrameHeader(regT1, RegisterFile::ArgumentCount); 54 emitPutCellToCallFrameHeader(regT0, RegisterFile::Callee); 55 emitPutCellToCallFrameHeader(regT3, RegisterFile::ScopeChain); 56 56 } 57 57 … … 78 78 mul32(Imm32(sizeof(Register)), regT3, regT3); 79 79 addPtr(callFrameRegister, regT3); 80 storePtr(callFrameRegister, Address(regT3, RegisterFile::CallerFrame * static_cast<int>(sizeof(Register)))); 80 store32(Imm32(JSValue::CellTag), tagFor(RegisterFile::CallerFrame, regT3)); 81 storePtr(callFrameRegister, payloadFor(RegisterFile::CallerFrame, regT3)); 81 82 move(regT3, callFrameRegister); 82 83 … … 209 210 210 211 // Speculatively roll the callframe, assuming argCount will match the arity. 211 storePtr(callFrameRegister, Address(callFrameRegister, (RegisterFile::CallerFrame + registerOffset) * static_cast<int>(sizeof(Register)))); 212 store32(Imm32(JSValue::CellTag), tagFor(RegisterFile::CallerFrame + registerOffset, callFrameRegister)); 213 storePtr(callFrameRegister, payloadFor(RegisterFile::CallerFrame + registerOffset, callFrameRegister)); 212 214 addPtr(Imm32(registerOffset * static_cast<int>(sizeof(Register))), callFrameRegister); 213 215 move(Imm32(argCount), regT1); … … 281 283 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_scopeChain)), regT2); 282 284 283 store32(Imm32(argCount), Address(callFrameRegister, (registerOffset + RegisterFile::ArgumentCount) * static_cast<int>(sizeof(Register)))); 284 storePtr(callFrameRegister, Address(callFrameRegister, (registerOffset + RegisterFile::CallerFrame) * static_cast<int>(sizeof(Register)))); 285 store32(Imm32(JSValue::Int32Tag), tagFor(registerOffset + RegisterFile::ArgumentCount)); 286 store32(Imm32(argCount), payloadFor(registerOffset + RegisterFile::ArgumentCount)); 287 storePtr(callFrameRegister, payloadFor(RegisterFile::CallerFrame + registerOffset, callFrameRegister)); 285 288 emitStore(registerOffset + RegisterFile::Callee, regT1, regT0); 286 storePtr(regT2, Address(callFrameRegister, (registerOffset + RegisterFile::ScopeChain) * static_cast<int>(sizeof(Register)))); 289 store32(Imm32(JSValue::CellTag), tagFor(registerOffset + RegisterFile::ScopeChain)); 290 store32(regT2, payloadFor(registerOffset + RegisterFile::ScopeChain)); 287 291 addPtr(Imm32(registerOffset * sizeof(Register)), callFrameRegister); 288 292 … … 310 314 311 315 // Speculatively roll the callframe, assuming argCount will match the arity. 312 storePtr(callFrameRegister, Address(callFrameRegister, (RegisterFile::CallerFrame + registerOffset) * static_cast<int>(sizeof(Register)))); 316 store32(Imm32(JSValue::CellTag), tagFor(RegisterFile::CallerFrame + registerOffset, callFrameRegister)); 317 storePtr(callFrameRegister, payloadFor(RegisterFile::CallerFrame + registerOffset, callFrameRegister)); 313 318 addPtr(Imm32(registerOffset * static_cast<int>(sizeof(Register))), callFrameRegister); 314 319 move(Imm32(argCount), regT1); -
trunk/Source/JavaScriptCore/jit/JITInlineMethods.h
r80972 r81040 53 53 ALWAYS_INLINE void JIT::emitPutToCallFrameHeader(RegisterID from, RegisterFile::CallFrameHeaderEntry entry) 54 54 { 55 storePtr(from, Address(callFrameRegister, entry * sizeof(Register))); 55 storePtr(from, payloadFor(entry, callFrameRegister)); 56 } 57 58 ALWAYS_INLINE void JIT::emitPutCellToCallFrameHeader(RegisterID from, RegisterFile::CallFrameHeaderEntry entry) 59 { 60 #if USE(JSVALUE32_64) 61 store32(Imm32(JSValue::CellTag), tagFor(entry, callFrameRegister)); 62 #endif 63 storePtr(from, payloadFor(entry, callFrameRegister)); 64 } 65 66 ALWAYS_INLINE void JIT::emitPutIntToCallFrameHeader(RegisterID from, RegisterFile::CallFrameHeaderEntry entry) 67 { 68 store32(Imm32(Int32Tag), intTagFor(entry, callFrameRegister)); 69 store32(from, intPayloadFor(entry, callFrameRegister)); 56 70 } 57 71 -
trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp
r80969 r81040 200 200 emitGetFromCallFrameHeaderPtr(RegisterFile::CallerFrame, regT0); 201 201 emitGetFromCallFrameHeaderPtr(RegisterFile::ScopeChain, regT1, regT0); 202 emitPut ToCallFrameHeader(regT1, RegisterFile::ScopeChain);202 emitPutCellToCallFrameHeader(regT1, RegisterFile::ScopeChain); 203 203 204 204 peek(regT1); … … 223 223 emitGetFromCallFrameHeaderPtr(RegisterFile::CallerFrame, regT2); 224 224 emitGetFromCallFrameHeaderPtr(RegisterFile::ScopeChain, regT1, regT2); 225 emitPut ToCallFrameHeader(regT1, RegisterFile::ScopeChain);225 emitPutCellToCallFrameHeader(regT1, RegisterFile::ScopeChain); 226 226 227 227 preserveReturnAddressAfterCall(regT3); // Callee preserved … … 244 244 emitGetFromCallFrameHeaderPtr(RegisterFile::CallerFrame, regT0); 245 245 emitGetFromCallFrameHeaderPtr(RegisterFile::ScopeChain, regT1, regT0); 246 emitPut ToCallFrameHeader(regT1, RegisterFile::ScopeChain);246 emitPutCellToCallFrameHeader(regT1, RegisterFile::ScopeChain); 247 247 248 248 preserveReturnAddressAfterCall(regT3); // Callee preserved … … 903 903 getPnamesStubCall.call(dst); 904 904 load32(Address(regT0, OBJECT_OFFSETOF(JSPropertyNameIterator, m_jsStringsSize)), regT3); 905 store32(Imm32(0), addressFor(i)); 906 store32(regT3, addressFor(size)); 905 storePtr(tagTypeNumberRegister, payloadFor(i)); 906 store32(Imm32(Int32Tag), intTagFor(size)); 907 store32(regT3, intPayloadFor(size)); 907 908 Jump end = jump(); 908 909 … … 932 933 933 934 Label begin(this); 934 load32( addressFor(i), regT0);935 Jump end = branch32(Equal, regT0, addressFor(size));935 load32(intPayloadFor(i), regT0); 936 Jump end = branch32(Equal, regT0, intPayloadFor(size)); 936 937 937 938 // Grab key @ i … … 945 946 // Increment i 946 947 add32(Imm32(1), regT0); 947 store32(regT0, addressFor(i));948 store32(regT0, intPayloadFor(i)); 948 949 949 950 // Verify that i is valid: … … 1690 1691 // Load arg count into regT0 1691 1692 emitGetFromCallFrameHeader32(RegisterFile::ArgumentCount, regT0); 1692 storePtr(regT0, addressFor(argCountDst)); 1693 store32(Imm32(Int32Tag), intTagFor(argCountDst)); 1694 store32(regT0, intPayloadFor(argCountDst)); 1693 1695 Jump endBranch = branch32(Equal, regT0, Imm32(1)); 1694 1696 … … 1728 1730 stubCall.addArgument(Imm32(argsOffset)); 1729 1731 stubCall.call(); 1730 // Stores a naked int32 in the register file. 1731 store32(returnValueRegister, Address(callFrameRegister, argCountDst * sizeof(Register))); 1732 1733 store32(Imm32(Int32Tag), intTagFor(argCountDst)); 1734 store32(returnValueRegister, intPayloadFor(argCountDst)); 1732 1735 } 1733 1736 -
trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
r80969 r81040 206 206 emitGetFromCallFrameHeaderPtr(RegisterFile::CallerFrame, regT0); 207 207 emitGetFromCallFrameHeaderPtr(RegisterFile::ScopeChain, regT1, regT0); 208 emitPut ToCallFrameHeader(regT1, RegisterFile::ScopeChain);208 emitPutCellToCallFrameHeader(regT1, RegisterFile::ScopeChain); 209 209 210 210 peek(regT1); … … 230 230 emitGetFromCallFrameHeaderPtr(RegisterFile::CallerFrame, regT2); 231 231 emitGetFromCallFrameHeaderPtr(RegisterFile::ScopeChain, regT1, regT2); 232 emitPut ToCallFrameHeader(regT1, RegisterFile::ScopeChain);232 emitPutCellToCallFrameHeader(regT1, RegisterFile::ScopeChain); 233 233 234 234 preserveReturnAddressAfterCall(regT3); // Callee preserved … … 252 252 emitGetFromCallFrameHeaderPtr(RegisterFile::CallerFrame, regT0); 253 253 emitGetFromCallFrameHeaderPtr(RegisterFile::ScopeChain, regT1, regT0); 254 emitPut ToCallFrameHeader(regT1, RegisterFile::ScopeChain);254 emitPutCellToCallFrameHeader(regT1, RegisterFile::ScopeChain); 255 255 256 256 preserveReturnAddressAfterCall(regT3); // Callee preserved … … 322 322 emitGetFromCallFrameHeaderPtr(RegisterFile::CallerFrame, regT0); 323 323 emitGetFromCallFrameHeaderPtr(RegisterFile::ScopeChain, regT1, regT0); 324 emitPut ToCallFrameHeader(regT1, RegisterFile::ScopeChain);324 emitPutCellToCallFrameHeader(regT1, RegisterFile::ScopeChain); 325 325 326 326 peek(regT1); … … 345 345 emitGetFromCallFrameHeaderPtr(RegisterFile::CallerFrame, regT2); 346 346 emitGetFromCallFrameHeaderPtr(RegisterFile::ScopeChain, regT1, regT2); 347 emitPut ToCallFrameHeader(regT1, RegisterFile::ScopeChain);347 emitPutCellToCallFrameHeader(regT1, RegisterFile::ScopeChain); 348 348 349 349 preserveReturnAddressAfterCall(regT3); // Callee preserved … … 368 368 emitGetFromCallFrameHeaderPtr(RegisterFile::CallerFrame, regT0); 369 369 emitGetFromCallFrameHeaderPtr(RegisterFile::ScopeChain, regT1, regT0); 370 emitPut ToCallFrameHeader(regT1, RegisterFile::ScopeChain);370 emitPutCellToCallFrameHeader(regT1, RegisterFile::ScopeChain); 371 371 372 372 preserveReturnAddressAfterCall(regT3); // Callee preserved … … 1277 1277 getPnamesStubCall.call(dst); 1278 1278 load32(Address(regT0, OBJECT_OFFSETOF(JSPropertyNameIterator, m_jsStringsSize)), regT3); 1279 store32(Imm32(0), addressFor(i)); 1280 store32(regT3, addressFor(size)); 1279 store32(Imm32(Int32Tag), intTagFor(i)); 1280 store32(Imm32(0), intPayloadFor(i)); 1281 store32(Imm32(Int32Tag), intTagFor(size)); 1282 store32(regT3, payloadFor(size)); 1281 1283 Jump end = jump(); 1282 1284 … … 1304 1306 1305 1307 Label begin(this); 1306 load32( addressFor(i), regT0);1307 Jump end = branch32(Equal, regT0, addressFor(size));1308 load32(intPayloadFor(i), regT0); 1309 Jump end = branch32(Equal, regT0, intPayloadFor(size)); 1308 1310 1309 1311 // Grab key @ i 1310 loadPtr( addressFor(it), regT1);1312 loadPtr(payloadFor(it), regT1); 1311 1313 loadPtr(Address(regT1, OBJECT_OFFSETOF(JSPropertyNameIterator, m_jsStrings)), regT2); 1312 1314 load32(BaseIndex(regT2, regT0, TimesEight), regT2); … … 1316 1318 // Increment i 1317 1319 add32(Imm32(1), regT0); 1318 store32(regT0, addressFor(i));1320 store32(regT0, intPayloadFor(i)); 1319 1321 1320 1322 // Verify that i is valid: 1321 loadPtr( addressFor(base), regT0);1323 loadPtr(payloadFor(base), regT0); 1322 1324 1323 1325 // Test base's structure -
trunk/Source/JavaScriptCore/jit/JSInterfaceJIT.h
r80938 r81040 30 30 #include "JITStubs.h" 31 31 #include "JSImmediate.h" 32 #include "JSValue.h" 32 33 #include "MacroAssembler.h" 33 34 #include "RegisterFile.h" … … 158 159 #endif 159 160 161 #if USE(JSVALUE32_64) 162 // Can't just propogate JSValue::Int32Tag as visual studio doesn't like it 163 static const unsigned Int32Tag = 0xfffffffd; 164 COMPILE_ASSERT(Int32Tag == JSValue::Int32Tag, Int32Tag_out_of_sync); 165 #else 166 static const unsigned Int32Tag = JSImmediate::TagTypeNumber >> 32; 167 #endif 160 168 inline Jump emitLoadJSCell(unsigned virtualRegisterIndex, RegisterID payload); 161 169 inline Jump emitLoadInt32(unsigned virtualRegisterIndex, RegisterID dst); … … 174 182 175 183 inline Address payloadFor(unsigned index, RegisterID base = callFrameRegister); 184 inline Address intPayloadFor(unsigned index, RegisterID base = callFrameRegister); 185 inline Address intTagFor(unsigned index, RegisterID base = callFrameRegister); 176 186 inline Address addressFor(unsigned index, RegisterID base = callFrameRegister); 177 187 }; … … 213 223 ASSERT(static_cast<int>(virtualRegisterIndex) < FirstConstantRegisterIndex); 214 224 return Address(base, (virtualRegisterIndex * sizeof(Register)) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)); 225 } 226 227 inline JSInterfaceJIT::Address JSInterfaceJIT::intPayloadFor(unsigned virtualRegisterIndex, RegisterID base) 228 { 229 return payloadFor(virtualRegisterIndex, base); 230 } 231 232 inline JSInterfaceJIT::Address JSInterfaceJIT::intTagFor(unsigned virtualRegisterIndex, RegisterID base) 233 { 234 return tagFor(virtualRegisterIndex, base); 215 235 } 216 236 … … 280 300 return addressFor(virtualRegisterIndex, base); 281 301 } 302 303 inline JSInterfaceJIT::Address JSInterfaceJIT::intPayloadFor(unsigned virtualRegisterIndex, RegisterID base) 304 { 305 ASSERT(static_cast<int>(virtualRegisterIndex) < FirstConstantRegisterIndex); 306 return Address(base, (virtualRegisterIndex * sizeof(Register)) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)); 307 } 308 inline JSInterfaceJIT::Address JSInterfaceJIT::intTagFor(unsigned virtualRegisterIndex, RegisterID base) 309 { 310 ASSERT(static_cast<int>(virtualRegisterIndex) < FirstConstantRegisterIndex); 311 return Address(base, (virtualRegisterIndex * sizeof(Register)) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag)); 312 } 282 313 #endif 283 314 -
trunk/Source/JavaScriptCore/jit/SpecializedThunkJIT.h
r80938 r81040 88 88 if (src != regT0) 89 89 move(src, regT0); 90 loadPtr( Address(callFrameRegister, RegisterFile::CallerFrame * (int)sizeof(Register)), callFrameRegister);90 loadPtr(payloadFor(RegisterFile::CallerFrame, callFrameRegister), callFrameRegister); 91 91 ret(); 92 92 } … … 102 102 loadPtr(Address(stackPointerRegister, OBJECT_OFFSETOF(JSValue, u.asBits.payload) - sizeof(double)), regT0); 103 103 #endif 104 loadPtr( Address(callFrameRegister, RegisterFile::CallerFrame * (int)sizeof(Register)), callFrameRegister);104 loadPtr(payloadFor(RegisterFile::CallerFrame, callFrameRegister), callFrameRegister); 105 105 ret(); 106 106 } … … 111 111 move(src, regT0); 112 112 tagReturnAsInt32(); 113 loadPtr( Address(callFrameRegister, RegisterFile::CallerFrame * (int)sizeof(Register)), callFrameRegister);113 loadPtr(payloadFor(RegisterFile::CallerFrame, callFrameRegister), callFrameRegister); 114 114 ret(); 115 115 } … … 120 120 move(src, regT0); 121 121 tagReturnAsJSCell(); 122 loadPtr( Address(callFrameRegister, RegisterFile::CallerFrame * (int)sizeof(Register)), callFrameRegister);122 loadPtr(payloadFor(RegisterFile::CallerFrame, callFrameRegister), callFrameRegister); 123 123 ret(); 124 124 } -
trunk/Source/JavaScriptCore/runtime/ArgList.cpp
r80938 r81040 24 24 #include "JSValue.h" 25 25 #include "JSCell.h" 26 #include "JSObject.h" 26 27 #include "ScopeChain.h" 27 28 -
trunk/Source/JavaScriptCore/runtime/DateConversion.cpp
r80938 r81040 45 45 46 46 #include "CallFrame.h" 47 #include "JSObject.h" 47 48 #include "ScopeChain.h" 48 49 #include "UString.h" -
trunk/Source/JavaScriptCore/runtime/GCActivityCallbackCF.cpp
r80938 r81040 34 34 #include "JSGlobalData.h" 35 35 #include "JSLock.h" 36 #include "JSObject.h" 36 37 #include "ScopeChain.h" 37 38 #include <wtf/RetainPtr.h> -
trunk/Source/JavaScriptCore/runtime/Identifier.cpp
r80938 r81040 23 23 24 24 #include "CallFrame.h" 25 #include "JSObject.h" 25 26 #include "NumericStrings.h" 26 27 #include "ScopeChain.h" -
trunk/Source/JavaScriptCore/runtime/JSActivation.h
r80938 r81040 92 92 return static_cast<JSActivation*>(asObject(value)); 93 93 } 94 95 ALWAYS_INLINE JSActivation* Register::activation() const 96 { 97 return asActivation(jsValue()); 98 } 94 99 95 100 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/JSLock.cpp
r80938 r81040 24 24 #include "Heap.h" 25 25 #include "CallFrame.h" 26 #include "JSObject.h" 26 27 #include "ScopeChain.h" 27 28 -
trunk/Source/JavaScriptCore/runtime/JSNumberCell.cpp
r80938 r81040 23 23 #include "config.h" 24 24 #include "JSNumberCell.h" 25 #include "JSObject.h" 25 26 #include "ScopeChain.h" 26 27 -
trunk/Source/JavaScriptCore/runtime/JSObject.h
r80938 r81040 841 841 } 842 842 843 ALWAYS_INLINE JSObject* Register::function() const 844 { 845 if (!jsValue()) 846 return 0; 847 return asObject(jsValue()); 848 } 849 850 ALWAYS_INLINE Register Register::withCallee(JSObject* callee) 851 { 852 Register r; 853 r = JSValue(callee); 854 return r; 855 } 856 843 857 } // namespace JSC 844 858 -
trunk/Source/JavaScriptCore/runtime/JSPropertyNameIterator.h
r80938 r81040 107 107 } 108 108 109 ALWAYS_INLINE JSPropertyNameIterator* Register::propertyNameIterator() const 110 { 111 return static_cast<JSPropertyNameIterator*>(jsValue().asCell()); 112 } 113 109 114 } // namespace JSC 110 115 -
trunk/Source/JavaScriptCore/runtime/JSValue.h
r80938 r81040 53 53 enum PreferredPrimitiveType { NoPreference, PreferNumber, PreferString }; 54 54 55 55 56 #if USE(JSVALUE32_64) 56 57 typedef int64_t EncodedJSValue; … … 58 59 typedef void* EncodedJSValue; 59 60 #endif 61 62 union EncodedValueDescriptor { 63 EncodedJSValue asEncodedJSValue; 64 #if USE(JSVALUE32_64) 65 double asDouble; 66 #elif USE(JSVALUE64) 67 JSCell* ptr; 68 #endif 69 70 #if CPU(BIG_ENDIAN) 71 struct { 72 int32_t tag; 73 int32_t payload; 74 } asBits; 75 #else 76 struct { 77 int32_t payload; 78 int32_t tag; 79 } asBits; 80 #endif 81 }; 60 82 61 83 double nonInlineNaN(); … … 240 262 241 263 enum { LowestTag = DeletedValueTag }; 242 264 243 265 uint32_t tag() const; 244 266 int32_t payload() const; 245 267 246 union { 247 EncodedJSValue asEncodedJSValue; 248 double asDouble; 249 #if CPU(BIG_ENDIAN) 250 struct { 251 int32_t tag; 252 int32_t payload; 253 } asBits; 254 #else 255 struct { 256 int32_t payload; 257 int32_t tag; 258 } asBits; 259 #endif 260 } u; 261 #else // USE(JSVALUE32_64) 268 EncodedValueDescriptor u; 269 #elif USE(JSVALUE64) 262 270 JSCell* m_ptr; 263 #endif // USE(JSVALUE32_64)271 #endif 264 272 }; 265 273 -
trunk/Source/JavaScriptCore/runtime/JSZombie.cpp
r80938 r81040 27 27 #include "JSZombie.h" 28 28 #include "ClassInfo.h" 29 #include "JSObject.h" 29 30 #include "ScopeChain.h" 30 31 -
trunk/Source/JavaScriptCore/runtime/MarkedBlock.cpp
r80938 r81040 28 28 29 29 #include "JSCell.h" 30 #include "JSObject.h" 30 31 #include "JSZombie.h" 31 32 #include "ScopeChain.h" -
trunk/Source/JavaScriptCore/runtime/MarkedSpace.cpp
r80938 r81040 25 25 #include "JSGlobalData.h" 26 26 #include "JSLock.h" 27 #include "JSObject.h" 27 28 #include "ScopeChain.h" 28 29 -
trunk/Source/JavaScriptCore/runtime/PropertyNameArray.cpp
r80938 r81040 22 22 #include "PropertyNameArray.h" 23 23 24 #include "JSObject.h" 24 25 #include "ScopeChain.h" 25 26 #include "Structure.h" -
trunk/Source/JavaScriptCore/runtime/ScopeChain.h
r80976 r81040 129 129 return scopeChain()->globalThis.get(); 130 130 } 131 132 ALWAYS_INLINE ScopeChainNode* Register::scopeChain() const 133 { 134 return static_cast<ScopeChainNode*>(jsValue().asCell()); 135 } 136 137 ALWAYS_INLINE Register& Register::operator=(ScopeChainNode* scopeChain) 138 { 139 *this = JSValue(scopeChain); 140 return *this; 141 } 131 142 132 143 } // namespace JSC -
trunk/Source/JavaScriptCore/wtf/DateMath.cpp
r80938 r81040 76 76 #include "ASCIICType.h" 77 77 #include "CurrentTime.h" 78 #if USE(JSC) 79 #include "JSObject.h" 80 #endif 78 81 #include "MathExtras.h" 79 82 #if USE(JSC) -
trunk/Source/WebCore/ChangeLog
r81039 r81040 1 2011-03-11 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Gavin Barraclough. 4 5 Ensure all values are correctly tagged in the registerfile 6 https://bugs.webkit.org/show_bug.cgi?id=56214 7 8 Make sure everything builds still. 9 10 * bridge/c/c_class.cpp: 11 * bridge/c/c_runtime.cpp: 12 * bridge/jni/JavaMethod.cpp: 13 * plugins/PluginViewNone.cpp: 14 1 15 2011-03-14 Luiz Agostini <luiz.agostini@openbossa.org> 2 16 -
trunk/Source/WebCore/bridge/c/c_class.cpp
r80938 r81040 36 36 #include <runtime/Identifier.h> 37 37 #include <runtime/JSLock.h> 38 #include <runtime/JSObject.h> 38 39 #include <wtf/text/StringHash.h> 39 40 -
trunk/Source/WebCore/bridge/c/c_runtime.cpp
r80938 r81040 35 35 #include <runtime/ScopeChain.h> 36 36 #include <runtime/JSLock.h> 37 #include <runtime/JSObject.h> 37 38 38 39 namespace JSC { -
trunk/Source/WebCore/bridge/jni/JavaMethod.cpp
r81036 r81040 32 32 #include "JavaString.h" 33 33 34 #if USE(JSC) 35 #include <runtime/JSObject.h> 36 #include <runtime/ScopeChain.h> 37 #endif 34 38 #include <wtf/text/StringBuilder.h> 35 39 -
trunk/Source/WebCore/plugins/PluginViewNone.cpp
r80938 r81040 29 29 #if USE(JSC) 30 30 #include "BridgeJSC.h" 31 #include <runtime/JSObject.h> 31 32 #include <runtime/ScopeChain.h> 32 33 #endif
Note: See TracChangeset
for help on using the changeset viewer.