Changeset 80919 in webkit
- Timestamp:
- Mar 11, 2011 7:12:05 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r80906 r80919 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-11 Dimitri Glazkov <dglazkov@chromium.org> 2 60 -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r80742 r80919 2545 2545 buildConfigurationList = 149C277108902AFE008A9EFC /* Build configuration list for PBXProject "JavaScriptCore" */; 2546 2546 compatibilityVersion = "Xcode 3.1"; 2547 developmentRegion = English; 2547 2548 hasScannedForEncodings = 1; 2548 2549 knownRegions = ( -
trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.cpp
r79904 r80919 27 27 #include "StructureStubInfo.h" 28 28 29 #include "JSObject.h" 29 30 #include "ScopeChain.h" 30 31 -
trunk/Source/JavaScriptCore/interpreter/Register.h
r76248 r80919 55 55 Register& operator=(const JSValue&); 56 56 JSValue jsValue() const; 57 58 Register& operator=(JSActivation*); 57 59 58 Register& operator=(CallFrame*); 60 59 Register& operator=(CodeBlock*); 61 Register& operator=(JSPropertyNameIterator*);62 60 Register& operator=(ScopeChainNode*); 63 61 Register& operator=(Instruction*); … … 74 72 static Register withInt(int32_t i) 75 73 { 76 Register r; 77 r.u.i = i; 74 Register r = jsNumber(i); 78 75 return r; 79 76 } 80 77 81 static Register withCallee(JSObject* callee) 82 { 83 Register r; 84 r.u.function = callee; 85 return r; 86 } 78 static inline Register withCallee(JSObject* callee); 87 79 88 80 private: 89 81 union { 90 int32_t i;91 82 EncodedJSValue value; 92 93 JSActivation* activation;94 83 CallFrame* callFrame; 95 84 CodeBlock* codeBlock; 96 JSObject* function;97 JSPropertyNameIterator* propertyNameIterator;98 ScopeChainNode* scopeChain;99 85 Instruction* vPC; 100 86 } u; … … 132 118 // Interpreter functions 133 119 134 ALWAYS_INLINE Register& Register::operator=(JSActivation* activation)135 {136 u.activation = activation;137 return *this;138 }139 140 120 ALWAYS_INLINE Register& Register::operator=(CallFrame* callFrame) 141 121 { … … 156 136 } 157 137 158 ALWAYS_INLINE Register& Register::operator=(ScopeChainNode* scopeChain)138 ALWAYS_INLINE int32_t Register::i() const 159 139 { 160 u.scopeChain = scopeChain; 161 return *this; 140 return jsValue().asInt32(); 162 141 } 163 142 164 ALWAYS_INLINE Register& Register::operator=(JSPropertyNameIterator* propertyNameIterator)165 {166 u.propertyNameIterator = propertyNameIterator;167 return *this;168 }169 170 ALWAYS_INLINE int32_t Register::i() const171 {172 return u.i;173 }174 175 ALWAYS_INLINE JSActivation* Register::activation() const176 {177 return u.activation;178 }179 180 143 ALWAYS_INLINE CallFrame* Register::callFrame() const 181 144 { … … 187 150 return u.codeBlock; 188 151 } 189 190 ALWAYS_INLINE JSObject* Register::function() const 191 { 192 return u.function; 193 } 194 195 ALWAYS_INLINE JSPropertyNameIterator* Register::propertyNameIterator() const 196 { 197 return u.propertyNameIterator; 198 } 199 200 ALWAYS_INLINE ScopeChainNode* Register::scopeChain() const 201 { 202 return u.scopeChain; 203 } 204 152 205 153 ALWAYS_INLINE Instruction* Register::vPC() const 206 154 { -
trunk/Source/JavaScriptCore/jit/JIT.h
r80738 r80919 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
r79904 r80919 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
r79904 r80919 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
r80598 r80919 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
r80742 r80919 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
r80742 r80919 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
r70111 r80919 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 static const unsigned Int32Tag = JSValue::Int32Tag; 163 #else 164 static const unsigned Int32Tag = JSImmediate::TagTypeNumber >> 32; 165 #endif 160 166 inline Jump emitLoadJSCell(unsigned virtualRegisterIndex, RegisterID payload); 161 167 inline Jump emitLoadInt32(unsigned virtualRegisterIndex, RegisterID dst); … … 174 180 175 181 inline Address payloadFor(unsigned index, RegisterID base = callFrameRegister); 182 inline Address intPayloadFor(unsigned index, RegisterID base = callFrameRegister); 183 inline Address intTagFor(unsigned index, RegisterID base = callFrameRegister); 176 184 inline Address addressFor(unsigned index, RegisterID base = callFrameRegister); 177 185 }; … … 213 221 ASSERT(static_cast<int>(virtualRegisterIndex) < FirstConstantRegisterIndex); 214 222 return Address(base, (virtualRegisterIndex * sizeof(Register)) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)); 223 } 224 225 inline JSInterfaceJIT::Address JSInterfaceJIT::intPayloadFor(unsigned virtualRegisterIndex, RegisterID base) 226 { 227 return payloadFor(virtualRegisterIndex, base); 228 } 229 230 inline JSInterfaceJIT::Address JSInterfaceJIT::intTagFor(unsigned virtualRegisterIndex, RegisterID base) 231 { 232 return tagFor(virtualRegisterIndex, base); 215 233 } 216 234 … … 280 298 return addressFor(virtualRegisterIndex, base); 281 299 } 300 301 inline JSInterfaceJIT::Address JSInterfaceJIT::intPayloadFor(unsigned virtualRegisterIndex, RegisterID base) 302 { 303 ASSERT(static_cast<int>(virtualRegisterIndex) < FirstConstantRegisterIndex); 304 return Address(base, (virtualRegisterIndex * sizeof(Register)) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)); 305 } 306 inline JSInterfaceJIT::Address JSInterfaceJIT::intTagFor(unsigned virtualRegisterIndex, RegisterID base) 307 { 308 ASSERT(static_cast<int>(virtualRegisterIndex) < FirstConstantRegisterIndex); 309 return Address(base, (virtualRegisterIndex * sizeof(Register)) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag)); 310 } 282 311 #endif 283 312 -
trunk/Source/JavaScriptCore/jit/SpecializedThunkJIT.h
r70111 r80919 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
r79904 r80919 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
r79904 r80919 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
r79904 r80919 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
r79904 r80919 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
r80742 r80919 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
r79904 r80919 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
r79904 r80919 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
r80378 r80919 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
r79132 r80919 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
r80751 r80919 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
r80751 r80919 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
r80751 r80919 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
r80742 r80919 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
r79904 r80919 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
r79904 r80919 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
r80542 r80919 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
r80918 r80919 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-11 Mark Rowe <mrowe@apple.com> 2 16 -
trunk/Source/WebCore/bridge/c/c_class.cpp
r79904 r80919 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
r79904 r80919 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
r80888 r80919 32 32 #include "JavaString.h" 33 33 34 #include <runtime/JSObject.h> 34 35 #include <runtime/ScopeChain.h> 35 36 #include <wtf/text/StringBuilder.h> -
trunk/Source/WebCore/plugins/PluginViewNone.cpp
r79988 r80919 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.