Changeset 37268 in webkit for trunk/JavaScriptCore
- Timestamp:
- Oct 3, 2008, 5:10:29 PM (17 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r37264 r37268 1 2008-10-03 Cameron Zwarich <[email protected]> 2 3 Reviewed by Maciej Stachowiak. 4 5 Bug 21343: REGRESSSION (r37160): ecma_3/ExecutionContexts/10.1.3-1.js and js1_4/Functions/function-001.js fail on 64-bit 6 <https://bugs.webkit.org/show_bug.cgi?id=21343> 7 8 A fix was landed for this issue in r37253, and the ChangeLog assumes 9 that it is a compiler bug, but it turns out that it is a subtle issue 10 with mixing signed and unsigned 32-bit values in a 64-bit environment. 11 In order to properly fix this bug, we should convert our signed offsets 12 into the register file to use ptrdiff_t. 13 14 This may not be the only instance of this issue, but I will land this 15 fix first and look for more later. 16 17 * VM/Machine.cpp: 18 (JSC::Machine::getArgumentsData): 19 * VM/Machine.h: 20 * kjs/Arguments.cpp: 21 (JSC::Arguments::getOwnPropertySlot): 22 * kjs/Arguments.h: 23 (JSC::Arguments::init): 24 1 25 2008-10-03 Darin Adler <[email protected]> 2 26 -
trunk/JavaScriptCore/VM/Machine.cpp
r37257 r37268 3929 3929 } 3930 3930 3931 void Machine::getArgumentsData(Register* callFrame, JSFunction*& function, int& firstParameterIndex, Register*& argv, int& argc)3931 void Machine::getArgumentsData(Register* callFrame, JSFunction*& function, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc) 3932 3932 { 3933 3933 function = static_cast<JSFunction*>(callFrame[RegisterFile::Callee].getJSValue()); -
trunk/JavaScriptCore/VM/Machine.h
r37257 r37268 108 108 static CodeBlock* codeBlock(const Register* r) { return r[RegisterFile::CodeBlock].codeBlock(); } 109 109 110 void getArgumentsData(Register* callFrame, JSFunction*&, int& firstParameterIndex, Register*& argv, int& argc);110 void getArgumentsData(Register* callFrame, JSFunction*&, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc); 111 111 void setTimeoutTime(unsigned timeoutTime) { m_timeoutTime = timeoutTime; } 112 112 -
trunk/JavaScriptCore/kjs/Arguments.cpp
r37253 r37268 112 112 if (i < d->numArguments && (!d->deletedArguments || !d->deletedArguments[i])) { 113 113 if (i < d->numParameters) { 114 #if COMPILER(GCC) && PLATFORM(X86_64)115 // The subscript variable is a workaround for a 64-bit code116 // generation bug in GCC.117 int subscript = d->firstParameterIndex + i;118 slot.setRegisterSlot(&d->registers[subscript]);119 #else120 114 slot.setRegisterSlot(&d->registers[d->firstParameterIndex + i]); 121 #endif122 115 } else 123 116 slot.setValue(d->extraArguments[i - d->numParameters].jsValue(exec)); … … 134 127 if (isArrayIndex && i < d->numArguments && (!d->deletedArguments || !d->deletedArguments[i])) { 135 128 if (i < d->numParameters) { 136 #if COMPILER(GCC) && PLATFORM(X86_64)137 // The subscript variable is a workaround for a 64-bit code138 // generation bug in GCC.139 int subscript = d->firstParameterIndex + i;140 slot.setRegisterSlot(&d->registers[subscript]);141 #else142 129 slot.setRegisterSlot(&d->registers[d->firstParameterIndex + i]); 143 #endif144 130 } else 145 131 slot.setValue(d->extraArguments[i - d->numParameters].jsValue(exec)); -
trunk/JavaScriptCore/kjs/Arguments.h
r37184 r37268 36 36 37 37 unsigned numParameters; 38 int firstParameterIndex;38 ptrdiff_t firstParameterIndex; 39 39 unsigned numArguments; 40 40 … … 85 85 { 86 86 JSFunction* callee; 87 int firstParameterIndex;87 ptrdiff_t firstParameterIndex; 88 88 Register* argv; 89 89 int numArguments;
Note:
See TracChangeset
for help on using the changeset viewer.