Changeset 402 for trunk/JavaScriptCore/VM/Machine.cpp
- Timestamp:
- 07/18/08 14:43:08 (2 years ago)
- Files:
-
- trunk/JavaScriptCore/VM/Machine.cpp (modified) (104 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/JavaScriptCore/VM/Machine.cpp
r387 r402 215 215 if (exceptionValue) 216 216 return false; 217 r[dst] .u.jsValue= result;217 r[dst] = result; 218 218 return true; 219 219 } … … 245 245 if (exceptionValue) 246 246 return false; 247 r[dst] .u.jsValue= result;247 r[dst] = result; 248 248 return true; 249 249 } … … 270 270 base = *iter; 271 271 if (next == end || base->getPropertySlot(exec, ident, slot)) { 272 r[dst] .u.jsValue= base;272 r[dst] = base; 273 273 return; 274 274 } … … 301 301 if (exceptionValue) 302 302 return false; 303 r[propDst] .u.jsValue= result;304 r[baseDst] .u.jsValue= base;303 r[propDst] = result; 304 r[baseDst] = base; 305 305 return true; 306 306 } … … 344 344 return false; 345 345 346 r[baseDst] .u.jsValue= thisObj;347 r[funcDst] .u.jsValue= result;346 r[baseDst] = thisObj; 347 r[funcDst] = result; 348 348 return true; 349 349 } … … 355 355 } 356 356 357 ALWAYS_INLINE void initializeCallFrame(Register* callFrame, CodeBlock* codeBlock, Instruction* vPC, ScopeChainNode* scopeChain, Register* r, int returnValueRegister, int argv, int argc, int calledAsConstructor, JSValue* function)358 { 359 callFrame[RegisterFile::CallerCodeBlock] .u.codeBlock= codeBlock;360 callFrame[RegisterFile::ReturnVPC] .u.vPC= vPC + 1;361 callFrame[RegisterFile::CallerScopeChain] .u.scopeChain= scopeChain;362 callFrame[RegisterFile::CallerRegisters] .u.r= r;363 callFrame[RegisterFile::ReturnValueRegister] .u.i= returnValueRegister;364 callFrame[RegisterFile::ArgumentStartRegister] .u.i= argv; // original argument vector (for the sake of the "arguments" object)365 callFrame[RegisterFile::ArgumentCount] .u.i= argc; // original argument count (for the sake of the "arguments" object)366 callFrame[RegisterFile::CalledAsConstructor] .u.i= calledAsConstructor;367 callFrame[RegisterFile::Callee] .u.jsValue= function;368 callFrame[RegisterFile::OptionalCalleeActivation] .u.jsValue = 0;357 ALWAYS_INLINE void Machine::initializeCallFrame(Register* callFrame, CodeBlock* codeBlock, Instruction* vPC, ScopeChainNode* scopeChain, Register* r, int returnValueRegister, int argv, int argc, int calledAsConstructor, JSValue* function) 358 { 359 callFrame[RegisterFile::CallerCodeBlock] = codeBlock; 360 callFrame[RegisterFile::ReturnVPC] = vPC + 1; 361 callFrame[RegisterFile::CallerScopeChain] = scopeChain; 362 callFrame[RegisterFile::CallerRegisters] = r; 363 callFrame[RegisterFile::ReturnValueRegister] = returnValueRegister; 364 callFrame[RegisterFile::ArgumentStartRegister] = argv; // original argument vector (for the sake of the "arguments" object) 365 callFrame[RegisterFile::ArgumentCount] = argc; // original argument count (for the sake of the "arguments" object) 366 callFrame[RegisterFile::CalledAsConstructor] = calledAsConstructor; 367 callFrame[RegisterFile::Callee] = function; 368 callFrame[RegisterFile::OptionalCalleeActivation] = intptr_t(0L); 369 369 } 370 370 … … 390 390 Register* endOfParams = r - newCodeBlock->numVars; 391 391 for (Register* it = endOfParams - omittedArgCount; it != endOfParams; ++it) 392 (*it) .u.jsValue= jsUndefined();392 (*it) = jsUndefined(); 393 393 } else { // too many arguments -- copy return info and expected arguments, leaving the extra arguments behind 394 394 int shift = argc + RegisterFile::CallFrameHeaderSize; … … 410 410 // initialize local variable slots 411 411 for (Register* it = r - newCodeBlock->numVars; it != r; ++it) 412 (*it) .u.jsValue= jsUndefined();412 (*it) = jsUndefined(); 413 413 414 414 return r; … … 419 419 if (newCodeBlock->needsFullScopeChain) { 420 420 JSActivation* activation = new (exec) JSActivation(functionBodyNode, r); 421 r[RegisterFile::OptionalCalleeActivation - RegisterFile::CallFrameHeaderSize - newCodeBlock->numLocals] .u.jsValue= activation;421 r[RegisterFile::OptionalCalleeActivation - RegisterFile::CallFrameHeaderSize - newCodeBlock->numLocals] = activation; 422 422 423 423 return callDataScopeChain->copy()->push(activation); … … 435 435 } 436 436 437 NEVER_INLINE JSValue* callEval(ExecState* exec, JSObject* thisObj, ScopeChainNode* scopeChain, RegisterFile* registerFile, Register* r, int argv, int argc, JSValue*& exceptionValue)437 NEVER_INLINE JSValue* Machine::callEval(ExecState* exec, JSObject* thisObj, ScopeChainNode* scopeChain, RegisterFile* registerFile, Register* r, int argv, int argc, JSValue*& exceptionValue) 438 438 { 439 439 if (argc < 2) 440 440 return jsUndefined(); 441 441 442 JSValue* program = r[argv + 1]. u.jsValue;442 JSValue* program = r[argv + 1].jsValue(); 443 443 444 444 if (!program->isString()) … … 515 515 end = it + registerFile->numGlobals(); 516 516 while (it != end) { 517 printf("[global var] | %10p | %10p \n", it, (*it). u.jsValue);517 printf("[global var] | %10p | %10p \n", it, (*it).jsValue()); 518 518 ++it; 519 519 } … … 522 522 523 523 it = r - codeBlock->numLocals - RegisterFile::CallFrameHeaderSize; 524 printf("[CallerCodeBlock] | %10p | %10p \n", it, (*it). u.jsValue); ++it;525 printf("[ReturnVPC] | %10p | %10p \n", it, (*it). u.jsValue); ++it;526 printf("[CallerScopeChain] | %10p | %10p \n", it, (*it). u.jsValue); ++it;527 printf("[CallerRegisterOffset] | %10p | %10p \n", it, (*it). u.jsValue); ++it;528 printf("[ReturnValueRegister] | %10p | %10p \n", it, (*it). u.jsValue); ++it;529 printf("[ArgumentStartRegister] | %10p | %10p \n", it, (*it). u.jsValue); ++it;530 printf("[ArgumentCount] | %10p | %10p \n", it, (*it). u.jsValue); ++it;531 printf("[CalledAsConstructor] | %10p | %10p \n", it, (*it). u.jsValue); ++it;532 printf("[Callee] | %10p | %10p \n", it, (*it). u.jsValue); ++it;533 printf("[OptionalCalleeActivation] | %10p | %10p \n", it, (*it). u.jsValue); ++it;524 printf("[CallerCodeBlock] | %10p | %10p \n", it, (*it).jsValue()); ++it; 525 printf("[ReturnVPC] | %10p | %10p \n", it, (*it).jsValue()); ++it; 526 printf("[CallerScopeChain] | %10p | %10p \n", it, (*it).jsValue()); ++it; 527 printf("[CallerRegisterOffset] | %10p | %10p \n", it, (*it).jsValue()); ++it; 528 printf("[ReturnValueRegister] | %10p | %10p \n", it, (*it).jsValue()); ++it; 529 printf("[ArgumentStartRegister] | %10p | %10p \n", it, (*it).jsValue()); ++it; 530 printf("[ArgumentCount] | %10p | %10p \n", it, (*it).jsValue()); ++it; 531 printf("[CalledAsConstructor] | %10p | %10p \n", it, (*it).jsValue()); ++it; 532 printf("[Callee] | %10p | %10p \n", it, (*it).jsValue()); ++it; 533 printf("[OptionalCalleeActivation] | %10p | %10p \n", it, (*it).jsValue()); ++it; 534 534 printf("----------------------------------------------------\n"); 535 535 536 printf("[this] | %10p | %10p \n", it, (*it). u.jsValue); ++it;536 printf("[this] | %10p | %10p \n", it, (*it).jsValue()); ++it; 537 537 end = it + max(codeBlock->numParameters - 1, 0); // - 1 to skip "this" 538 538 if (it != end) { 539 539 do { 540 printf("[param] | %10p | %10p \n", it, (*it). u.jsValue);540 printf("[param] | %10p | %10p \n", it, (*it).jsValue()); 541 541 ++it; 542 542 } while (it != end); … … 548 548 if (it != end) { 549 549 do { 550 printf("[var] | %10p | %10p \n", it, (*it). u.jsValue);550 printf("[var] | %10p | %10p \n", it, (*it).jsValue()); 551 551 ++it; 552 552 } while (it != end); … … 558 558 if (it != end) { 559 559 do { 560 printf("[temp] | %10p | %10p \n", it, (*it). u.jsValue);560 printf("[temp] | %10p | %10p \n", it, (*it).jsValue()); 561 561 ++it; 562 562 } while (it != end); … … 575 575 } 576 576 577 NEVER_INLINE bool Machine::unwindCallFrame(ExecState* exec, JSValue* exceptionValue, const Instruction*& vPC, CodeBlock*& codeBlock, JSValue**& k, ScopeChainNode*& scopeChain, Register*& r)577 NEVER_INLINE bool Machine::unwindCallFrame(ExecState* exec, JSValue* exceptionValue, const Instruction*& vPC, CodeBlock*& codeBlock, Register*& k, ScopeChainNode*& scopeChain, Register*& r) 578 578 { 579 579 CodeBlock* oldCodeBlock = codeBlock; … … 582 582 if (Debugger* debugger = exec->dynamicGlobalObject()->debugger()) { 583 583 DebuggerCallFrame debuggerCallFrame(exec->dynamicGlobalObject(), codeBlock, scopeChain, r, exceptionValue); 584 if (callFrame[RegisterFile::Callee]. u.jsObject)584 if (callFrame[RegisterFile::Callee].jsValue()) 585 585 debugger->returnEvent(debuggerCallFrame, codeBlock->ownerNode->sourceId(), codeBlock->ownerNode->lastLine()); 586 586 else … … 589 589 590 590 if (Profiler* profiler = *Profiler::enabledProfilerReference()) { 591 if (callFrame[RegisterFile::Callee]. u.jsObject)592 profiler->didExecute(exec, callFrame[RegisterFile::Callee].u.jsObject);591 if (callFrame[RegisterFile::Callee].jsValue()) 592 profiler->didExecute(exec, static_cast<JSObject*>(callFrame[RegisterFile::Callee].jsValue())); 593 593 else 594 594 profiler->didExecute(exec, codeBlock->ownerNode->sourceURL(), codeBlock->ownerNode->lineNo()); … … 599 599 600 600 // If this call frame created an activation, tear it off. 601 if (JSActivation* activation = static_cast<JSActivation*>(callFrame[RegisterFile::OptionalCalleeActivation]. u.jsValue)) {601 if (JSActivation* activation = static_cast<JSActivation*>(callFrame[RegisterFile::OptionalCalleeActivation].jsValue())) { 602 602 ASSERT(activation->isActivationObject()); 603 603 activation->copyRegisters(); 604 604 } 605 605 606 codeBlock = callFrame[RegisterFile::CallerCodeBlock]. u.codeBlock;606 codeBlock = callFrame[RegisterFile::CallerCodeBlock].codeBlock(); 607 607 if (!codeBlock) 608 608 return false; 609 609 610 k = codeBlock-> jsValues.data();611 scopeChain = callFrame[RegisterFile::CallerScopeChain]. u.scopeChain;612 r = callFrame[RegisterFile::CallerRegisters]. u.r;610 k = codeBlock->registers.data(); 611 scopeChain = callFrame[RegisterFile::CallerScopeChain].scopeChain(); 612 r = callFrame[RegisterFile::CallerRegisters].r(); 613 613 exec->m_callFrame = r - oldCodeBlock->numLocals - RegisterFile::CallFrameHeaderSize; 614 vPC = callFrame[RegisterFile::ReturnVPC]. u.vPC;614 vPC = callFrame[RegisterFile::ReturnVPC].vPC(); 615 615 616 616 return true; 617 617 } 618 618 619 NEVER_INLINE Instruction* Machine::throwException(ExecState* exec, JSValue* exceptionValue, const Instruction* vPC, CodeBlock*& codeBlock, JSValue**& k, ScopeChainNode*& scopeChain, Register*& r)619 NEVER_INLINE Instruction* Machine::throwException(ExecState* exec, JSValue* exceptionValue, const Instruction* vPC, CodeBlock*& codeBlock, Register*& k, ScopeChainNode*& scopeChain, Register*& r) 620 620 { 621 621 // Set up the exception object … … 689 689 690 690 Register* r = callFrame + RegisterFile::CallFrameHeaderSize + codeBlock->numVars; 691 r[codeBlock->thisRegister] .u.jsValue= thisObj;691 r[codeBlock->thisRegister] = thisObj; 692 692 693 693 if (codeBlock->needsFullScopeChain) … … 737 737 // put args in place, including "this" 738 738 Register* dst = callFrame + RegisterFile::CallFrameHeaderSize; 739 (*dst) .u.jsValue= thisObj;739 (*dst) = thisObj; 740 740 741 741 ArgList::const_iterator end = args.end(); 742 742 for (ArgList::const_iterator it = args.begin(); it != end; ++it) 743 (*++dst) .u.jsValue= *it;743 (*++dst) = *it; 744 744 745 745 // a 0 codeBlock indicates a built-in caller … … 816 816 817 817 Register* r = callFrame + RegisterFile::CallFrameHeaderSize + codeBlock->numVars; 818 r[codeBlock->thisRegister] .u.jsValue= thisObj;818 r[codeBlock->thisRegister] = thisObj; 819 819 820 820 if (codeBlock->needsFullScopeChain) … … 978 978 Register* registerBase = registerFile->base(); 979 979 Instruction* vPC = codeBlock->instructions.begin(); 980 JSValue** k = codeBlock->jsValues.data();980 Register* k = codeBlock->registers.data(); 981 981 Profiler** enabledProfilerReference = Profiler::enabledProfilerReference(); 982 982 unsigned tickCount = m_ticksUntilNextTimeoutCheck + 1; … … 1027 1027 int dst = (++vPC)->u.operand; 1028 1028 int src = (++vPC)->u.operand; 1029 r[dst] .u.jsValue= k[src];1029 r[dst] = k[src]; 1030 1030 1031 1031 ++vPC; … … 1039 1039 */ 1040 1040 int dst = (++vPC)->u.operand; 1041 r[dst] .u.jsValue= constructEmptyObject(exec);1041 r[dst] = constructEmptyObject(exec); 1042 1042 1043 1043 ++vPC; … … 1055 1055 int firstArg = (++vPC)->u.operand; 1056 1056 int argCount = (++vPC)->u.operand; 1057 ArgList args(r einterpret_cast<JSValue**>(r)+ firstArg, argCount);1058 r[dst] .u.jsValue= constructArray(exec, args);1057 ArgList args(r + firstArg, argCount); 1058 r[dst] = constructArray(exec, args); 1059 1059 1060 1060 ++vPC; … … 1070 1070 int dst = (++vPC)->u.operand; 1071 1071 int regExp = (++vPC)->u.operand; 1072 r[dst] .u.jsValue= new (exec) RegExpObject(scopeChain->globalObject()->regExpPrototype(), codeBlock->regexps[regExp]);1072 r[dst] = new (exec) RegExpObject(scopeChain->globalObject()->regExpPrototype(), codeBlock->regexps[regExp]); 1073 1073 1074 1074 ++vPC; … … 1094 1094 as a boolean in register dst. 1095 1095 */ 1096 JSValue*& dst = r[(++vPC)->u.operand].u.jsValue; 1097 JSValue* src1 = r[(++vPC)->u.operand].u.jsValue; 1098 JSValue* src2 = r[(++vPC)->u.operand].u.jsValue; 1099 JSValue* result; 1096 int dst = (++vPC)->u.operand; 1097 JSValue* src1 = r[(++vPC)->u.operand].jsValue(); 1098 JSValue* src2 = r[(++vPC)->u.operand].jsValue(); 1100 1099 if (JSImmediate::areBothImmediateNumbers(src1, src2)) 1101 r esult= jsBoolean(reinterpret_cast<intptr_t>(src1) == reinterpret_cast<intptr_t>(src2));1100 r[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) == reinterpret_cast<intptr_t>(src2)); 1102 1101 else { 1103 result = jsBoolean(equal(exec, src1, src2));1102 JSValue* result = jsBoolean(equal(exec, src1, src2)); 1104 1103 VM_CHECK_EXCEPTION(); 1105 }1106 dst = result;1104 r[dst] = result; 1105 } 1107 1106 1108 1107 ++vPC; … … 1116 1115 result as a boolean in register dst. 1117 1116 */ 1118 JSValue*& dst = r[(++vPC)->u.operand].u.jsValue; 1119 JSValue* src1 = r[(++vPC)->u.operand].u.jsValue; 1120 JSValue* src2 = r[(++vPC)->u.operand].u.jsValue; 1121 JSValue* result; 1117 int dst = (++vPC)->u.operand; 1118 JSValue* src1 = r[(++vPC)->u.operand].jsValue(); 1119 JSValue* src2 = r[(++vPC)->u.operand].jsValue(); 1122 1120 if (JSImmediate::areBothImmediateNumbers(src1, src2)) 1123 r esult= jsBoolean(reinterpret_cast<intptr_t>(src1) != reinterpret_cast<intptr_t>(src2));1121 r[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) != reinterpret_cast<intptr_t>(src2)); 1124 1122 else { 1125 result = jsBoolean(!equal(exec, src1, src2));1123 JSValue* result = jsBoolean(!equal(exec, src1, src2)); 1126 1124 VM_CHECK_EXCEPTION(); 1127 }1128 dst = result;1125 r[dst] = result; 1126 } 1129 1127 1130 1128 ++vPC; … … 1138 1136 result as a boolean in register dst. 1139 1137 */ 1140 JSValue*& dst = r[(++vPC)->u.operand].u.jsValue;1141 JSValue* src1 = r[(++vPC)->u.operand]. u.jsValue;1142 JSValue* src2 = r[(++vPC)->u.operand]. u.jsValue;1138 int dst = (++vPC)->u.operand; 1139 JSValue* src1 = r[(++vPC)->u.operand].jsValue(); 1140 JSValue* src2 = r[(++vPC)->u.operand].jsValue(); 1143 1141 if (JSImmediate::areBothImmediateNumbers(src1, src2)) 1144 dst= jsBoolean(reinterpret_cast<intptr_t>(src1) == reinterpret_cast<intptr_t>(src2));1142 r[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) == reinterpret_cast<intptr_t>(src2)); 1145 1143 else 1146 dst= jsBoolean(strictEqual(src1, src2));1144 r[dst] = jsBoolean(strictEqual(src1, src2)); 1147 1145 1148 1146 ++vPC; … … 1156 1154 puts the result as a boolean in register dst. 1157 1155 */ 1158 JSValue*& dst = r[(++vPC)->u.operand].u.jsValue;1159 JSValue* src1 = r[(++vPC)->u.operand]. u.jsValue;1160 JSValue* src2 = r[(++vPC)->u.operand]. u.jsValue;1156 int dst = (++vPC)->u.operand; 1157 JSValue* src1 = r[(++vPC)->u.operand].jsValue(); 1158 JSValue* src2 = r[(++vPC)->u.operand].jsValue(); 1161 1159 if (JSImmediate::areBothImmediateNumbers(src1, src2)) 1162 dst= jsBoolean(reinterpret_cast<intptr_t>(src1) != reinterpret_cast<intptr_t>(src2));1160 r[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) != reinterpret_cast<intptr_t>(src2)); 1163 1161 else 1164 dst= jsBoolean(!strictEqual(src1, src2));1162 r[dst] = jsBoolean(!strictEqual(src1, src2)); 1165 1163 1166 1164 ++vPC; … … 1174 1172 a boolean in register dst. 1175 1173 */ 1176 JSValue*& dst = r[(++vPC)->u.operand].u.jsValue;1177 JSValue* src1 = r[(++vPC)->u.operand]. u.jsValue;1178 JSValue* src2 = r[(++vPC)->u.operand]. u.jsValue;1174 int dst = (++vPC)->u.operand; 1175 JSValue* src1 = r[(++vPC)->u.operand].jsValue(); 1176 JSValue* src2 = r[(++vPC)->u.operand].jsValue(); 1179 1177 JSValue* result = jsBoolean(jsLess(exec, src1, src2)); 1180 1178 VM_CHECK_EXCEPTION(); 1181 dst= result;1179 r[dst] = result; 1182 1180 1183 1181 ++vPC; … … 1191 1189 puts the result as a boolean in register dst. 1192 1190 */ 1193 JSValue*& dst = r[(++vPC)->u.operand].u.jsValue;1194 JSValue* src1 = r[(++vPC)->u.operand]. u.jsValue;1195 JSValue* src2 = r[(++vPC)->u.operand]. u.jsValue;1191 int dst = (++vPC)->u.operand; 1192 JSValue* src1 = r[(++vPC)->u.operand].jsValue(); 1193 JSValue* src2 = r[(++vPC)->u.operand].jsValue(); 1196 1194 JSValue* result = jsBoolean(jsLessEq(exec, src1, src2)); 1197 1195 VM_CHECK_EXCEPTION(); 1198 dst= result;1196 r[dst] = result; 1199 1197 1200 1198 ++vPC; … … 1208 1206 */ 1209 1207 int srcDst = (++vPC)->u.operand; 1210 JSValue* v = r[srcDst].u.jsValue; 1211 JSValue* result; 1208 JSValue* v = r[srcDst].jsValue(); 1212 1209 if (JSImmediate::canDoFastAdditiveOperations(v)) 1213 result = JSImmediate::incImmediateNumber(v); 1214 else 1215 result = jsNumber(exec, v->toNumber(exec) + 1); 1216 VM_CHECK_EXCEPTION(); 1217 r[srcDst].u.jsValue = result; 1210 r[srcDst] = JSImmediate::incImmediateNumber(v); 1211 else { 1212 JSValue* result = jsNumber(exec, v->toNumber(exec) + 1); 1213 VM_CHECK_EXCEPTION(); 1214 r[srcDst] = result; 1215 } 1218 1216 1219 1217 ++vPC; … … 1227 1225 */ 1228 1226 int srcDst = (++vPC)->u.operand; 1229 JSValue* v = r[srcDst].u.jsValue; 1230 JSValue* result; 1227 JSValue* v = r[srcDst].jsValue(); 1231 1228 if (JSImmediate::canDoFastAdditiveOperations(v)) 1232 result = JSImmediate::decImmediateNumber(v); 1233 else 1234 result = jsNumber(exec, v->toNumber(exec) - 1); 1235 VM_CHECK_EXCEPTION(); 1236 r[srcDst].u.jsValue = result; 1229 r[srcDst] = JSImmediate::decImmediateNumber(v); 1230 else { 1231 JSValue* result = jsNumber(exec, v->toNumber(exec) - 1); 1232 VM_CHECK_EXCEPTION(); 1233 r[srcDst] = result; 1234 } 1237 1235 1238 1236 ++vPC; … … 1248 1246 int dst = (++vPC)->u.operand; 1249 1247 int srcDst = (++vPC)->u.operand; 1250 JSValue* v = r[srcDst].u.jsValue; 1251 JSValue* result; 1252 JSValue* number; 1248 JSValue* v = r[srcDst].jsValue(); 1253 1249 if (JSImmediate::canDoFastAdditiveOperations(v)) { 1254 number= v;1255 r esult= JSImmediate::incImmediateNumber(v);1250 r[dst] = v; 1251 r[srcDst] = JSImmediate::incImmediateNumber(v); 1256 1252 } else { 1257 number = r[srcDst].u.jsValue->toJSNumber(exec); 1258 result = jsNumber(exec, number->uncheckedGetNumber() + 1); 1259 } 1260 VM_CHECK_EXCEPTION(); 1261 1262 r[dst].u.jsValue = number; 1263 r[srcDst].u.jsValue = result; 1253 JSValue* number = r[srcDst].jsValue()->toJSNumber(exec); 1254 VM_CHECK_EXCEPTION(); 1255 r[dst] = number; 1256 r[srcDst] = jsNumber(exec, number->uncheckedGetNumber() + 1); 1257 } 1264 1258 1265 1259 ++vPC; … … 1275 1269 int dst = (++vPC)->u.operand; 1276 1270 int srcDst = (++vPC)->u.operand; 1277 JSValue* v = r[srcDst].u.jsValue; 1278 JSValue* result; 1279 JSValue* number; 1271 JSValue* v = r[srcDst].jsValue(); 1280 1272 if (JSImmediate::canDoFastAdditiveOperations(v)) { 1281 number= v;1282 r esult= JSImmediate::decImmediateNumber(v);1273 r[dst] = v; 1274 r[srcDst] = JSImmediate::decImmediateNumber(v); 1283 1275 } else { 1284 number = r[srcDst].u.jsValue->toJSNumber(exec); 1285 result = jsNumber(exec, number->uncheckedGetNumber() - 1); 1286 } 1287 VM_CHECK_EXCEPTION(); 1288 1289 r[dst].u.jsValue = number; 1290 r[srcDst].u.jsValue = result; 1276 JSValue* number = r[srcDst].jsValue()->toJSNumber(exec); 1277 VM_CHECK_EXCEPTION(); 1278 r[dst] = number; 1279 r[srcDst] = jsNumber(exec, number->uncheckedGetNumber() - 1); 1280 } 1291 1281 1292 1282 ++vPC; … … 1301 1291 int dst = (++vPC)->u.operand; 1302 1292 int src = (++vPC)->u.operand; 1303 JSValue* result = r[src]. u.jsValue->toJSNumber(exec);1293 JSValue* result = r[src].jsValue()->toJSNumber(exec); 1304 1294 VM_CHECK_EXCEPTION(); 1305 1295 1306 r[dst] .u.jsValue= result;1296 r[dst] = result; 1307 1297 1308 1298 ++vPC; … … 1317 1307 int dst = (++vPC)->u.operand; 1318 1308 int src = (++vPC)->u.operand; 1319 JSValue* result = jsNumber(exec, -r[src]. u.jsValue->toNumber(exec));1309 JSValue* result = jsNumber(exec, -r[src].jsValue()->toNumber(exec)); 1320 1310 VM_CHECK_EXCEPTION(); 1321 r[dst] .u.jsValue= result;1311 r[dst] = result; 1322 1312 1323 1313 ++vPC; … … 1331 1321 numeric add, depending on the types of the operands.) 1332 1322 */ 1333 JSValue*& dst = r[(++vPC)->u.operand].u.jsValue; 1334 JSValue* src1 = r[(++vPC)->u.operand].u.jsValue; 1335 JSValue* src2 = r[(++vPC)->u.operand].u.jsValue; 1336 JSValue* result; 1323 int dst = (++vPC)->u.operand; 1324 JSValue* src1 = r[(++vPC)->u.operand].jsValue(); 1325 JSValue* src2 = r[(++vPC)->u.operand].jsValue(); 1337 1326 if (JSImmediate::canDoFastAdditiveOperations(src1) && JSImmediate::canDoFastAdditiveOperations(src2)) 1338 r esult= JSImmediate::addImmediateNumbers(src1, src2);1327 r[dst] = JSImmediate::addImmediateNumbers(src1, src2); 1339 1328 else { 1340 result = jsAdd(exec, src1, src2);1329 JSValue* result = jsAdd(exec, src1, src2); 1341 1330 VM_CHECK_EXCEPTION(); 1342 }1343 dst = result;1331 r[dst] = result; 1332 } 1344 1333 ++vPC; 1345 1334 NEXT_OPCODE; … … 1351 1340 numbers), and puts the product in register dst. 1352 1341 */ 1353 JSValue*& dst = r[(++vPC)->u.operand].u.jsValue;1354 JSValue* src1 = r[(++vPC)->u.operand]. u.jsValue;1355 JSValue* src2 = r[(++vPC)->u.operand]. u.jsValue;1342 int dst = (++vPC)->u.operand; 1343 JSValue* src1 = r[(++vPC)->u.operand].jsValue(); 1344 JSValue* src2 = r[(++vPC)->u.operand].jsValue(); 1356 1345 JSValue* result = jsNumber(exec, src1->toNumber(exec) * src2->toNumber(exec)); 1357 1346 VM_CHECK_EXCEPTION(); 1358 dst= result;1347 r[dst] = result; 1359 1348 1360 1349 ++vPC; … … 1371 1360 int dividend = (++vPC)->u.operand; 1372 1361 int divisor = (++vPC)->u.operand; 1373 JSValue* result = jsNumber(exec, r[dividend]. u.jsValue->toNumber(exec) / r[divisor].u.jsValue->toNumber(exec));1362 JSValue* result = jsNumber(exec, r[dividend].jsValue()->toNumber(exec) / r[divisor].jsValue()->toNumber(exec)); 1374 1363 VM_CHECK_EXCEPTION(); 1375 r[dst] .u.jsValue= result;1364 r[dst] = result; 1376 1365 ++vPC; 1377 1366 NEXT_OPCODE; … … 1387 1376 int dividend = (++vPC)->u.operand; 1388 1377 int divisor = (++vPC)->u.operand; 1389 double d = r[dividend]. u.jsValue->toNumber(exec);1390 JSValue* result = jsNumber(exec, fmod(d, r[divisor]. u.jsValue->toNumber(exec)));1378 double d = r[dividend].jsValue()->toNumber(exec); 1379 JSValue* result = jsNumber(exec, fmod(d, r[divisor].jsValue()->toNumber(exec))); 1391 1380 VM_CHECK_EXCEPTION(); 1392 r[dst] .u.jsValue= result;1381 r[dst] = result; 1393 1382 ++vPC; 1394 1383 NEXT_OPCODE; … … 1401 1390 register dst. 1402 1391 */ 1403 JSValue*& dst = r[(++vPC)->u.operand].u.jsValue; 1404 JSValue* src1 = r[(++vPC)->u.operand].u.jsValue; 1405 JSValue* src2 = r[(++vPC)->u.operand].u.jsValue; 1406 JSValue* result; 1392 int dst = (++vPC)->u.operand; 1393 JSValue* src1 = r[(++vPC)->u.operand].jsValue(); 1394 JSValue* src2 = r[(++vPC)->u.operand].jsValue(); 1407 1395 if (JSImmediate::canDoFastAdditiveOperations(src1) && JSImmediate::canDoFastAdditiveOperations(src2)) 1408 r esult= JSImmediate::subImmediateNumbers(src1, src2);1396 r[dst] = JSImmediate::subImmediateNumbers(src1, src2); 1409 1397 else { 1410 result = jsNumber(exec, src1->toNumber(exec) - src2->toNumber(exec));1398 JSValue* result = jsNumber(exec, src1->toNumber(exec) - src2->toNumber(exec)); 1411 1399 VM_CHECK_EXCEPTION(); 1412 }1413 dst = result;1400 r[dst] = result; 1401 } 1414 1402 ++vPC; 1415 1403 NEXT_OPCODE; … … 1422 1410 in register dst. 1423 1411 */ 1424 JSValue*& dst = r[(++vPC)->u.operand].u.jsValue; 1425 JSValue* val = r[(++vPC)->u.operand].u.jsValue; 1426 JSValue* shift = r[(++vPC)->u.operand].u.jsValue; 1427 JSValue* result; 1412 int dst = (++vPC)->u.operand; 1413 JSValue* val = r[(++vPC)->u.operand].jsValue(); 1414 JSValue* shift = r[(++vPC)->u.operand].jsValue(); 1428 1415 if (JSImmediate::areBothImmediateNumbers(val, shift)) 1429 r esult= jsNumber(exec, JSImmediate::getTruncatedInt32(val) << (JSImmediate::toTruncatedUInt32(shift) & 0x1f));1416 r[dst] = jsNumber(exec, JSImmediate::getTruncatedInt32(val) << (JSImmediate::toTruncatedUInt32(shift) & 0x1f)); 1430 1417 else { 1431 result = jsNumber(exec, (val->toInt32(exec)) << (shift->toUInt32(exec) & 0x1f));1418 JSValue* result = jsNumber(exec, (val->toInt32(exec)) << (shift->toUInt32(exec) & 0x1f)); 1432 1419 VM_CHECK_EXCEPTION(); 1433 }1434 dst = result;1420 r[dst] = result; 1421 } 1435 1422 1436 1423 ++vPC; … … 1444 1431 uint32), and puts the result in register dst. 1445 1432 */ 1446 JSValue*& dst = r[(++vPC)->u.operand].u.jsValue; 1447 JSValue* val = r[(++vPC)->u.operand].u.jsValue; 1448 JSValue* shift = r[(++vPC)->u.operand].u.jsValue; 1449 JSValue* result; 1433 int dst = (++vPC)->u.operand; 1434 JSValue* val = r[(++vPC)->u.operand].jsValue(); 1435 JSValue* shift = r[(++vPC)->u.operand].jsValue(); 1450 1436 if (JSImmediate::areBothImmediateNumbers(val, shift)) 1451 r esult= JSImmediate::rightShiftImmediateNumbers(val, shift);1437 r[dst] = JSImmediate::rightShiftImmediateNumbers(val, shift); 1452 1438 else { 1453 result = jsNumber(exec, (val->toInt32(exec)) >> (shift->toUInt32(exec) & 0x1f));1439 JSValue* result = jsNumber(exec, (val->toInt32(exec)) >> (shift->toUInt32(exec) & 0x1f)); 1454 1440 VM_CHECK_EXCEPTION(); 1455 }1456 dst = result;1441 r[dst] = result; 1442 } 1457 1443 1458 1444 ++vPC; … … 1466 1452 uint32), and puts the result in register dst. 1467 1453 */ 1468 JSValue*& dst = r[(++vPC)->u.operand].u.jsValue; 1469 JSValue* val = r[(++vPC)->u.operand].u.jsValue; 1470 JSValue* shift = r[(++vPC)->u.operand].u.jsValue; 1471 JSValue* result; 1454 int dst = (++vPC)->u.operand; 1455 JSValue* val = r[(++vPC)->u.operand].jsValue(); 1456 JSValue* shift = r[(++vPC)->u.operand].jsValue(); 1472 1457 if (JSImmediate::areBothImmediateNumbers(val, shift) && !JSImmediate::isNegative(val)) 1473 r esult= JSImmediate::rightShiftImmediateNumbers(val, shift);1458 r[dst] = JSImmediate::rightShiftImmediateNumbers(val, shift); 1474 1459 else { 1475 result = jsNumber(exec, (val->toUInt32(exec)) >> (shift->toUInt32(exec) & 0x1f));1460 JSValue* result = jsNumber(exec, (val->toUInt32(exec)) >> (shift->toUInt32(exec) & 0x1f)); 1476 1461 VM_CHECK_EXCEPTION(); 1477 }1478 dst = result;1462 r[dst] = result; 1463 } 1479 1464 1480 1465 ++vPC; … … 1488 1473 in register dst. 1489 1474 */ 1490 JSValue*& dst = r[(++vPC)->u.operand].u.jsValue; 1491 JSValue* src1 = r[(++vPC)->u.operand].u.jsValue; 1492 JSValue* src2 = r[(++vPC)->u.operand].u.jsValue; 1493 JSValue* result; 1475 int dst = (++vPC)->u.operand; 1476 JSValue* src1 = r[(++vPC)->u.operand].jsValue(); 1477 JSValue* src2 = r[(++vPC)->u.operand].jsValue(); 1494 1478 if (JSImmediate::areBothImmediateNumbers(src1, src2)) 1495 r esult= JSImmediate::andImmediateNumbers(src1, src2);1479 r[dst] = JSImmediate::andImmediateNumbers(src1, src2); 1496 1480 else { 1497 result = jsNumber(exec, src1->toInt32(exec) & src2->toInt32(exec));1481 JSValue* result = jsNumber(exec, src1->toInt32(exec) & src2->toInt32(exec)); 1498 1482 VM_CHECK_EXCEPTION(); 1499 }1500 dst = result;1483 r[dst] = result; 1484 } 1501 1485 1502 1486 ++vPC; … … 1510 1494 in register dst. 1511 1495 */ 1512 JSValue*& dst = r[(++vPC)->u.operand].u.jsValue; 1513 JSValue* src1 = r[(++vPC)->u.operand].u.jsValue; 1514 JSValue* src2 = r[(++vPC)->u.operand].u.jsValue; 1515 JSValue* result; 1496 int dst = (++vPC)->u.operand; 1497 JSValue* src1 = r[(++vPC)->u.operand].jsValue(); 1498 JSValue* src2 = r[(++vPC)->u.operand].jsValue(); 1516 1499 if (JSImmediate::areBothImmediateNumbers(src1, src2)) 1517 r esult= JSImmediate::xorImmediateNumbers(src1, src2);1500 r[dst] = JSImmediate::xorImmediateNumbers(src1, src2); 1518 1501 else { 1519 result = jsNumber(exec, src1->toInt32(exec) ^ src2->toInt32(exec));1502 JSValue* result = jsNumber(exec, src1->toInt32(exec) ^ src2->toInt32(exec)); 1520 1503 VM_CHECK_EXCEPTION(); 1521 }1522 dst = result;1504 r[dst] = result; 1505 } 1523 1506 1524 1507 ++vPC; … … 1532 1515 result in register dst. 1533 1516 */ 1534 JSValue*& dst = r[(++vPC)->u.operand].u.jsValue; 1535 JSValue* src1 = r[(++vPC)->u.operand].u.jsValue; 1536 JSValue* src2 = r[(++vPC)->u.operand].u.jsValue; 1537 JSValue* result; 1517 int dst = (++vPC)->u.operand; 1518 JSValue* src1 = r[(++vPC)->u.operand].jsValue(); 1519 JSValue* src2 = r[(++vPC)->u.operand].jsValue(); 1538 1520 if (JSImmediate::areBothImmediateNumbers(src1, src2)) 1539 r esult= JSImmediate::orImmediateNumbers(src1, src2);1521 r[dst] = JSImmediate::orImmediateNumbers(src1, src2); 1540 1522 else { 1541 result = jsNumber(exec, src1->toInt32(exec) | src2->toInt32(exec));1523 JSValue* result = jsNumber(exec, src1->toInt32(exec) | src2->toInt32(exec)); 1542 1524 VM_CHECK_EXCEPTION(); 1543 }1544 dst = result;1525 r[dst] = result; 1526 } 1545 1527 1546 1528 ++vPC; … … 1555 1537 int dst = (++vPC)->u.operand; 1556 1538 int src = (++vPC)->u.operand; 1557 JSValue* result = jsNumber(exec, ~r[src]. u.jsValue->toInt32(exec));1539 JSValue* result = jsNumber(exec, ~r[src].jsValue()->toInt32(exec)); 1558 1540 VM_CHECK_EXCEPTION(); 1559 r[dst] .u.jsValue= result;1541 r[dst] = result; 1560 1542 1561 1543 ++vPC; … … 1570 1552 int dst = (++vPC)->u.operand; 1571 1553 int src = (++vPC)->u.operand; 1572 JSValue* result = jsBoolean(!r[src]. u.jsValue->toBoolean(exec));1554 JSValue* result = jsBoolean(!r[src].jsValue()->toBoolean(exec)); 1573 1555 VM_CHECK_EXCEPTION(); 1574 r[dst] .u.jsValue= result;1556 r[dst] = result; 1575 1557 1576 1558 ++vPC; … … 1590 1572 int base = (++vPC)->u.operand; 1591 1573 1592 JSValue* baseVal = r[base]. u.jsValue;1574 JSValue* baseVal = r[base].jsValue(); 1593 1575 1594 1576 if (isNotObject(exec, vPC, codeBlock, baseVal, exceptionValue)) … … 1596 1578 1597 1579 JSObject* baseObj = static_cast<JSObject*>(baseVal); 1598 r[dst] .u.jsValue = jsBoolean(baseObj->implementsHasInstance() ? baseObj->hasInstance(exec, r[value].u.jsValue) : false);1580 r[dst] = jsBoolean(baseObj->implementsHasInstance() ? baseObj->hasInstance(exec, r[value].jsValue()) : false); 1599 1581 1600 1582 ++vPC; … … 1609 1591 int dst = (++vPC)->u.operand; 1610 1592 int src = (++vPC)->u.operand; 1611 r[dst] .u.jsValue = jsTypeStringForValue(exec, r[src].u.jsValue);1593 r[dst] = jsTypeStringForValue(exec, r[src].jsValue()); 1612 1594 1613 1595 ++vPC; … … 1627 1609 int base = (++vPC)->u.operand; 1628 1610 1629 JSValue* baseVal = r[base]. u.jsValue;1611 JSValue* baseVal = r[base].jsValue(); 1630 1612 if (isNotObject(exec, vPC, codeBlock, baseVal, exceptionValue)) 1631 1613 goto vm_throw; … … 1633 1615 JSObject* baseObj = static_cast<JSObject*>(baseVal); 1634 1616 1635 JSValue* propName = r[property]. u.jsValue;1617 JSValue* propName = r[property].jsValue(); 1636 1618 1637 1619 uint32_t i; 1638 1620 if (propName->getUInt32(i)) 1639 r[dst] .u.jsValue= jsBoolean(baseObj->hasProperty(exec, i));1621 r[dst] = jsBoolean(baseObj->hasProperty(exec, i)); 1640 1622 else { 1641 1623 Identifier property(exec, propName->toString(exec)); 1642 1624 VM_CHECK_EXCEPTION(); 1643 r[dst] .u.jsValue= jsBoolean(baseObj->hasProperty(exec, property));1625 r[dst] = jsBoolean(baseObj->hasProperty(exec, property)); 1644 1626 } 1645 1627 … … 1694 1676 ASSERT((*iter)->isVariableObject()); 1695 1677 JSVariableObject* scope = static_cast<JSVariableObject*>(*iter); 1696 r[dst] .u.jsValue = scope->valueAt(index);1678 r[dst] = scope->registerAt(index); 1697 1679 ++vPC; 1698 1680 NEXT_OPCODE; … … 1716 1698 ASSERT((*iter)->isVariableObject()); 1717 1699 JSVariableObject* scope = static_cast<JSVariableObject*>(*iter); 1718 scope-> valueAt(index) = r[value].u.jsValue;1700 scope->registerAt(index) = r[value].jsValue(); 1719 1701 ++vPC; 1720 1702 NEXT_OPCODE; … … 1784 1766 1785 1767 Identifier& ident = codeBlock->identifiers[property]; 1786 JSValue *result = r[base]. u.jsValue->get(exec, ident);1768 JSValue *result = r[base].jsValue()->get(exec, ident); 1787 1769 VM_CHECK_EXCEPTION(); 1788 r[dst] .u.jsValue= result;1770 r[dst] = result; 1789 1771 ++vPC; 1790 1772 NEXT_OPCODE; … … 1804 1786 1805 1787 Identifier& ident = codeBlock->identifiers[property]; 1806 r[base]. u.jsValue->put(exec, ident, r[value].u.jsValue);1788 r[base].jsValue()->put(exec, ident, r[value].jsValue()); 1807 1789 1808 1790 VM_CHECK_EXCEPTION(); … … 1822 1804 int property = (++vPC)->u.operand; 1823 1805 1824 JSObject* baseObj = r[base]. u.jsValue->toObject(exec);1806 JSObject* baseObj = r[base].jsValue()->toObject(exec); 1825 1807 1826 1808 Identifier& ident = codeBlock->identifiers[property]; 1827 1809 JSValue* result = jsBoolean(baseObj->deleteProperty(exec, ident)); 1828 1810 VM_CHECK_EXCEPTION(); 1829 r[dst] .u.jsValue= result;1811 r[dst] = result; 1830 1812 ++vPC; 1831 1813 NEXT_OPCODE; … … 1843 1825 int property = (++vPC)->u.operand; 1844 1826 1845 JSValue* baseValue = r[base]. u.jsValue;1846 JSValue* subscript = r[property]. u.jsValue;1827 JSValue* baseValue = r[base].jsValue(); 1828 JSValue* subscript = r[property].jsValue(); 1847 1829 1848 1830 JSValue* result; … … 1867 1849 1868 1850 VM_CHECK_EXCEPTION(); 1869 r[dst] .u.jsValue= result;1851 r[dst] = result; 1870 1852 ++vPC; 1871 1853 NEXT_OPCODE; … … 1886 1868 int value = (++vPC)->u.operand; 1887 1869 1888 JSValue* baseValue = r[base]. u.jsValue;1889 JSValue* subscript = r[property]. u.jsValue;1870 JSValue* baseValue = r[base].jsValue(); 1871 JSValue* subscript = r[property].jsValue(); 1890 1872 1891 1873 unsigned i; … … 1896 1878 JSArray* jsArray = static_cast<JSArray*>(baseValue); 1897 1879 if (jsArray->canSetIndex(i)) 1898 jsArray->setIndex(i, r[value]. u.jsValue);1880 jsArray->setIndex(i, r[value].jsValue()); 1899 1881 else 1900 jsArray->JSArray::put(exec, i, r[value]. u.jsValue);1882 jsArray->JSArray::put(exec, i, r[value].jsValue()); 1901 1883 } else 1902 baseValue->put(exec, i, r[value]. u.jsValue);1884 baseValue->put(exec, i, r[value].jsValue()); 1903 1885 } else { 1904 1886 Identifier property(exec, subscript->toString(exec)); 1905 1887 if (!exec->hadException()) // Don't put to an object if toString threw an exception. 1906 baseValue->put(exec, property, r[value]. u.jsValue);1888 baseValue->put(exec, property, r[value].jsValue()); 1907 1889 } 1908 1890 … … 1923 1905 int property = (++vPC)->u.operand; 1924 1906 1925 JSObject* baseObj = r[base]. u.jsValue->toObject(exec); // may throw1926 1927 JSValue* subscript = r[property]. u.jsValue;1907 JSObject* baseObj = r[base].jsValue()->toObject(exec); // may throw 1908 1909 JSValue* subscript = r[property].jsValue(); 1928 1910 JSValue* result; 1929 1911 uint32_t i; … … 1938 1920 1939 1921 VM_CHECK_EXCEPTION(); 1940 r[dst] .u.jsValue= result;1922 r[dst] = result; 1941 1923 ++vPC; 1942 1924 NEXT_OPCODE; … … 1958 1940 int value = (++vPC)->u.operand; 1959 1941 1960 r[base]. u.jsObject->put(exec, property, r[value].u.jsValue);1942 r[base].jsValue()->put(exec, property, r[value].jsValue()); 1961 1943 1962 1944 ++vPC; … … 2005 1987 int cond = (++vPC)->u.operand; 2006 1988 int target = (++vPC)->u.operand; 2007 if (r[cond]. u.jsValue->toBoolean(exec)) {1989 if (r[cond].jsValue()->toBoolean(exec)) { 2008 1990 vPC += target; 2009 1991 CHECK_FOR_TIMEOUT(); … … 2022 2004 int cond = (++vPC)->u.operand; 2023 2005 int target = (++vPC)->u.operand; 2024 if (r[cond]. u.jsValue->toBoolean(exec)) {2006 if (r[cond].jsValue()->toBoolean(exec)) { 2025 2007 vPC += target; 2026 2008 NEXT_OPCODE; … … 2038 2020 int cond = (++vPC)->u.operand; 2039 2021 int target = (++vPC)->u.operand; 2040 if (!r[cond]. u.jsValue->toBoolean(exec)) {2022 if (!r[cond].jsValue()->toBoolean(exec)) { 2041 2023 vPC += target; 2042 2024 NEXT_OPCODE; … … 2057 2039 the JS timeout is reached. 2058 2040 */ 2059 JSValue* src1 = r[(++vPC)->u.operand]. u.jsValue;2060 JSValue* src2 = r[(++vPC)->u.operand]. u.jsValue;2041 JSValue* src1 = r[(++vPC)->u.operand].jsValue(); 2042 JSValue* src2 = r[(++vPC)->u.operand].jsValue(); 2061 2043 int target = (++vPC)->u.operand; 2062 2044 … … 2081 2063 result of the comparison is true. 2082 2064 */ 2083 JSValue* src1 = r[(++vPC)->u.operand]. u.jsValue;2084 JSValue* src2 = r[(++vPC)->u.operand]. u.jsValue;2065 JSValue* src1 = r[(++vPC)->u.operand].jsValue(); 2066 JSValue* src2 = r[(++vPC)->u.operand].jsValue(); 2085 2067 int target = (++vPC)->u.operand; 2086 2068 … … 2104 2086 result of the comparison is false. 2105 2087 */ 2106 JSValue* src1 = r[(++vPC)->u.operand]. u.jsValue;2107 JSValue* src2 = r[(++vPC)->u.operand]. u.jsValue;2088 JSValue* src1 = r[(++vPC)->u.operand].jsValue(); 2089 JSValue* src2 = r[(++vPC)->u.operand].jsValue(); 2108 2090 int target = (++vPC)->u.operand; 2109 2091 … … 2130 2112 int func = (++vPC)->u.operand; 2131 2113 2132 r[dst] .u.jsValue= codeBlock->functions[func]->makeFunction(exec, scopeChain);2114 r[dst] = codeBlock->functions[func]->makeFunction(exec, scopeChain); 2133 2115 2134 2116 ++vPC; … … 2146 2128 int func = (++vPC)->u.operand; 2147 2129 2148 r[dst] .u.jsValue= codeBlock->functionExpressions[func]->makeFunction(exec, scopeChain);2130 r[dst] = codeBlock->functionExpressions[func]->makeFunction(exec, scopeChain); 2149 2131 2150 2132 ++vPC; … … 2169 2151 int argCount = (++vPC)->u.operand; 2170 2152 2171 JSValue* funcVal = r[func]. u.jsValue;2172 JSValue* baseVal = r[thisVal]. u.jsValue;2153 JSValue* funcVal = r[func].jsValue(); 2154 JSValue* baseVal = r[thisVal].jsValue(); 2173 2155 2174 2156 if (baseVal == scopeChain->globalObject() && funcVal == scopeChain->globalObject()->evalFunction()) { 2175 JSObject* thisObject = r[codeBlock->thisRegister].u.jsObject;2157 JSObject* thisObject = static_cast<JSObject*>(r[codeBlock->thisRegister].jsValue()); 2176 2158 JSValue* result = callEval(exec, thisObject, scopeChain, registerFile, r, firstArg, argCount, exceptionValue); 2177 2159 if (exceptionValue) 2178 2160 goto vm_throw; 2179 2161 2180 r[dst] .u.jsValue= result;2162 r[dst] = result; 2181 2163 2182 2164 ++vPC; … … 2188 2170 // value. 2189 2171 vPC -= 5; 2190 r[thisVal] .u.jsValue= baseVal->toThisObject(exec);2172 r[thisVal] = baseVal->toThisObject(exec); 2191 2173 2192 2174 #if HAVE(COMPUTED_GOTO) … … 2241 2223 int argCount = (++vPC)->u.operand; 2242 2224 2243 JSValue* v = r[func]. u.jsValue;2225 JSValue* v = r[func].jsValue(); 2244 2226 2245 2227 CallData callData; … … 2254 2236 CodeBlock* newCodeBlock = &functionBodyNode->code(callDataScopeChain); 2255 2237 2256 r[firstArg] .u.jsValue = thisVal == missingThisObjectMarker() ? exec->globalThisValue() : r[thisVal].u.jsValue;2238 r[firstArg] = thisVal == missingThisObjectMarker() ? exec->globalThisValue() : r[thisVal].jsValue(); 2257 2239 2258 2240 Register* callFrame = r + firstArg - RegisterFile::CallFrameHeaderSize; … … 2266 2248 codeBlock = newCodeBlock; 2267 2249 setScopeChain(exec, scopeChain, scopeChainForCall(exec, functionBodyNode, codeBlock, callDataScopeChain, r)); 2268 k = codeBlock-> jsValues.data();2250 k = codeBlock->registers.data(); 2269 2251 vPC = codeBlock->instructions.begin(); 2270 2252 … … 2280 2262 (*enabledProfilerReference)->willExecute(exec, static_cast<JSObject*>(v)); 2281 2263 2282 JSValue* thisValue = thisVal == missingThisObjectMarker() ? exec->globalThisValue() : r[thisVal]. u.jsValue;2283 ArgList args(r einterpret_cast<JSValue**>(r)+ firstArg + 1, argCount - 1);2264 JSValue* thisValue = thisVal == missingThisObjectMarker() ? exec->globalThisValue() : r[thisVal].jsValue(); 2265 ArgList args(r + firstArg + 1, argCount - 1); 2284 2266 2285 2267 JSValue* returnValue = callData.native.function(exec, static_cast<JSObject*>(v), thisValue, args); 2286 2268 VM_CHECK_EXCEPTION(); 2287 2269 2288 r[dst] .u.jsValue= returnValue;2270 r[dst] = returnValue; 2289 2271 2290 2272 if (*enabledProfilerReference) … … 2313 2295 2314 2296 Register* callFrame = r - codeBlock->numLocals - RegisterFile::CallFrameHeaderSize; 2315 if (JSActivation* activation = static_cast<JSActivation*>(callFrame[RegisterFile::OptionalCalleeActivation]. u.jsValue)) {2297 if (JSActivation* activation = static_cast<JSActivation*>(callFrame[RegisterFile::OptionalCalleeActivation].jsValue())) { 2316 2298 ASSERT(!codeBlock->needsFullScopeChain || scopeChain->object == activation); 2317 2299 ASSERT(activation->isActivationObject()); … … 2320 2302 2321 2303 if (*enabledProfilerReference) 2322 (*enabledProfilerReference)->didExecute(exec, callFrame[RegisterFile::Callee].u.jsObject);2304 (*enabledProfilerReference)->didExecute(exec, static_cast<JSObject*>(callFrame[RegisterFile::Callee].jsValue())); 2323 2305 2324 2306 if (codeBlock->needsFullScopeChain) 2325 2307 scopeChain->deref(); 2326 2308 2327 JSValue* returnValue = r[result]. u.jsValue;2328 if (callFrame[RegisterFile::CalledAsConstructor]. u.i&& !returnValue->isObject()) {2329 JSValue* thisObject = callFrame[RegisterFile::CallFrameHeaderSize]. u.jsValue;2309 JSValue* returnValue = r[result].jsValue(); 2310 if (callFrame[RegisterFile::CalledAsConstructor].i() && !returnValue->isObject()) { 2311 JSValue* thisObject = callFrame[RegisterFile::CallFrameHeaderSize].jsValue(); 2330 2312 returnValue = thisObject; 2331 2313 } 2332 2314 2333 codeBlock = callFrame[RegisterFile::CallerCodeBlock]. u.codeBlock;2315 codeBlock = callFrame[RegisterFile::CallerCodeBlock].codeBlock(); 2334 2316 if (!codeBlock) 2335 2317 return returnValue; 2336 2318 2337 k = codeBlock-> jsValues.data();2338 vPC = callFrame[RegisterFile::ReturnVPC]. u.vPC;2339 setScopeChain(exec, scopeChain, callFrame[RegisterFile::CallerScopeChain]. u.scopeChain);2340 r = callFrame[RegisterFile::CallerRegisters]. u.r;2319 k = codeBlock->registers.data(); 2320 vPC = callFrame[RegisterFile::ReturnVPC].vPC(); 2321 setScopeChain(exec, scopeChain, callFrame[RegisterFile::CallerScopeChain].scopeChain()); 2322 r = callFrame[RegisterFile::CallerRegisters].r(); 2341 2323 exec->m_callFrame = r - codeBlock->numLocals - RegisterFile::CallFrameHeaderSize; 2342 int dst = callFrame[RegisterFile::ReturnValueRegister]. u.i;2343 r[dst] .u.jsValue= returnValue;2324 int dst = callFrame[RegisterFile::ReturnValueRegister].i(); 2325 r[dst] = returnValue; 2344 2326 2345 2327 NEXT_OPCODE; … … 2361 2343 int argCount = (++vPC)->u.operand; 2362 2344 2363 JSValue* constrVal = r[constr]. u.jsValue;2345 JSValue* constrVal = r[constr].jsValue(); 2364 2346 2365 2347 ConstructData constructData; … … 2385 2367 CodeBlock* newCodeBlock = &functionBodyNode->code(callDataScopeChain); 2386 2368 2387 r[firstArg] .u.jsValue= newObject; // "this" value2369 r[firstArg] = newObject; // "this" value 2388 2370 2389 2371 Register* callFrame = r + firstArg - RegisterFile::CallFrameHeaderSize; … … 2397 2379 codeBlock = newCodeBlock; 2398 2380 setScopeChain(exec, scopeChain, scopeChainForCall(exec, functionBodyNode, codeBlock, callDataScopeChain, r)); 2399 k = codeBlock-> jsValues.data();2381 k = codeBlock->registers.data(); 2400 2382 vPC = codeBlock->instructions.begin(); 2401 2383 … … 2407 2389 (*enabledProfilerReference)->willExecute(exec, constructor); 2408 2390 2409 ArgList args(r einterpret_cast<JSValue**>(r)+ firstArg + 1, argCount - 1);2391 ArgList args(r + firstArg + 1, argCount - 1); 2410 2392 JSValue* returnValue = constructData.native.function(exec, constructor, args); 2411 2393 2412 2394 VM_CHECK_EXCEPTION(); 2413 r[dst] .u.jsValue= returnValue;2395 r[dst] = returnValue; 2414 2396 2415 2397 if (*enabledProfilerReference) … … 2432 2414 */ 2433 2415 int scope = (++vPC)->u.operand; 2434 JSValue* v = r[scope]. u.jsValue;2416 JSValue* v = r[scope].jsValue(); 2435 2417 JSObject* o = v->toObject(exec); 2436 2418 VM_CHECK_EXCEPTION(); … … 2462 2444 int base = (++vPC)->u.operand; 2463 2445 2464 r[dst] .u.jsPropertyNameIterator = JSPropertyNameIterator::create(exec, r[base].u.jsValue);2446 r[dst] = JSPropertyNameIterator::create(exec, r[base].jsValue()); 2465 2447 ++vPC; 2466 2448 NEXT_OPCODE; … … 2479 2461 int target = (++vPC)->u.operand; 2480 2462 2481 JSPropertyNameIterator* it = r[iter]. u.jsPropertyNameIterator;2463 JSPropertyNameIterator* it = r[iter].jsPropertyNameIterator(); 2482 2464 if (JSValue* temp = it->next(exec)) { 2483 2465 CHECK_FOR_TIMEOUT(); 2484 r[dst] .u.jsValue= temp;2466 r[dst] = temp; 2485 2467 vPC += target; 2486 2468 NEXT_OPCODE; … … 2519 2501 ASSERT(!exec->hadException()); 2520 2502 int ex = (++vPC)->u.operand; 2521 r[ex] .u.jsValue= exceptionValue;2503 r[ex] = exceptionValue; 2522 2504 exceptionValue = 0; 2523 2505 … … 2537 2519 2538 2520 int ex = (++vPC)->u.operand; 2539 exceptionValue = r[ex]. u.jsValue;2521 exceptionValue = r[ex].jsValue(); 2540 2522 handlerVPC = throwException(exec, exceptionValue, vPC, codeBlock, k, scopeChain, r); 2541 2523 if (!handlerVPC) { … … 2568 2550 int message = (++vPC)->u.operand; 2569 2551 2570 r[dst] .u.jsValue = Error::create(exec, (ErrorType)type, k[message]->toString(exec), codeBlock->lineNumberForVPC(vPC), codeBlock->ownerNode->sourceId(), codeBlock->ownerNode->sourceURL());2552 r[dst] = Error::create(exec, (ErrorType)type, k[message].toString(exec), codeBlock->lineNumberForVPC(vPC), codeBlock->ownerNode->sourceId(), codeBlock->ownerNode->sourceURL()); 2571 2553 2572 2554 ++vPC; … … 2585 2567 } 2586 2568 int result = (++vPC)->u.operand; 2587 return r[result]. u.jsValue;2569 return r[result].jsValue(); 2588 2570 } 2589 2571 BEGIN_OPCODE(op_put_getter) { … … 2602 2584 int function = (++vPC)->u.operand; 2603 2585 2604 ASSERT(r[base]. u.jsValue->isObject());2605 JSObject* baseObj = static_cast<JSObject*>(r[base]. u.jsValue);2586 ASSERT(r[base].jsValue()->isObject()); 2587 JSObject* baseObj = static_cast<JSObject*>(r[base].jsValue()); 2606 2588 Identifier& ident = codeBlock->identifiers[property]; 2607 ASSERT(r[function]. u.jsValue->isObject());2608 baseObj->defineGetter(exec, ident, static_cast<JSObject* >(r[function].u.jsValue));2589 ASSERT(r[function].jsValue()->isObject()); 2590 baseObj->defineGetter(exec, ident, static_cast<JSObject*>(r[function].jsValue())); 2609 2591 2610 2592 ++vPC; … … 2626 2608 int function = (++vPC)->u.operand; 2627 2609 2628 ASSERT(r[base]. u.jsValue->isObject());2629 JSObject* baseObj = static_cast<JSObject*>(r[base]. u.jsValue);2610 ASSERT(r[base].jsValue()->isObject()); 2611 JSObject* baseObj = static_cast<JSObject*>(r[base].jsValue()); 2630 2612 Identifier& ident = codeBlock->identifiers[property]; 2631 ASSERT(r[function]. u.jsValue->isObject());2632 baseObj->defineSetter(exec, ident, static_cast<JSObject* >(r[function].u.jsValue));2613 ASSERT(r[function].jsValue()->isObject()); 2614 baseObj->defineSetter(exec, ident, static_cast<JSObject*>(r[function].jsValue())); 2633 2615 2634 2616 ++vPC; … … 2643 2625 int retAddrDst = (++vPC)->u.operand; 2644 2626 int target = (++vPC)->u.operand; 2645 r[retAddrDst] .u.vPC= vPC + 1;2627 r[retAddrDst] = vPC + 1; 2646 2628 2647 2629 vPC += target; … … 2656 2638 */ 2657 2639 int retAddrSrc = (++vPC)->u.operand; 2658 vPC = r[retAddrSrc]. u.vPC;2640 vPC = r[retAddrSrc].vPC(); 2659 2641 NEXT_OPCODE; 2660 2642 } … … 2698 2680 return jsNull(); 2699 2681 2700 JSActivation* activation = static_cast<JSActivation*>(callFrame[RegisterFile::OptionalCalleeActivation]. u.jsValue);2682 JSActivation* activation = static_cast<JSActivation*>(callFrame[RegisterFile::OptionalCalleeActivation].jsValue()); 2701 2683 if (!activation) { 2702 2684 CodeBlock* codeBlock = &function->m_body->generatedCode(); 2703 2685 activation = new (exec) JSActivation(function->m_body, callFrame + RegisterFile::CallFrameHeaderSize + codeBlock->numLocals); 2704 callFrame[RegisterFile::OptionalCalleeActivation] .u.jsValue= activation;2686 callFrame[RegisterFile::OptionalCalleeActivation] = activation; 2705 2687 } 2706 2688 … … 2714 2696 return jsNull(); 2715 2697 2716 CodeBlock* callerCodeBlock = callFrame[RegisterFile::CallerCodeBlock]. u.codeBlock;2698 CodeBlock* callerCodeBlock = callFrame[RegisterFile::CallerCodeBlock].codeBlock(); 2717 2699 if (!callerCodeBlock) 2718 2700 return jsNull(); 2719 2701 2720 Register* callerCallFrame = callFrame[RegisterFile::CallerRegisters]. u.r- callerCodeBlock->numLocals - RegisterFile::CallFrameHeaderSize;2721 if (JSValue* caller = callerCallFrame[RegisterFile::Callee]. u.jsValue)2702 Register* callerCallFrame = callFrame[RegisterFile::CallerRegisters].r() - callerCodeBlock->numLocals - RegisterFile::CallFrameHeaderSize; 2703 if (JSValue* caller = callerCallFrame[RegisterFile::Callee].jsValue()) 2722 2704 return caller; 2723 2705 … … 2737 2719 } 2738 2720 2739 if (callFrame[RegisterFile::Callee]. u.jsValue== function)2721 if (callFrame[RegisterFile::Callee].jsValue() == function) 2740 2722 return callFrame; 2741 2723 2742 CodeBlock* callerCodeBlock = callFrame[RegisterFile::CallerCodeBlock]. u.codeBlock;2724 CodeBlock* callerCodeBlock = callFrame[RegisterFile::CallerCodeBlock].codeBlock(); 2743 2725 if (!callerCodeBlock) { 2744 2726 callFrame = 0; … … 2746 2728 } 2747 2729 2748 callFrame = callFrame[RegisterFile::CallerRegisters]. u.r- callerCodeBlock->numLocals - RegisterFile::CallFrameHeaderSize;2730 callFrame = callFrame[RegisterFile::CallerRegisters].r() - callerCodeBlock->numLocals - RegisterFile::CallFrameHeaderSize; 2749 2731 } 2750 2732 } … … 2752 2734 void Machine::getArgumentsData(Register* callFrame, JSFunction*& function, Register*& argv, int& argc) 2753 2735 { 2754 function = static_cast<JSFunction*>(callFrame[RegisterFile::Callee]. u.jsValue);2736 function = static_cast<JSFunction*>(callFrame[RegisterFile::Callee].jsValue()); 2755 2737 ASSERT(function->inherits(&JSFunction::info)); 2756 2738 2757 argv = callFrame[RegisterFile::CallerRegisters]. u.r + callFrame[RegisterFile::ArgumentStartRegister].u.i+ 1; // + 1 to skip "this"2758 argc = callFrame[RegisterFile::ArgumentCount]. u.i- 1; // - 1 to skip "this"2739 argv = callFrame[RegisterFile::CallerRegisters].r() + callFrame[RegisterFile::ArgumentStartRegister].i() + 1; // + 1 to skip "this" 2740 argc = callFrame[RegisterFile::ArgumentCount].i() - 1; // - 1 to skip "this" 2759 2741 } 2760 2742
