Changeset 38461 in webkit
- Timestamp:
- Nov 16, 2008, 5:48:55 PM (17 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r38457 r38461 1 2008-11-16 Geoffrey Garen <[email protected]> 2 3 Reviewed by Sam Weinig. 4 5 A few more renames: 6 7 BytecodeInterpreter => Interpreter 8 WREC => JSC::WREC, removing JSC:: prefix in a lot of places 9 X86Assembler::copy => X86Assembler::executableCopy 10 AssemblerBuffer::copy => AssemblerBuffer::executableCopy 11 WRECFunction => WREC::RegExpFunction 12 OBJECT_OFFSET => FIELD_OFFSET 13 14 Also: 15 16 Nixed use of OBJECT_OFFSET outside of CTI.cpp by making CTI a friend in more places. 17 Nixed X86:: and X86Assembler:: prefixes in a lot of places using typedefs 18 19 * JavaScriptCore.exp: 20 * VM/CTI.cpp: 21 (JSC::): 22 (JSC::CTI::emitGetVirtualRegister): 23 (JSC::CTI::emitGetVirtualRegisters): 24 (JSC::CTI::emitPutCTIArgFromVirtualRegister): 25 (JSC::CTI::emitPutCTIArg): 26 (JSC::CTI::emitGetCTIArg): 27 (JSC::CTI::emitPutCTIParam): 28 (JSC::CTI::emitGetCTIParam): 29 (JSC::CTI::emitPutToCallFrameHeader): 30 (JSC::CTI::emitGetFromCallFrameHeader): 31 (JSC::CTI::emitPutVirtualRegister): 32 (JSC::CTI::emitNakedCall): 33 (JSC::CTI::emitNakedFastCall): 34 (JSC::CTI::emitCTICall): 35 (JSC::CTI::emitJumpSlowCaseIfNotJSCell): 36 (JSC::CTI::emitJumpSlowCaseIfNotImmNum): 37 (JSC::CTI::emitJumpSlowCaseIfNotImmNums): 38 (JSC::CTI::emitFastArithDeTagImmediate): 39 (JSC::CTI::emitFastArithDeTagImmediateJumpIfZero): 40 (JSC::CTI::emitFastArithReTagImmediate): 41 (JSC::CTI::emitFastArithPotentiallyReTagImmediate): 42 (JSC::CTI::emitFastArithImmToInt): 43 (JSC::CTI::emitFastArithIntToImmOrSlowCase): 44 (JSC::CTI::emitFastArithIntToImmNoCheck): 45 (JSC::CTI::emitArithIntToImmWithJump): 46 (JSC::CTI::emitTagAsBoolImmediate): 47 (JSC::CTI::compileOpCallInitializeCallFrame): 48 (JSC::CTI::compileOpCall): 49 (JSC::CTI::compileOpStrictEq): 50 (JSC::CTI::emitSlowScriptCheck): 51 (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate): 52 (JSC::CTI::compileBinaryArithOp): 53 (JSC::CTI::compileBinaryArithOpSlowCase): 54 (JSC::CTI::privateCompileMainPass): 55 (JSC::CTI::privateCompileSlowCases): 56 (JSC::CTI::privateCompile): 57 (JSC::CTI::privateCompileGetByIdSelf): 58 (JSC::CTI::privateCompileGetByIdProto): 59 (JSC::CTI::privateCompileGetByIdChain): 60 (JSC::CTI::privateCompilePutByIdReplace): 61 (JSC::CTI::privateCompilePutByIdTransition): 62 (JSC::CTI::privateCompileCTIMachineTrampolines): 63 (JSC::CTI::freeCTIMachineTrampolines): 64 (JSC::CTI::patchGetByIdSelf): 65 (JSC::CTI::patchPutByIdReplace): 66 (JSC::CTI::privateCompilePatchGetArrayLength): 67 (JSC::CTI::emitGetVariableObjectRegister): 68 (JSC::CTI::emitPutVariableObjectRegister): 69 * VM/CTI.h: 70 (JSC::CallRecord::CallRecord): 71 (JSC::JmpTable::JmpTable): 72 (JSC::SlowCaseEntry::SlowCaseEntry): 73 (JSC::CTI::JSRInfo::JSRInfo): 74 * VM/CodeBlock.cpp: 75 (JSC::CodeBlock::printStructures): 76 (JSC::CodeBlock::derefStructures): 77 (JSC::CodeBlock::refStructures): 78 * VM/Machine.cpp: 79 (JSC::jsLess): 80 (JSC::jsLessEq): 81 (JSC::Interpreter::resolve): 82 (JSC::Interpreter::resolveSkip): 83 (JSC::Interpreter::resolveGlobal): 84 (JSC::Interpreter::resolveBase): 85 (JSC::Interpreter::resolveBaseAndProperty): 86 (JSC::Interpreter::resolveBaseAndFunc): 87 (JSC::Interpreter::slideRegisterWindowForCall): 88 (JSC::Interpreter::callEval): 89 (JSC::Interpreter::Interpreter): 90 (JSC::Interpreter::initialize): 91 (JSC::Interpreter::~Interpreter): 92 (JSC::Interpreter::dumpCallFrame): 93 (JSC::Interpreter::dumpRegisters): 94 (JSC::Interpreter::isOpcode): 95 (JSC::Interpreter::unwindCallFrame): 96 (JSC::Interpreter::throwException): 97 (JSC::Interpreter::execute): 98 (JSC::Interpreter::debug): 99 (JSC::Interpreter::resetTimeoutCheck): 100 (JSC::Interpreter::checkTimeout): 101 (JSC::Interpreter::createExceptionScope): 102 (JSC::Interpreter::tryCachePutByID): 103 (JSC::Interpreter::uncachePutByID): 104 (JSC::Interpreter::tryCacheGetByID): 105 (JSC::Interpreter::uncacheGetByID): 106 (JSC::Interpreter::privateExecute): 107 (JSC::Interpreter::retrieveArguments): 108 (JSC::Interpreter::retrieveCaller): 109 (JSC::Interpreter::retrieveLastCaller): 110 (JSC::Interpreter::findFunctionCallFrame): 111 (JSC::Interpreter::tryCTICachePutByID): 112 (JSC::Interpreter::tryCTICacheGetByID): 113 (JSC::): 114 (JSC::Interpreter::cti_op_convert_this): 115 (JSC::Interpreter::cti_op_end): 116 (JSC::Interpreter::cti_op_add): 117 (JSC::Interpreter::cti_op_pre_inc): 118 (JSC::Interpreter::cti_timeout_check): 119 (JSC::Interpreter::cti_register_file_check): 120 (JSC::Interpreter::cti_op_loop_if_less): 121 (JSC::Interpreter::cti_op_loop_if_lesseq): 122 (JSC::Interpreter::cti_op_new_object): 123 (JSC::Interpreter::cti_op_put_by_id): 124 (JSC::Interpreter::cti_op_put_by_id_second): 125 (JSC::Interpreter::cti_op_put_by_id_generic): 126 (JSC::Interpreter::cti_op_put_by_id_fail): 127 (JSC::Interpreter::cti_op_get_by_id): 128 (JSC::Interpreter::cti_op_get_by_id_second): 129 (JSC::Interpreter::cti_op_get_by_id_generic): 130 (JSC::Interpreter::cti_op_get_by_id_fail): 131 (JSC::Interpreter::cti_op_instanceof): 132 (JSC::Interpreter::cti_op_del_by_id): 133 (JSC::Interpreter::cti_op_mul): 134 (JSC::Interpreter::cti_op_new_func): 135 (JSC::Interpreter::cti_op_call_JSFunction): 136 (JSC::Interpreter::cti_op_call_arityCheck): 137 (JSC::Interpreter::cti_vm_dontLazyLinkCall): 138 (JSC::Interpreter::cti_vm_lazyLinkCall): 139 (JSC::Interpreter::cti_op_push_activation): 140 (JSC::Interpreter::cti_op_call_NotJSFunction): 141 (JSC::Interpreter::cti_op_create_arguments): 142 (JSC::Interpreter::cti_op_create_arguments_no_params): 143 (JSC::Interpreter::cti_op_tear_off_activation): 144 (JSC::Interpreter::cti_op_tear_off_arguments): 145 (JSC::Interpreter::cti_op_profile_will_call): 146 (JSC::Interpreter::cti_op_profile_did_call): 147 (JSC::Interpreter::cti_op_ret_scopeChain): 148 (JSC::Interpreter::cti_op_new_array): 149 (JSC::Interpreter::cti_op_resolve): 150 (JSC::Interpreter::cti_op_construct_JSConstruct): 151 (JSC::Interpreter::cti_op_construct_NotJSConstruct): 152 (JSC::Interpreter::cti_op_get_by_val): 153 (JSC::Interpreter::cti_op_resolve_func): 154 (JSC::Interpreter::cti_op_sub): 155 (JSC::Interpreter::cti_op_put_by_val): 156 (JSC::Interpreter::cti_op_put_by_val_array): 157 (JSC::Interpreter::cti_op_lesseq): 158 (JSC::Interpreter::cti_op_loop_if_true): 159 (JSC::Interpreter::cti_op_negate): 160 (JSC::Interpreter::cti_op_resolve_base): 161 (JSC::Interpreter::cti_op_resolve_skip): 162 (JSC::Interpreter::cti_op_resolve_global): 163 (JSC::Interpreter::cti_op_div): 164 (JSC::Interpreter::cti_op_pre_dec): 165 (JSC::Interpreter::cti_op_jless): 166 (JSC::Interpreter::cti_op_not): 167 (JSC::Interpreter::cti_op_jtrue): 168 (JSC::Interpreter::cti_op_post_inc): 169 (JSC::Interpreter::cti_op_eq): 170 (JSC::Interpreter::cti_op_lshift): 171 (JSC::Interpreter::cti_op_bitand): 172 (JSC::Interpreter::cti_op_rshift): 173 (JSC::Interpreter::cti_op_bitnot): 174 (JSC::Interpreter::cti_op_resolve_with_base): 175 (JSC::Interpreter::cti_op_new_func_exp): 176 (JSC::Interpreter::cti_op_mod): 177 (JSC::Interpreter::cti_op_less): 178 (JSC::Interpreter::cti_op_neq): 179 (JSC::Interpreter::cti_op_post_dec): 180 (JSC::Interpreter::cti_op_urshift): 181 (JSC::Interpreter::cti_op_bitxor): 182 (JSC::Interpreter::cti_op_new_regexp): 183 (JSC::Interpreter::cti_op_bitor): 184 (JSC::Interpreter::cti_op_call_eval): 185 (JSC::Interpreter::cti_op_throw): 186 (JSC::Interpreter::cti_op_get_pnames): 187 (JSC::Interpreter::cti_op_next_pname): 188 (JSC::Interpreter::cti_op_push_scope): 189 (JSC::Interpreter::cti_op_pop_scope): 190 (JSC::Interpreter::cti_op_typeof): 191 (JSC::Interpreter::cti_op_is_undefined): 192 (JSC::Interpreter::cti_op_is_boolean): 193 (JSC::Interpreter::cti_op_is_number): 194 (JSC::Interpreter::cti_op_is_string): 195 (JSC::Interpreter::cti_op_is_object): 196 (JSC::Interpreter::cti_op_is_function): 197 (JSC::Interpreter::cti_op_stricteq): 198 (JSC::Interpreter::cti_op_nstricteq): 199 (JSC::Interpreter::cti_op_to_jsnumber): 200 (JSC::Interpreter::cti_op_in): 201 (JSC::Interpreter::cti_op_push_new_scope): 202 (JSC::Interpreter::cti_op_jmp_scopes): 203 (JSC::Interpreter::cti_op_put_by_index): 204 (JSC::Interpreter::cti_op_switch_imm): 205 (JSC::Interpreter::cti_op_switch_char): 206 (JSC::Interpreter::cti_op_switch_string): 207 (JSC::Interpreter::cti_op_del_by_val): 208 (JSC::Interpreter::cti_op_put_getter): 209 (JSC::Interpreter::cti_op_put_setter): 210 (JSC::Interpreter::cti_op_new_error): 211 (JSC::Interpreter::cti_op_debug): 212 (JSC::Interpreter::cti_vm_throw): 213 * VM/Machine.h: 214 * VM/Register.h: 215 * VM/SamplingTool.cpp: 216 (JSC::SamplingTool::dump): 217 * VM/SamplingTool.h: 218 (JSC::SamplingTool::SamplingTool): 219 * bytecompiler/CodeGenerator.cpp: 220 (JSC::BytecodeGenerator::generate): 221 (JSC::BytecodeGenerator::BytecodeGenerator): 222 * jsc.cpp: 223 (runWithScripts): 224 * masm/X86Assembler.h: 225 (JSC::AssemblerBuffer::executableCopy): 226 (JSC::X86Assembler::executableCopy): 227 * runtime/ExecState.h: 228 (JSC::ExecState::interpreter): 229 * runtime/JSCell.h: 230 * runtime/JSFunction.h: 231 * runtime/JSGlobalData.cpp: 232 (JSC::JSGlobalData::JSGlobalData): 233 * runtime/JSGlobalData.h: 234 * runtime/JSImmediate.h: 235 * runtime/JSString.h: 236 * runtime/JSValue.h: 237 * runtime/JSVariableObject.h: 238 * runtime/RegExp.cpp: 239 (JSC::RegExp::RegExp): 240 (JSC::RegExp::~RegExp): 241 (JSC::RegExp::match): 242 * runtime/RegExp.h: 243 * wrec/CharacterClassConstructor.cpp: 244 * wrec/CharacterClassConstructor.h: 245 * wrec/WREC.cpp: 246 (JSC::WREC::compileRegExp): 247 * wrec/WREC.h: 248 (JSC::WREC::Generator::Generator): 249 (JSC::WREC::Parser::): 250 (JSC::WREC::Parser::Parser): 251 (JSC::WREC::Parser::parseAlternative): 252 1 253 2008-11-16 Greg Bolsinga <[email protected]> 2 254 -
trunk/JavaScriptCore/JavaScriptCore.exp
r38444 r38461 300 300 __ZN3WTF8CollatorD1Ev 301 301 __ZN3WTF8fastFreeEPv 302 __ZNK3JSC11Interpreter14retrieveCallerEPNS_9ExecStateEPNS_16InternalFunctionE 303 __ZNK3JSC11Interpreter18retrieveLastCallerEPNS_9ExecStateERiRlRNS_7UStringERPNS_7JSValueE 302 304 __ZNK3JSC12DateInstance7getTimeERdRi 303 305 __ZNK3JSC12StringObject12toThisStringEPNS_9ExecStateE … … 312 314 __ZNK3JSC17DebuggerCallFrame4typeEv 313 315 __ZNK3JSC17DebuggerCallFrame8evaluateERKNS_7UStringERPNS_7JSValueE 314 __ZNK3JSC19BytecodeInterpreter14retrieveCallerEPNS_9ExecStateEPNS_16InternalFunctionE315 __ZNK3JSC19BytecodeInterpreter18retrieveLastCallerEPNS_9ExecStateERiRlRNS_7UStringERPNS_7JSValueE316 316 __ZNK3JSC6JSCell12toThisObjectEPNS_9ExecStateE 317 317 __ZNK3JSC6JSCell12toThisStringEPNS_9ExecStateE -
trunk/JavaScriptCore/VM/CTI.cpp
r38440 r38461 41 41 #endif 42 42 43 // FIELD_OFFSET: A clone of the C++ "offsetof" macro that can be used with classes, 44 // at the expense of some type safety. 45 // The magic number 0x4000 here has no significance. We use it to avoid using NULL, 46 // because NULL can have unexpected compiler effects, particularly in cases of 47 // multiple inheritance. 48 #define FIELD_OFFSET(class, member) (reinterpret_cast<ptrdiff_t>(&(reinterpret_cast<class*>(0x4000)->member)) - 0x4000) 49 43 50 #define __ m_assembler. 44 51 … … 46 53 47 54 namespace JSC { 55 56 typedef X86Assembler::JmpSrc JmpSrc; 48 57 49 58 #if PLATFORM(MAC) … … 120 129 "movl %esp, 0(%esp)" "\n" 121 130 #endif 122 "call " SYMBOL_STRING(_ZN3JSC1 9BytecodeInterpreter12cti_vm_throwEPPv) "\n"131 "call " SYMBOL_STRING(_ZN3JSC11Interpreter12cti_vm_throwEPPv) "\n" 123 132 #else 124 "call " SYMBOL_STRING(_ZN3JSC1 9BytecodeInterpreter12cti_vm_throwEPvz) "\n"133 "call " SYMBOL_STRING(_ZN3JSC11Interpreter12cti_vm_throwEPvz) "\n" 125 134 #endif 126 135 "addl $0x20, %esp" "\n" … … 158 167 __asm { 159 168 mov ecx, esp; 160 call JSC:: BytecodeInterpreter::cti_vm_throw;169 call JSC::Interpreter::cti_vm_throw; 161 170 add esp, 0x20; 162 171 pop ebx; … … 182 191 183 192 // get arg puts an arg from the SF register array into a h/w register 184 ALWAYS_INLINE void CTI::emitGetVirtualRegister(int src, X86Assembler::RegisterID dst, unsigned currentInstructionIndex)193 ALWAYS_INLINE void CTI::emitGetVirtualRegister(int src, RegisterID dst, unsigned currentInstructionIndex) 185 194 { 186 195 // TODO: we want to reuse values that are already in registers if we can - add a register allocator! … … 213 222 } 214 223 215 ALWAYS_INLINE void CTI::emitGetVirtualRegisters(int src1, X86Assembler::RegisterID dst1, int src2, X86Assembler::RegisterID dst2, unsigned i)224 ALWAYS_INLINE void CTI::emitGetVirtualRegisters(int src1, RegisterID dst1, int src2, RegisterID dst2, unsigned i) 216 225 { 217 226 if (src2 == m_lastResultBytecodeRegister) { … … 225 234 226 235 // get arg puts an arg from the SF register array onto the stack, as an arg to a context threaded function. 227 ALWAYS_INLINE void CTI::emitPutCTIArgFromVirtualRegister(unsigned src, unsigned offset, X86Assembler::RegisterID scratch)236 ALWAYS_INLINE void CTI::emitPutCTIArgFromVirtualRegister(unsigned src, unsigned offset, RegisterID scratch) 228 237 { 229 238 if (m_codeBlock->isConstantRegisterIndex(src)) { … … 239 248 240 249 // puts an arg onto the stack, as an arg to a context threaded function. 241 ALWAYS_INLINE void CTI::emitPutCTIArg( X86Assembler::RegisterID src, unsigned offset)250 ALWAYS_INLINE void CTI::emitPutCTIArg(RegisterID src, unsigned offset) 242 251 { 243 252 __ movl_rm(src, offset + sizeof(void*), X86::esp); 244 253 } 245 254 246 ALWAYS_INLINE void CTI::emitGetCTIArg(unsigned offset, X86Assembler::RegisterID dst)255 ALWAYS_INLINE void CTI::emitGetCTIArg(unsigned offset, RegisterID dst) 247 256 { 248 257 __ movl_mr(offset + sizeof(void*), X86::esp, dst); … … 269 278 } 270 279 271 ALWAYS_INLINE void CTI::emitPutCTIParam( X86Assembler::RegisterID from, unsigned name)280 ALWAYS_INLINE void CTI::emitPutCTIParam(RegisterID from, unsigned name) 272 281 { 273 282 __ movl_rm(from, name * sizeof(void*), X86::esp); 274 283 } 275 284 276 ALWAYS_INLINE void CTI::emitGetCTIParam(unsigned name, X86Assembler::RegisterID to)285 ALWAYS_INLINE void CTI::emitGetCTIParam(unsigned name, RegisterID to) 277 286 { 278 287 __ movl_mr(name * sizeof(void*), X86::esp, to); … … 280 289 } 281 290 282 ALWAYS_INLINE void CTI::emitPutToCallFrameHeader( X86Assembler::RegisterID from, RegisterFile::CallFrameHeaderEntry entry)291 ALWAYS_INLINE void CTI::emitPutToCallFrameHeader(RegisterID from, RegisterFile::CallFrameHeaderEntry entry) 283 292 { 284 293 __ movl_rm(from, entry * sizeof(Register), X86::edi); 285 294 } 286 295 287 ALWAYS_INLINE void CTI::emitGetFromCallFrameHeader(RegisterFile::CallFrameHeaderEntry entry, X86Assembler::RegisterID to)296 ALWAYS_INLINE void CTI::emitGetFromCallFrameHeader(RegisterFile::CallFrameHeaderEntry entry, RegisterID to) 288 297 { 289 298 __ movl_mr(entry * sizeof(Register), X86::edi, to); … … 291 300 } 292 301 293 ALWAYS_INLINE void CTI::emitPutVirtualRegister(unsigned dst, X86Assembler::RegisterID from)302 ALWAYS_INLINE void CTI::emitPutVirtualRegister(unsigned dst, RegisterID from) 294 303 { 295 304 __ movl_rm(from, dst * sizeof(Register), X86::edi); … … 366 375 } 367 376 368 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitNakedCall(unsigned bytecodeIndex, X86::RegisterID r)369 { 370 X86Assembler::JmpSrc call = __ emitCall(r);377 ALWAYS_INLINE JmpSrc CTI::emitNakedCall(unsigned bytecodeIndex, X86::RegisterID r) 378 { 379 JmpSrc call = __ emitCall(r); 371 380 m_calls.append(CallRecord(call, bytecodeIndex)); 372 381 … … 374 383 } 375 384 376 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitNakedCall(unsigned bytecodeIndex, void* function)377 { 378 X86Assembler::JmpSrc call = __ emitCall();385 ALWAYS_INLINE JmpSrc CTI::emitNakedCall(unsigned bytecodeIndex, void* function) 386 { 387 JmpSrc call = __ emitCall(); 379 388 m_calls.append(CallRecord(call, reinterpret_cast<CTIHelper_v>(function), bytecodeIndex)); 380 389 return call; 381 390 } 382 391 383 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitNakedFastCall(unsigned bytecodeIndex, void* function)384 { 385 X86Assembler::JmpSrc call = __ emitCall();392 ALWAYS_INLINE JmpSrc CTI::emitNakedFastCall(unsigned bytecodeIndex, void* function) 393 { 394 JmpSrc call = __ emitCall(); 386 395 m_calls.append(CallRecord(call, reinterpret_cast<CTIHelper_v>(function), bytecodeIndex)); 387 396 return call; 388 397 } 389 398 390 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCTICall(Instruction* vPC, unsigned bytecodeIndex, CTIHelper_j helper)399 ALWAYS_INLINE JmpSrc CTI::emitCTICall(Instruction* vPC, unsigned bytecodeIndex, CTIHelper_j helper) 391 400 { 392 401 #if ENABLE(OPCODE_SAMPLING) … … 397 406 __ emitRestoreArgumentReference(); 398 407 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 399 X86Assembler::JmpSrc call = __ emitCall();408 JmpSrc call = __ emitCall(); 400 409 m_calls.append(CallRecord(call, helper, bytecodeIndex)); 401 410 #if ENABLE(OPCODE_SAMPLING) … … 407 416 } 408 417 409 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCTICall(Instruction* vPC, unsigned bytecodeIndex, CTIHelper_o helper)418 ALWAYS_INLINE JmpSrc CTI::emitCTICall(Instruction* vPC, unsigned bytecodeIndex, CTIHelper_o helper) 410 419 { 411 420 #if ENABLE(OPCODE_SAMPLING) … … 416 425 __ emitRestoreArgumentReference(); 417 426 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 418 X86Assembler::JmpSrc call = __ emitCall();427 JmpSrc call = __ emitCall(); 419 428 m_calls.append(CallRecord(call, helper, bytecodeIndex)); 420 429 #if ENABLE(OPCODE_SAMPLING) … … 426 435 } 427 436 428 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCTICall(Instruction* vPC, unsigned bytecodeIndex, CTIHelper_p helper)437 ALWAYS_INLINE JmpSrc CTI::emitCTICall(Instruction* vPC, unsigned bytecodeIndex, CTIHelper_p helper) 429 438 { 430 439 #if ENABLE(OPCODE_SAMPLING) … … 435 444 __ emitRestoreArgumentReference(); 436 445 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 437 X86Assembler::JmpSrc call = __ emitCall();446 JmpSrc call = __ emitCall(); 438 447 m_calls.append(CallRecord(call, helper, bytecodeIndex)); 439 448 #if ENABLE(OPCODE_SAMPLING) … … 445 454 } 446 455 447 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCTICall(Instruction* vPC, unsigned bytecodeIndex, CTIHelper_b helper)456 ALWAYS_INLINE JmpSrc CTI::emitCTICall(Instruction* vPC, unsigned bytecodeIndex, CTIHelper_b helper) 448 457 { 449 458 #if ENABLE(OPCODE_SAMPLING) … … 454 463 __ emitRestoreArgumentReference(); 455 464 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 456 X86Assembler::JmpSrc call = __ emitCall();465 JmpSrc call = __ emitCall(); 457 466 m_calls.append(CallRecord(call, helper, bytecodeIndex)); 458 467 #if ENABLE(OPCODE_SAMPLING) … … 464 473 } 465 474 466 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCTICall(Instruction* vPC, unsigned bytecodeIndex, CTIHelper_v helper)475 ALWAYS_INLINE JmpSrc CTI::emitCTICall(Instruction* vPC, unsigned bytecodeIndex, CTIHelper_v helper) 467 476 { 468 477 #if ENABLE(OPCODE_SAMPLING) … … 473 482 __ emitRestoreArgumentReference(); 474 483 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 475 X86Assembler::JmpSrc call = __ emitCall();484 JmpSrc call = __ emitCall(); 476 485 m_calls.append(CallRecord(call, helper, bytecodeIndex)); 477 486 #if ENABLE(OPCODE_SAMPLING) … … 483 492 } 484 493 485 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCTICall(Instruction* vPC, unsigned bytecodeIndex, CTIHelper_s helper)494 ALWAYS_INLINE JmpSrc CTI::emitCTICall(Instruction* vPC, unsigned bytecodeIndex, CTIHelper_s helper) 486 495 { 487 496 #if ENABLE(OPCODE_SAMPLING) … … 492 501 __ emitRestoreArgumentReference(); 493 502 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 494 X86Assembler::JmpSrc call = __ emitCall();503 JmpSrc call = __ emitCall(); 495 504 m_calls.append(CallRecord(call, helper, bytecodeIndex)); 496 505 #if ENABLE(OPCODE_SAMPLING) … … 502 511 } 503 512 504 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCTICall(Instruction* vPC, unsigned bytecodeIndex, CTIHelper_2 helper)513 ALWAYS_INLINE JmpSrc CTI::emitCTICall(Instruction* vPC, unsigned bytecodeIndex, CTIHelper_2 helper) 505 514 { 506 515 #if ENABLE(OPCODE_SAMPLING) … … 511 520 __ emitRestoreArgumentReference(); 512 521 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 513 X86Assembler::JmpSrc call = __ emitCall();522 JmpSrc call = __ emitCall(); 514 523 m_calls.append(CallRecord(call, helper, bytecodeIndex)); 515 524 #if ENABLE(OPCODE_SAMPLING) … … 521 530 } 522 531 523 ALWAYS_INLINE void CTI::emitJumpSlowCaseIfNotJSCell( X86Assembler::RegisterID reg, unsigned bytecodeIndex)532 ALWAYS_INLINE void CTI::emitJumpSlowCaseIfNotJSCell(RegisterID reg, unsigned bytecodeIndex) 524 533 { 525 534 __ testl_i32r(JSImmediate::TagMask, reg); … … 527 536 } 528 537 529 ALWAYS_INLINE void CTI::emitJumpSlowCaseIfNotJSCell( X86Assembler::RegisterID reg, unsigned bytecodeIndex, int vReg)538 ALWAYS_INLINE void CTI::emitJumpSlowCaseIfNotJSCell(RegisterID reg, unsigned bytecodeIndex, int vReg) 530 539 { 531 540 if (m_codeBlock->isKnownNotImmediate(vReg)) … … 544 553 } 545 554 546 ALWAYS_INLINE void CTI::emitJumpSlowCaseIfNotImmNum( X86Assembler::RegisterID reg, unsigned bytecodeIndex)555 ALWAYS_INLINE void CTI::emitJumpSlowCaseIfNotImmNum(RegisterID reg, unsigned bytecodeIndex) 547 556 { 548 557 __ testl_i32r(JSImmediate::TagBitTypeInteger, reg); … … 550 559 } 551 560 552 ALWAYS_INLINE void CTI::emitJumpSlowCaseIfNotImmNums( X86Assembler::RegisterID reg1, X86Assembler::RegisterID reg2, unsigned bytecodeIndex)561 ALWAYS_INLINE void CTI::emitJumpSlowCaseIfNotImmNums(RegisterID reg1, RegisterID reg2, unsigned bytecodeIndex) 553 562 { 554 563 __ movl_rr(reg1, X86::ecx); … … 563 572 } 564 573 565 ALWAYS_INLINE void CTI::emitFastArithDeTagImmediate( X86Assembler::RegisterID reg)574 ALWAYS_INLINE void CTI::emitFastArithDeTagImmediate(RegisterID reg) 566 575 { 567 576 __ subl_i8r(JSImmediate::TagBitTypeInteger, reg); 568 577 } 569 578 570 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitFastArithDeTagImmediateJumpIfZero(X86Assembler::RegisterID reg)579 ALWAYS_INLINE JmpSrc CTI::emitFastArithDeTagImmediateJumpIfZero(RegisterID reg) 571 580 { 572 581 __ subl_i8r(JSImmediate::TagBitTypeInteger, reg); … … 574 583 } 575 584 576 ALWAYS_INLINE void CTI::emitFastArithReTagImmediate( X86Assembler::RegisterID reg)585 ALWAYS_INLINE void CTI::emitFastArithReTagImmediate(RegisterID reg) 577 586 { 578 587 __ addl_i8r(JSImmediate::TagBitTypeInteger, reg); 579 588 } 580 589 581 ALWAYS_INLINE void CTI::emitFastArithPotentiallyReTagImmediate( X86Assembler::RegisterID reg)590 ALWAYS_INLINE void CTI::emitFastArithPotentiallyReTagImmediate(RegisterID reg) 582 591 { 583 592 __ orl_i32r(JSImmediate::TagBitTypeInteger, reg); 584 593 } 585 594 586 ALWAYS_INLINE void CTI::emitFastArithImmToInt( X86Assembler::RegisterID reg)595 ALWAYS_INLINE void CTI::emitFastArithImmToInt(RegisterID reg) 587 596 { 588 597 __ sarl_i8r(1, reg); 589 598 } 590 599 591 ALWAYS_INLINE void CTI::emitFastArithIntToImmOrSlowCase( X86Assembler::RegisterID reg, unsigned bytecodeIndex)600 ALWAYS_INLINE void CTI::emitFastArithIntToImmOrSlowCase(RegisterID reg, unsigned bytecodeIndex) 592 601 { 593 602 __ addl_rr(reg, reg); … … 596 605 } 597 606 598 ALWAYS_INLINE void CTI::emitFastArithIntToImmNoCheck( X86Assembler::RegisterID reg)607 ALWAYS_INLINE void CTI::emitFastArithIntToImmNoCheck(RegisterID reg) 599 608 { 600 609 __ addl_rr(reg, reg); … … 602 611 } 603 612 604 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitArithIntToImmWithJump(X86Assembler::RegisterID reg)613 ALWAYS_INLINE JmpSrc CTI::emitArithIntToImmWithJump(RegisterID reg) 605 614 { 606 615 __ addl_rr(reg, reg); 607 X86Assembler::JmpSrc jmp = __ emitUnlinkedJo();616 JmpSrc jmp = __ emitUnlinkedJo(); 608 617 emitFastArithReTagImmediate(reg); 609 618 return jmp; 610 619 } 611 620 612 ALWAYS_INLINE void CTI::emitTagAsBoolImmediate( X86Assembler::RegisterID reg)621 ALWAYS_INLINE void CTI::emitTagAsBoolImmediate(RegisterID reg) 613 622 { 614 623 __ shl_i8r(JSImmediate::ExtendedPayloadShift, reg); … … 633 642 emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 0, X86::ecx); \ 634 643 emitPutCTIArgFromVirtualRegister(instruction[i + 3].u.operand, 4, X86::ecx); \ 635 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_##name); \644 emitCTICall(instruction + i, i, Interpreter::cti_##name); \ 636 645 emitPutVirtualRegister(instruction[i + 1].u.operand); \ 637 646 i += 4; \ … … 642 651 case name: { \ 643 652 emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 0, X86::ecx); \ 644 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_##name); \653 emitCTICall(instruction + i, i, Interpreter::cti_##name); \ 645 654 emitPutVirtualRegister(instruction[i + 1].u.operand); \ 646 655 i += 3; \ … … 658 667 __ movl_rm(X86::edx, RegisterFile::ArgumentCount * static_cast<int>(sizeof(Register)), X86::edi); 659 668 660 __ movl_mr( OBJECT_OFFSET(JSFunction, m_scopeChain) + OBJECT_OFFSET(ScopeChain, m_node), X86::ecx, X86::edx); // newScopeChain669 __ movl_mr(FIELD_OFFSET(JSFunction, m_scopeChain) + FIELD_OFFSET(ScopeChain, m_node), X86::ecx, X86::edx); // newScopeChain 661 670 662 671 __ movl_i32m(asInteger(noValue()), RegisterFile::OptionalCalleeArguments * static_cast<int>(sizeof(Register)), X86::edi); … … 713 722 714 723 // Handle eval 715 X86Assembler::JmpSrc wasEval;724 JmpSrc wasEval; 716 725 if (opcodeID == op_call_eval) { 717 726 emitGetVirtualRegister(callee, X86::ecx, i); 718 727 compileOpCallEvalSetupArgs(instruction); 719 728 720 emitCTICall(instruction, i, BytecodeInterpreter::cti_op_call_eval);729 emitCTICall(instruction, i, Interpreter::cti_op_call_eval); 721 730 __ cmpl_i32r(asInteger(JSImmediate::impossibleValue()), X86::eax); 722 731 wasEval = __ emitUnlinkedJne(); … … 727 736 emitGetVirtualRegister(callee, X86::ecx, i); 728 737 __ cmpl_i32r(asInteger(JSImmediate::impossibleValue()), X86::ecx); 729 X86Assembler::JmpDst addressOfLinkedFunctionCheck = __ label();738 JmpDst addressOfLinkedFunctionCheck = __ label(); 730 739 m_slowCases.append(SlowCaseEntry(__ emitUnlinkedJne(), i)); 731 ASSERT( X86Assembler::getDifferenceBetweenLabels(addressOfLinkedFunctionCheck, __ label()) == repatchOffsetOpCallCall);740 ASSERT(__ getDifferenceBetweenLabels(addressOfLinkedFunctionCheck, __ label()) == repatchOffsetOpCallCall); 732 741 m_callStructureStubCompilationInfo[callLinkInfoIndex].hotPathBegin = addressOfLinkedFunctionCheck; 733 742 … … 741 750 emitPutCTIArg(X86::ecx, 0); 742 751 emitPutCTIArgFromVirtualRegister(proto, 12, X86::eax); 743 emitCTICall(instruction, i, BytecodeInterpreter::cti_op_construct_JSConstruct);752 emitCTICall(instruction, i, Interpreter::cti_op_construct_JSConstruct); 744 753 emitPutVirtualRegister(thisRegister); 745 754 emitGetVirtualRegister(callee, X86::ecx, i); … … 750 759 __ movl_i32m(asInteger(noValue()), (registerOffset + RegisterFile::OptionalCalleeArguments) * static_cast<int>(sizeof(Register)), X86::edi); 751 760 __ movl_rm(X86::ecx, (registerOffset + RegisterFile::Callee) * static_cast<int>(sizeof(Register)), X86::edi); 752 __ movl_mr( OBJECT_OFFSET(JSFunction, m_scopeChain) + OBJECT_OFFSET(ScopeChain, m_node), X86::ecx, X86::edx); // newScopeChain761 __ movl_mr(FIELD_OFFSET(JSFunction, m_scopeChain) + FIELD_OFFSET(ScopeChain, m_node), X86::ecx, X86::edx); // newScopeChain 753 762 __ movl_i32m(argCount, (registerOffset + RegisterFile::ArgumentCount) * static_cast<int>(sizeof(Register)), X86::edi); 754 763 __ movl_rm(X86::edi, (registerOffset + RegisterFile::CallerFrame) * static_cast<int>(sizeof(Register)), X86::edi); … … 781 790 782 791 __ testl_i32r(JSImmediate::TagMask, X86::eax); 783 X86Assembler::JmpSrc firstNotImmediate = __ emitUnlinkedJe();792 JmpSrc firstNotImmediate = __ emitUnlinkedJe(); 784 793 __ testl_i32r(JSImmediate::TagMask, X86::edx); 785 X86Assembler::JmpSrc secondNotImmediate = __ emitUnlinkedJe();794 JmpSrc secondNotImmediate = __ emitUnlinkedJe(); 786 795 787 796 __ cmpl_rr(X86::edx, X86::eax); … … 793 802 emitTagAsBoolImmediate(X86::eax); 794 803 795 X86Assembler::JmpSrc bothWereImmediates = __ emitUnlinkedJmp();804 JmpSrc bothWereImmediates = __ emitUnlinkedJmp(); 796 805 797 806 __ link(firstNotImmediate, __ label()); … … 810 819 __ movl_i32r(asInteger(jsBoolean(negated)), X86::eax); 811 820 812 X86Assembler::JmpSrc firstWasNotImmediate = __ emitUnlinkedJmp();821 JmpSrc firstWasNotImmediate = __ emitUnlinkedJmp(); 813 822 814 823 __ link(secondNotImmediate, __ label()); … … 828 837 { 829 838 __ subl_i8r(1, X86::esi); 830 X86Assembler::JmpSrc skipTimeout = __ emitUnlinkedJne();831 emitCTICall(vPC, bytecodeIndex, BytecodeInterpreter::cti_timeout_check);839 JmpSrc skipTimeout = __ emitUnlinkedJne(); 840 emitCTICall(vPC, bytecodeIndex, Interpreter::cti_timeout_check); 832 841 833 842 emitGetCTIParam(CTI_ARGS_globalData, X86::ecx); 834 __ movl_mr( OBJECT_OFFSET(JSGlobalData, interpreter), X86::ecx, X86::ecx);835 __ movl_mr( OBJECT_OFFSET(BytecodeInterpreter, m_ticksUntilNextTimeoutCheck), X86::ecx, X86::esi);843 __ movl_mr(FIELD_OFFSET(JSGlobalData, interpreter), X86::ecx, X86::ecx); 844 __ movl_mr(FIELD_OFFSET(Interpreter, m_ticksUntilNextTimeoutCheck), X86::ecx, X86::esi); 836 845 __ link(skipTimeout, __ label()); 837 846 … … 848 857 control will fall through from the code planted. 849 858 */ 850 void CTI::putDoubleResultToJSNumberCellOrJSImmediate(X86::XMMRegisterID xmmSource, X86::RegisterID jsNumberCell, unsigned dst, X86Assembler::JmpSrc* wroteJSNumberCell, X86::XMMRegisterID tempXmm, X86::RegisterID tempReg1, X86::RegisterID tempReg2)859 void CTI::putDoubleResultToJSNumberCellOrJSImmediate(X86::XMMRegisterID xmmSource, X86::RegisterID jsNumberCell, unsigned dst, JmpSrc* wroteJSNumberCell, X86::XMMRegisterID tempXmm, X86::RegisterID tempReg1, X86::RegisterID tempReg2) 851 860 { 852 861 // convert (double -> JSImmediate -> double), and check if the value is unchanged - in which case the value is representable as a JSImmediate. … … 857 866 // Compare & branch if immediate. 858 867 __ ucomis_rr(tempXmm, xmmSource); 859 X86Assembler::JmpSrc resultIsImm = __ emitUnlinkedJe();860 X86Assembler::JmpDst resultLookedLikeImmButActuallyIsnt = __ label();868 JmpSrc resultIsImm = __ emitUnlinkedJe(); 869 JmpDst resultLookedLikeImmButActuallyIsnt = __ label(); 861 870 862 871 // Store the result to the JSNumberCell and jump. 863 __ movsd_rm(xmmSource, OBJECT_OFFSET(JSNumberCell, m_value), jsNumberCell);872 __ movsd_rm(xmmSource, FIELD_OFFSET(JSNumberCell, m_value), jsNumberCell); 864 873 if (jsNumberCell != X86::eax) 865 874 __ movl_rr(jsNumberCell, X86::eax); … … 884 893 { 885 894 Structure* numberStructure = m_globalData->numberStructure.get(); 886 X86Assembler::JmpSrc wasJSNumberCell1;887 X86Assembler::JmpSrc wasJSNumberCell1b;888 X86Assembler::JmpSrc wasJSNumberCell2;889 X86Assembler::JmpSrc wasJSNumberCell2b;895 JmpSrc wasJSNumberCell1; 896 JmpSrc wasJSNumberCell1b; 897 JmpSrc wasJSNumberCell2; 898 JmpSrc wasJSNumberCell2b; 890 899 891 900 emitGetVirtualRegisters(src1, X86::eax, src2, X86::edx, i); … … 896 905 // Check op2 is a number 897 906 __ testl_i32r(JSImmediate::TagBitTypeInteger, X86::edx); 898 X86Assembler::JmpSrc op2imm = __ emitUnlinkedJne();907 JmpSrc op2imm = __ emitUnlinkedJne(); 899 908 if (!types.second().definitelyIsNumber()) { 900 909 emitJumpSlowCaseIfNotJSCell(X86::edx, i, src2); 901 __ cmpl_i32m(reinterpret_cast<unsigned>(numberStructure), OBJECT_OFFSET(JSCell, m_structure), X86::edx);910 __ cmpl_i32m(reinterpret_cast<unsigned>(numberStructure), FIELD_OFFSET(JSCell, m_structure), X86::edx); 902 911 m_slowCases.append(SlowCaseEntry(__ emitUnlinkedJne(), i)); 903 912 } … … 906 915 // Slow case if src1 is not a number type. 907 916 __ testl_i32r(JSImmediate::TagBitTypeInteger, X86::eax); 908 X86Assembler::JmpSrc op1imm = __ emitUnlinkedJne();917 JmpSrc op1imm = __ emitUnlinkedJne(); 909 918 if (!types.first().definitelyIsNumber()) { 910 919 emitJumpSlowCaseIfNotJSCell(X86::eax, i, src1); 911 __ cmpl_i32m(reinterpret_cast<unsigned>(numberStructure), OBJECT_OFFSET(JSCell, m_structure), X86::eax);920 __ cmpl_i32m(reinterpret_cast<unsigned>(numberStructure), FIELD_OFFSET(JSCell, m_structure), X86::eax); 912 921 m_slowCases.append(SlowCaseEntry(__ emitUnlinkedJne(), i)); 913 922 } 914 923 915 924 // (1a) if we get here, src1 is also a number cell 916 __ movsd_mr( OBJECT_OFFSET(JSNumberCell, m_value), X86::eax, X86::xmm0);917 X86Assembler::JmpSrc loadedDouble = __ emitUnlinkedJmp();925 __ movsd_mr(FIELD_OFFSET(JSNumberCell, m_value), X86::eax, X86::xmm0); 926 JmpSrc loadedDouble = __ emitUnlinkedJmp(); 918 927 // (1b) if we get here, src1 is an immediate 919 928 __ link(op1imm, __ label()); … … 923 932 __ link(loadedDouble, __ label()); 924 933 if (opcodeID == op_add) 925 __ addsd_mr( OBJECT_OFFSET(JSNumberCell, m_value), X86::edx, X86::xmm0);934 __ addsd_mr(FIELD_OFFSET(JSNumberCell, m_value), X86::edx, X86::xmm0); 926 935 else if (opcodeID == op_sub) 927 __ subsd_mr( OBJECT_OFFSET(JSNumberCell, m_value), X86::edx, X86::xmm0);936 __ subsd_mr(FIELD_OFFSET(JSNumberCell, m_value), X86::edx, X86::xmm0); 928 937 else { 929 938 ASSERT(opcodeID == op_mul); 930 __ mulsd_mr( OBJECT_OFFSET(JSNumberCell, m_value), X86::edx, X86::xmm0);939 __ mulsd_mr(FIELD_OFFSET(JSNumberCell, m_value), X86::edx, X86::xmm0); 931 940 } 932 941 … … 943 952 // Check op1 is a number 944 953 __ testl_i32r(JSImmediate::TagBitTypeInteger, X86::eax); 945 X86Assembler::JmpSrc op1imm = __ emitUnlinkedJne();954 JmpSrc op1imm = __ emitUnlinkedJne(); 946 955 if (!types.first().definitelyIsNumber()) { 947 956 emitJumpSlowCaseIfNotJSCell(X86::eax, i, src1); 948 __ cmpl_i32m(reinterpret_cast<unsigned>(numberStructure), OBJECT_OFFSET(JSCell, m_structure), X86::eax);957 __ cmpl_i32m(reinterpret_cast<unsigned>(numberStructure), FIELD_OFFSET(JSCell, m_structure), X86::eax); 949 958 m_slowCases.append(SlowCaseEntry(__ emitUnlinkedJne(), i)); 950 959 } … … 953 962 // Slow case if src2 is not a number type. 954 963 __ testl_i32r(JSImmediate::TagBitTypeInteger, X86::edx); 955 X86Assembler::JmpSrc op2imm = __ emitUnlinkedJne();964 JmpSrc op2imm = __ emitUnlinkedJne(); 956 965 if (!types.second().definitelyIsNumber()) { 957 966 emitJumpSlowCaseIfNotJSCell(X86::edx, i, src2); 958 __ cmpl_i32m(reinterpret_cast<unsigned>(numberStructure), OBJECT_OFFSET(JSCell, m_structure), X86::edx);967 __ cmpl_i32m(reinterpret_cast<unsigned>(numberStructure), FIELD_OFFSET(JSCell, m_structure), X86::edx); 959 968 m_slowCases.append(SlowCaseEntry(__ emitUnlinkedJne(), i)); 960 969 } 961 970 962 971 // (1a) if we get here, src2 is also a number cell 963 __ movsd_mr( OBJECT_OFFSET(JSNumberCell, m_value), X86::edx, X86::xmm1);964 X86Assembler::JmpSrc loadedDouble = __ emitUnlinkedJmp();972 __ movsd_mr(FIELD_OFFSET(JSNumberCell, m_value), X86::edx, X86::xmm1); 973 JmpSrc loadedDouble = __ emitUnlinkedJmp(); 965 974 // (1b) if we get here, src2 is an immediate 966 975 __ link(op2imm, __ label()); … … 969 978 // (1c) 970 979 __ link(loadedDouble, __ label()); 971 __ movsd_mr( OBJECT_OFFSET(JSNumberCell, m_value), X86::eax, X86::xmm0);980 __ movsd_mr(FIELD_OFFSET(JSNumberCell, m_value), X86::eax, X86::xmm0); 972 981 if (opcodeID == op_add) 973 982 __ addsd_rr(X86::xmm1, X86::xmm0); … … 978 987 __ mulsd_rr(X86::xmm1, X86::xmm0); 979 988 } 980 __ movsd_rm(X86::xmm0, OBJECT_OFFSET(JSNumberCell, m_value), X86::eax);989 __ movsd_rm(X86::xmm0, FIELD_OFFSET(JSNumberCell, m_value), X86::eax); 981 990 emitPutVirtualRegister(dst); 982 991 … … 1003 1012 // convert eax & edx from JSImmediates to ints, and check if either are zero 1004 1013 emitFastArithImmToInt(X86::edx); 1005 X86Assembler::JmpSrc op1Zero = emitFastArithDeTagImmediateJumpIfZero(X86::eax);1014 JmpSrc op1Zero = emitFastArithDeTagImmediateJumpIfZero(X86::eax); 1006 1015 __ testl_rr(X86::edx, X86::edx); 1007 X86Assembler::JmpSrc op2NonZero = __ emitUnlinkedJne();1016 JmpSrc op2NonZero = __ emitUnlinkedJne(); 1008 1017 __ link(op1Zero, __ label()); 1009 1018 // if either input is zero, add the two together, and check if the result is < 0. … … 1032 1041 void CTI::compileBinaryArithOpSlowCase(Instruction* vPC, OpcodeID opcodeID, Vector<SlowCaseEntry>::iterator& iter, unsigned dst, unsigned src1, unsigned src2, OperandTypes types, unsigned i) 1033 1042 { 1034 X86Assembler::JmpDst here = __ label();1043 JmpDst here = __ label(); 1035 1044 __ link(iter->from, here); 1036 1045 if (types.second().isReusable() && isSSE2Present()) { … … 1068 1077 emitPutCTIArgFromVirtualRegister(src2, 4, X86::ecx); 1069 1078 if (opcodeID == op_add) 1070 emitCTICall(vPC, i, BytecodeInterpreter::cti_op_add);1079 emitCTICall(vPC, i, Interpreter::cti_op_add); 1071 1080 else if (opcodeID == op_sub) 1072 emitCTICall(vPC, i, BytecodeInterpreter::cti_op_sub);1081 emitCTICall(vPC, i, Interpreter::cti_op_sub); 1073 1082 else { 1074 1083 ASSERT(opcodeID == op_mul); 1075 emitCTICall(vPC, i, BytecodeInterpreter::cti_op_mul);1084 emitCTICall(vPC, i, Interpreter::cti_op_mul); 1076 1085 } 1077 1086 emitPutVirtualRegister(dst); … … 1131 1140 emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 0, X86::ecx); 1132 1141 emitPutCTIArgFromVirtualRegister(instruction[i + 3].u.operand, 4, X86::ecx); 1133 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_add);1142 emitCTICall(instruction + i, i, Interpreter::cti_op_add); 1134 1143 emitPutVirtualRegister(instruction[i + 1].u.operand); 1135 1144 } … … 1141 1150 case op_end: { 1142 1151 if (m_codeBlock->needsFullScopeChain) 1143 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_end);1152 emitCTICall(instruction + i, i, Interpreter::cti_op_end); 1144 1153 emitGetVirtualRegister(instruction[i + 1].u.operand, X86::eax, i); 1145 1154 __ pushl_m(RegisterFile::ReturnPC * static_cast<int>(sizeof(Register)), X86::edi); … … 1213 1222 } 1214 1223 case op_new_object: { 1215 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_new_object);1224 emitCTICall(instruction + i, i, Interpreter::cti_op_new_object); 1216 1225 emitPutVirtualRegister(instruction[i + 1].u.operand); 1217 1226 i += 2; … … 1231 1240 emitJumpSlowCaseIfNotJSCell(X86::eax, i, baseVReg); 1232 1241 1233 X86Assembler::JmpDst hotPathBegin = __ label();1242 JmpDst hotPathBegin = __ label(); 1234 1243 m_propertyAccessCompilationInfo[propertyAccessInstructionIndex].hotPathBegin = hotPathBegin; 1235 1244 ++propertyAccessInstructionIndex; 1236 1245 1237 1246 // It is important that the following instruction plants a 32bit immediate, in order that it can be patched over. 1238 __ cmpl_i32m(repatchGetByIdDefaultStructure, OBJECT_OFFSET(JSCell, m_structure), X86::eax);1239 ASSERT( X86Assembler::getDifferenceBetweenLabels(hotPathBegin, __ label()) == repatchOffsetPutByIdStructure);1247 __ cmpl_i32m(repatchGetByIdDefaultStructure, FIELD_OFFSET(JSCell, m_structure), X86::eax); 1248 ASSERT(__ getDifferenceBetweenLabels(hotPathBegin, __ label()) == repatchOffsetPutByIdStructure); 1240 1249 m_slowCases.append(SlowCaseEntry(__ emitUnlinkedJne(), i)); 1241 1250 1242 1251 // Plant a load from a bogus ofset in the object's property map; we will patch this later, if it is to be used. 1243 __ movl_mr( OBJECT_OFFSET(JSObject, m_propertyStorage), X86::eax, X86::eax);1252 __ movl_mr(FIELD_OFFSET(JSObject, m_propertyStorage), X86::eax, X86::eax); 1244 1253 __ movl_rm(X86::edx, repatchGetByIdDefaultOffset, X86::eax); 1245 ASSERT( X86Assembler::getDifferenceBetweenLabels(hotPathBegin, __ label()) == repatchOffsetPutByIdPropertyMapOffset);1254 ASSERT(__ getDifferenceBetweenLabels(hotPathBegin, __ label()) == repatchOffsetPutByIdPropertyMapOffset); 1246 1255 1247 1256 i += 8; … … 1261 1270 emitJumpSlowCaseIfNotJSCell(X86::eax, i, baseVReg); 1262 1271 1263 X86Assembler::JmpDst hotPathBegin = __ label();1272 JmpDst hotPathBegin = __ label(); 1264 1273 m_propertyAccessCompilationInfo[propertyAccessInstructionIndex].hotPathBegin = hotPathBegin; 1265 1274 ++propertyAccessInstructionIndex; 1266 1275 1267 __ cmpl_i32m(repatchGetByIdDefaultStructure, OBJECT_OFFSET(JSCell, m_structure), X86::eax);1268 ASSERT( X86Assembler::getDifferenceBetweenLabels(hotPathBegin, __ label()) == repatchOffsetGetByIdStructure);1276 __ cmpl_i32m(repatchGetByIdDefaultStructure, FIELD_OFFSET(JSCell, m_structure), X86::eax); 1277 ASSERT(__ getDifferenceBetweenLabels(hotPathBegin, __ label()) == repatchOffsetGetByIdStructure); 1269 1278 m_slowCases.append(SlowCaseEntry(__ emitUnlinkedJne(), i)); 1270 ASSERT( X86Assembler::getDifferenceBetweenLabels(hotPathBegin, __ label()) == repatchOffsetGetByIdBranchToSlowCase);1271 1272 __ movl_mr( OBJECT_OFFSET(JSObject, m_propertyStorage), X86::eax, X86::eax);1279 ASSERT(__ getDifferenceBetweenLabels(hotPathBegin, __ label()) == repatchOffsetGetByIdBranchToSlowCase); 1280 1281 __ movl_mr(FIELD_OFFSET(JSObject, m_propertyStorage), X86::eax, X86::eax); 1273 1282 __ movl_mr(repatchGetByIdDefaultOffset, X86::eax, X86::eax); 1274 ASSERT( X86Assembler::getDifferenceBetweenLabels(hotPathBegin, __ label()) == repatchOffsetGetByIdPropertyMapOffset);1283 ASSERT(__ getDifferenceBetweenLabels(hotPathBegin, __ label()) == repatchOffsetGetByIdPropertyMapOffset); 1275 1284 emitPutVirtualRegister(instruction[i + 1].u.operand); 1276 1285 … … 1294 1303 // this works because NumberType and StringType are smaller 1295 1304 __ movl_i32r(3 * ObjectType, X86::ecx); 1296 __ movl_mr( OBJECT_OFFSET(JSCell, m_structure), X86::eax, X86::eax);1297 __ movl_mr( OBJECT_OFFSET(JSCell, m_structure), X86::edx, X86::edx);1298 __ subl_mr( OBJECT_OFFSET(Structure, m_typeInfo.m_type), X86::eax, X86::ecx);1299 __ subl_mr( OBJECT_OFFSET(Structure, m_typeInfo.m_type), X86::edx, X86::ecx);1305 __ movl_mr(FIELD_OFFSET(JSCell, m_structure), X86::eax, X86::eax); 1306 __ movl_mr(FIELD_OFFSET(JSCell, m_structure), X86::edx, X86::edx); 1307 __ subl_mr(FIELD_OFFSET(Structure, m_typeInfo.m_type), X86::eax, X86::ecx); 1308 __ subl_mr(FIELD_OFFSET(Structure, m_typeInfo.m_type), X86::edx, X86::ecx); 1300 1309 emitGetVirtualRegister(instruction[i + 3].u.operand, X86::edx, i); // reload baseVal 1301 __ movl_mr( OBJECT_OFFSET(JSCell, m_structure), X86::edx, X86::edx);1302 __ cmpl_rm(X86::ecx, OBJECT_OFFSET(Structure, m_typeInfo.m_type), X86::edx);1310 __ movl_mr(FIELD_OFFSET(JSCell, m_structure), X86::edx, X86::edx); 1311 __ cmpl_rm(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_type), X86::edx); 1303 1312 1304 1313 m_slowCases.append(SlowCaseEntry(__ emitUnlinkedJne(), i)); 1305 1314 1306 1315 // check that baseVal's flags include ImplementsHasInstance but not OverridesHasInstance 1307 __ movl_mr( OBJECT_OFFSET(Structure, m_typeInfo.m_flags), X86::edx, X86::ecx);1316 __ movl_mr(FIELD_OFFSET(Structure, m_typeInfo.m_flags), X86::edx, X86::ecx); 1308 1317 __ andl_i32r(ImplementsHasInstance | OverridesHasInstance, X86::ecx); 1309 1318 __ cmpl_i32r(ImplementsHasInstance, X86::ecx); … … 1317 1326 __ movl_i32r(asInteger(jsBoolean(true)), X86::eax); 1318 1327 1319 X86Assembler::JmpDst loop = __ label();1328 JmpDst loop = __ label(); 1320 1329 1321 1330 // load value's prototype 1322 __ movl_mr( OBJECT_OFFSET(JSCell, m_structure), X86::ecx, X86::ecx);1323 __ movl_mr( OBJECT_OFFSET(Structure, m_prototype), X86::ecx, X86::ecx);1331 __ movl_mr(FIELD_OFFSET(JSCell, m_structure), X86::ecx, X86::ecx); 1332 __ movl_mr(FIELD_OFFSET(Structure, m_prototype), X86::ecx, X86::ecx); 1324 1333 1325 1334 __ cmpl_rr(X86::ecx, X86::edx); 1326 X86Assembler::JmpSrc exit = __ emitUnlinkedJe();1335 JmpSrc exit = __ emitUnlinkedJe(); 1327 1336 1328 1337 __ cmpl_i32r(asInteger(jsNull()), X86::ecx); 1329 X86Assembler::JmpSrc goToLoop = __ emitUnlinkedJne();1338 JmpSrc goToLoop = __ emitUnlinkedJne(); 1330 1339 __ link(goToLoop, loop); 1331 1340 … … 1343 1352 Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 3].u.operand]); 1344 1353 emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 4); 1345 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_del_by_id);1354 emitCTICall(instruction + i, i, Interpreter::cti_op_del_by_id); 1346 1355 emitPutVirtualRegister(instruction[i + 1].u.operand); 1347 1356 i += 4; … … 1382 1391 FuncDeclNode* func = (m_codeBlock->functions[instruction[i + 2].u.operand]).get(); 1383 1392 emitPutCTIArgConstant(reinterpret_cast<unsigned>(func), 0); 1384 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_new_func);1393 emitCTICall(instruction + i, i, Interpreter::cti_op_new_func); 1385 1394 emitPutVirtualRegister(instruction[i + 1].u.operand); 1386 1395 i += 3; … … 1415 1424 emitGetVirtualRegister(RegisterFile::ScopeChain, X86::eax, i); 1416 1425 while (skip--) 1417 __ movl_mr( OBJECT_OFFSET(ScopeChainNode, next), X86::eax, X86::eax);1418 1419 __ movl_mr( OBJECT_OFFSET(ScopeChainNode, object), X86::eax, X86::eax);1426 __ movl_mr(FIELD_OFFSET(ScopeChainNode, next), X86::eax, X86::eax); 1427 1428 __ movl_mr(FIELD_OFFSET(ScopeChainNode, object), X86::eax, X86::eax); 1420 1429 emitGetVariableObjectRegister(X86::eax, instruction[i + 2].u.operand, X86::eax); 1421 1430 emitPutVirtualRegister(instruction[i + 1].u.operand); … … 1429 1438 emitGetVirtualRegister(instruction[i + 3].u.operand, X86::eax, i); 1430 1439 while (skip--) 1431 __ movl_mr( OBJECT_OFFSET(ScopeChainNode, next), X86::edx, X86::edx);1432 1433 __ movl_mr( OBJECT_OFFSET(ScopeChainNode, object), X86::edx, X86::edx);1440 __ movl_mr(FIELD_OFFSET(ScopeChainNode, next), X86::edx, X86::edx); 1441 1442 __ movl_mr(FIELD_OFFSET(ScopeChainNode, object), X86::edx, X86::edx); 1434 1443 emitPutVariableObjectRegister(X86::eax, X86::edx, instruction[i + 1].u.operand); 1435 1444 i += 4; … … 1438 1447 case op_tear_off_activation: { 1439 1448 emitPutCTIArgFromVirtualRegister(instruction[i + 1].u.operand, 0, X86::ecx); 1440 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_tear_off_activation);1449 emitCTICall(instruction + i, i, Interpreter::cti_op_tear_off_activation); 1441 1450 i += 2; 1442 1451 break; 1443 1452 } 1444 1453 case op_tear_off_arguments: { 1445 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_tear_off_arguments);1454 emitCTICall(instruction + i, i, Interpreter::cti_op_tear_off_arguments); 1446 1455 i += 1; 1447 1456 break; … … 1450 1459 // We could JIT generate the deref, only calling out to C when the refcount hits zero. 1451 1460 if (m_codeBlock->needsFullScopeChain) 1452 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_ret_scopeChain);1461 emitCTICall(instruction + i, i, Interpreter::cti_op_ret_scopeChain); 1453 1462 1454 1463 // Return the result in %eax. … … 1472 1481 emitPutCTIArg(X86::edx, 0); 1473 1482 emitPutCTIArgConstant(instruction[i + 3].u.operand, 4); 1474 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_new_array);1483 emitCTICall(instruction + i, i, Interpreter::cti_op_new_array); 1475 1484 emitPutVirtualRegister(instruction[i + 1].u.operand); 1476 1485 i += 4; … … 1480 1489 Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 2].u.operand]); 1481 1490 emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 0); 1482 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_resolve);1491 emitCTICall(instruction + i, i, Interpreter::cti_op_resolve); 1483 1492 emitPutVirtualRegister(instruction[i + 1].u.operand); 1484 1493 i += 3; … … 1489 1498 1490 1499 __ testl_i32r(JSImmediate::TagMask, X86::eax); 1491 X86Assembler::JmpSrc isImmediate = __ emitUnlinkedJne();1492 __ movl_mr( OBJECT_OFFSET(JSCell, m_structure), X86::eax, X86::ecx);1493 __ cmpl_i32m(ObjectType, OBJECT_OFFSET(Structure, m_typeInfo) + OBJECT_OFFSET(TypeInfo, m_type), X86::ecx);1494 X86Assembler::JmpSrc isObject = __ emitUnlinkedJe();1500 JmpSrc isImmediate = __ emitUnlinkedJne(); 1501 __ movl_mr(FIELD_OFFSET(JSCell, m_structure), X86::eax, X86::ecx); 1502 __ cmpl_i32m(ObjectType, FIELD_OFFSET(Structure, m_typeInfo) + FIELD_OFFSET(TypeInfo, m_type), X86::ecx); 1503 JmpSrc isObject = __ emitUnlinkedJe(); 1495 1504 1496 1505 __ link(isImmediate, __ label()); … … 1512 1521 1513 1522 // This is an array; get the m_storage pointer into ecx, then check if the index is below the fast cutoff 1514 __ movl_mr( OBJECT_OFFSET(JSArray, m_storage), X86::eax, X86::ecx);1515 __ cmpl_rm(X86::edx, OBJECT_OFFSET(JSArray, m_fastAccessCutoff), X86::eax);1523 __ movl_mr(FIELD_OFFSET(JSArray, m_storage), X86::eax, X86::ecx); 1524 __ cmpl_rm(X86::edx, FIELD_OFFSET(JSArray, m_fastAccessCutoff), X86::eax); 1516 1525 m_slowCases.append(SlowCaseEntry(__ emitUnlinkedJbe(), i)); 1517 1526 1518 1527 // Get the value from the vector 1519 __ movl_mr( OBJECT_OFFSET(ArrayStorage, m_vector[0]), X86::ecx, X86::edx, sizeof(JSValue*), X86::eax);1528 __ movl_mr(FIELD_OFFSET(ArrayStorage, m_vector[0]), X86::ecx, X86::edx, sizeof(JSValue*), X86::eax); 1520 1529 emitPutVirtualRegister(instruction[i + 1].u.operand); 1521 1530 i += 4; … … 1525 1534 Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 3].u.operand]); 1526 1535 emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 0); 1527 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_resolve_func);1536 emitCTICall(instruction + i, i, Interpreter::cti_op_resolve_func); 1528 1537 emitPutVirtualRegister(instruction[i + 2].u.operand, X86::edx); 1529 1538 emitPutVirtualRegister(instruction[i + 1].u.operand); … … 1546 1555 1547 1556 // This is an array; get the m_storage pointer into ecx, then check if the index is below the fast cutoff 1548 __ movl_mr( OBJECT_OFFSET(JSArray, m_storage), X86::eax, X86::ecx);1549 __ cmpl_rm(X86::edx, OBJECT_OFFSET(JSArray, m_fastAccessCutoff), X86::eax);1550 X86Assembler::JmpSrc inFastVector = __ emitUnlinkedJa();1557 __ movl_mr(FIELD_OFFSET(JSArray, m_storage), X86::eax, X86::ecx); 1558 __ cmpl_rm(X86::edx, FIELD_OFFSET(JSArray, m_fastAccessCutoff), X86::eax); 1559 JmpSrc inFastVector = __ emitUnlinkedJa(); 1551 1560 // No; oh well, check if the access if within the vector - if so, we may still be okay. 1552 __ cmpl_rm(X86::edx, OBJECT_OFFSET(ArrayStorage, m_vectorLength), X86::ecx);1561 __ cmpl_rm(X86::edx, FIELD_OFFSET(ArrayStorage, m_vectorLength), X86::ecx); 1553 1562 m_slowCases.append(SlowCaseEntry(__ emitUnlinkedJbe(), i)); 1554 1563 1555 1564 // This is a write to the slow part of the vector; first, we have to check if this would be the first write to this location. 1556 1565 // FIXME: should be able to handle initial write to array; increment the the number of items in the array, and potentially update fast access cutoff. 1557 __ cmpl_i8m(0, OBJECT_OFFSET(ArrayStorage, m_vector[0]), X86::ecx, X86::edx, sizeof(JSValue*));1566 __ cmpl_i8m(0, FIELD_OFFSET(ArrayStorage, m_vector[0]), X86::ecx, X86::edx, sizeof(JSValue*)); 1558 1567 m_slowCases.append(SlowCaseEntry(__ emitUnlinkedJe(), i)); 1559 1568 … … 1561 1570 __ link(inFastVector, __ label()); 1562 1571 emitGetVirtualRegister(instruction[i + 3].u.operand, X86::eax, i); 1563 __ movl_rm(X86::eax, OBJECT_OFFSET(ArrayStorage, m_vector[0]), X86::ecx, X86::edx, sizeof(JSValue*));1572 __ movl_rm(X86::eax, FIELD_OFFSET(ArrayStorage, m_vector[0]), X86::ecx, X86::edx, sizeof(JSValue*)); 1564 1573 i += 4; 1565 1574 break; … … 1573 1582 1574 1583 __ cmpl_i32r(asInteger(JSImmediate::zeroImmediate()), X86::eax); 1575 X86Assembler::JmpSrc isZero = __ emitUnlinkedJe();1584 JmpSrc isZero = __ emitUnlinkedJe(); 1576 1585 __ testl_i32r(JSImmediate::TagBitTypeInteger, X86::eax); 1577 1586 m_jmpTable.append(JmpTable(__ emitUnlinkedJne(), i + 2 + target)); … … 1589 1598 Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 2].u.operand]); 1590 1599 emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 0); 1591 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_resolve_base);1600 emitCTICall(instruction + i, i, Interpreter::cti_op_resolve_base); 1592 1601 emitPutVirtualRegister(instruction[i + 1].u.operand); 1593 1602 i += 3; … … 1599 1608 1600 1609 __ testl_i32r(JSImmediate::TagBitTypeInteger, X86::eax); 1601 X86Assembler::JmpSrc notImmediate = __ emitUnlinkedJe();1610 JmpSrc notImmediate = __ emitUnlinkedJe(); 1602 1611 1603 1612 __ cmpl_i32r(JSImmediate::TagBitTypeInteger, X86::eax); 1604 X86Assembler::JmpSrc zeroImmediate = __ emitUnlinkedJe();1613 JmpSrc zeroImmediate = __ emitUnlinkedJe(); 1605 1614 emitFastArithImmToInt(X86::eax); 1606 1615 __ negl_r(X86::eax); // This can't overflow as we only have a 31bit int at this point 1607 X86Assembler::JmpSrc overflow = emitArithIntToImmWithJump(X86::eax);1608 emitPutVirtualRegister(instruction[i + 1].u.operand); 1609 X86Assembler::JmpSrc immediateNegateSuccess = __ emitUnlinkedJmp();1616 JmpSrc overflow = emitArithIntToImmWithJump(X86::eax); 1617 emitPutVirtualRegister(instruction[i + 1].u.operand); 1618 JmpSrc immediateNegateSuccess = __ emitUnlinkedJmp(); 1610 1619 1611 1620 if (!isSSE2Present()) { … … 1614 1623 __ link(notImmediate, __ label()); 1615 1624 emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 0, X86::ecx); 1616 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_negate);1625 emitCTICall(instruction + i, i, Interpreter::cti_op_negate); 1617 1626 emitPutVirtualRegister(instruction[i + 1].u.operand); 1618 1627 } else { … … 1625 1634 emitJumpSlowCaseIfNotJSCell(X86::eax, i, srcVReg); 1626 1635 Structure* numberStructure = m_globalData->numberStructure.get(); 1627 __ cmpl_i32m(reinterpret_cast<unsigned>(numberStructure), OBJECT_OFFSET(JSCell, m_structure), X86::eax);1636 __ cmpl_i32m(reinterpret_cast<unsigned>(numberStructure), FIELD_OFFSET(JSCell, m_structure), X86::eax); 1628 1637 m_slowCases.append(SlowCaseEntry(__ emitUnlinkedJne(), i)); 1629 1638 } 1630 __ movsd_mr( OBJECT_OFFSET(JSNumberCell, m_value), X86::eax, X86::xmm0);1639 __ movsd_mr(FIELD_OFFSET(JSNumberCell, m_value), X86::eax, X86::xmm0); 1631 1640 // We need 3 copies of the sign bit mask so we can assure alignment and pad for the 128bit load 1632 1641 static double doubleSignBit[] = { -0.0, -0.0, -0.0 }; 1633 1642 __ xorpd_mr((void*)((((uintptr_t)doubleSignBit)+15)&~15), X86::xmm0); 1634 X86Assembler::JmpSrc wasCell;1643 JmpSrc wasCell; 1635 1644 if (!resultType.isReusableNumber()) 1636 1645 emitAllocateNumber(m_globalData, i); … … 1648 1657 emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 0); 1649 1658 emitPutCTIArgConstant(instruction[i + 3].u.operand + m_codeBlock->needsFullScopeChain, 4); 1650 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_resolve_skip);1659 emitCTICall(instruction + i, i, Interpreter::cti_op_resolve_skip); 1651 1660 emitPutVirtualRegister(instruction[i + 1].u.operand); 1652 1661 i += 4; … … 1663 1672 __ movl_i32r(globalObject, X86::eax); 1664 1673 __ movl_mr(structureAddress, X86::edx); 1665 __ cmpl_rm(X86::edx, OBJECT_OFFSET(JSCell, m_structure), X86::eax);1666 X86Assembler::JmpSrc noMatch = __ emitUnlinkedJne(); // Structures don't match1674 __ cmpl_rm(X86::edx, FIELD_OFFSET(JSCell, m_structure), X86::eax); 1675 JmpSrc noMatch = __ emitUnlinkedJne(); // Structures don't match 1667 1676 1668 1677 // Load cached property 1669 __ movl_mr( OBJECT_OFFSET(JSGlobalObject, m_propertyStorage), X86::eax, X86::eax);1678 __ movl_mr(FIELD_OFFSET(JSGlobalObject, m_propertyStorage), X86::eax, X86::eax); 1670 1679 __ movl_mr(offsetAddr, X86::edx); 1671 1680 __ movl_mr(0, X86::eax, X86::edx, sizeof(JSValue*), X86::eax); 1672 1681 emitPutVirtualRegister(instruction[i + 1].u.operand); 1673 X86Assembler::JmpSrc end = __ emitUnlinkedJmp();1682 JmpSrc end = __ emitUnlinkedJmp(); 1674 1683 1675 1684 // Slow case … … 1678 1687 emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 4); 1679 1688 emitPutCTIArgConstant(reinterpret_cast<unsigned>(instruction + i), 8); 1680 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_resolve_global);1689 emitCTICall(instruction + i, i, Interpreter::cti_op_resolve_global); 1681 1690 emitPutVirtualRegister(instruction[i + 1].u.operand); 1682 1691 __ link(end, __ label()); … … 1730 1739 m_jmpTable.append(JmpTable(__ emitUnlinkedJe(), i + 2 + target)); 1731 1740 __ testl_i32r(JSImmediate::TagBitTypeInteger, X86::eax); 1732 X86Assembler::JmpSrc isNonZero = __ emitUnlinkedJne();1741 JmpSrc isNonZero = __ emitUnlinkedJne(); 1733 1742 1734 1743 __ cmpl_i32r(asInteger(JSImmediate::falseImmediate()), X86::eax); … … 1747 1756 emitGetVirtualRegister(src, X86::eax, i); 1748 1757 __ testl_i32r(JSImmediate::TagMask, X86::eax); 1749 X86Assembler::JmpSrc isImmediate = __ emitUnlinkedJnz();1750 1751 __ movl_mr( OBJECT_OFFSET(JSCell, m_structure), X86::eax, X86::ecx);1752 __ testl_i32m(MasqueradesAsUndefined, OBJECT_OFFSET(Structure, m_typeInfo.m_flags), X86::ecx);1758 JmpSrc isImmediate = __ emitUnlinkedJnz(); 1759 1760 __ movl_mr(FIELD_OFFSET(JSCell, m_structure), X86::eax, X86::ecx); 1761 __ testl_i32m(MasqueradesAsUndefined, FIELD_OFFSET(Structure, m_typeInfo.m_flags), X86::ecx); 1753 1762 __ setnz_r(X86::eax); 1754 1763 1755 X86Assembler::JmpSrc wasNotImmediate = __ emitUnlinkedJmp();1764 JmpSrc wasNotImmediate = __ emitUnlinkedJmp(); 1756 1765 1757 1766 __ link(isImmediate, __ label()); … … 1777 1786 emitGetVirtualRegister(src, X86::eax, i); 1778 1787 __ testl_i32r(JSImmediate::TagMask, X86::eax); 1779 X86Assembler::JmpSrc isImmediate = __ emitUnlinkedJnz();1780 1781 __ movl_mr( OBJECT_OFFSET(JSCell, m_structure), X86::eax, X86::ecx);1782 __ testl_i32m(MasqueradesAsUndefined, OBJECT_OFFSET(Structure, m_typeInfo.m_flags), X86::ecx);1788 JmpSrc isImmediate = __ emitUnlinkedJnz(); 1789 1790 __ movl_mr(FIELD_OFFSET(JSCell, m_structure), X86::eax, X86::ecx); 1791 __ testl_i32m(MasqueradesAsUndefined, FIELD_OFFSET(Structure, m_typeInfo.m_flags), X86::ecx); 1783 1792 __ setz_r(X86::eax); 1784 1793 1785 X86Assembler::JmpSrc wasNotImmediate = __ emitUnlinkedJmp();1794 JmpSrc wasNotImmediate = __ emitUnlinkedJmp(); 1786 1795 1787 1796 __ link(isImmediate, __ label()); … … 1824 1833 int target = instruction[i + 2].u.operand; 1825 1834 __ movl_i32m(0, sizeof(Register) * retAddrDst, X86::edi); 1826 X86Assembler::JmpDst addrPosition = __ label();1835 JmpDst addrPosition = __ label(); 1827 1836 m_jmpTable.append(JmpTable(__ emitUnlinkedJmp(), i + 2 + target)); 1828 X86Assembler::JmpDst sretTarget = __ label();1837 JmpDst sretTarget = __ label(); 1829 1838 m_jsrSites.append(JSRInfo(addrPosition, sretTarget)); 1830 1839 i += 3; … … 1904 1913 Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 3].u.operand]); 1905 1914 emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 0); 1906 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_resolve_with_base);1915 emitCTICall(instruction + i, i, Interpreter::cti_op_resolve_with_base); 1907 1916 emitPutVirtualRegister(instruction[i + 2].u.operand, X86::edx); 1908 1917 emitPutVirtualRegister(instruction[i + 1].u.operand); … … 1913 1922 FuncExprNode* func = (m_codeBlock->functionExpressions[instruction[i + 2].u.operand]).get(); 1914 1923 emitPutCTIArgConstant(reinterpret_cast<unsigned>(func), 0); 1915 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_new_func_exp);1924 emitCTICall(instruction + i, i, Interpreter::cti_op_new_func_exp); 1916 1925 emitPutVirtualRegister(instruction[i + 1].u.operand); 1917 1926 i += 3; … … 1937 1946 1938 1947 __ cmpl_i32r(asInteger(JSImmediate::zeroImmediate()), X86::eax); 1939 X86Assembler::JmpSrc isZero = __ emitUnlinkedJe();1948 JmpSrc isZero = __ emitUnlinkedJe(); 1940 1949 __ testl_i32r(JSImmediate::TagBitTypeInteger, X86::eax); 1941 1950 m_jmpTable.append(JmpTable(__ emitUnlinkedJne(), i + 2 + target)); … … 1990 1999 RegExp* regExp = m_codeBlock->regexps[instruction[i + 2].u.operand].get(); 1991 2000 emitPutCTIArgConstant(reinterpret_cast<unsigned>(regExp), 0); 1992 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_new_regexp);2001 emitCTICall(instruction + i, i, Interpreter::cti_op_new_regexp); 1993 2002 emitPutVirtualRegister(instruction[i + 1].u.operand); 1994 2003 i += 3; … … 2005 2014 case op_throw: { 2006 2015 emitPutCTIArgFromVirtualRegister(instruction[i + 1].u.operand, 0, X86::ecx); 2007 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_throw);2016 emitCTICall(instruction + i, i, Interpreter::cti_op_throw); 2008 2017 __ addl_i8r(0x20, X86::esp); 2009 2018 __ popl_r(X86::ebx); … … 2016 2025 case op_get_pnames: { 2017 2026 emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 0, X86::ecx); 2018 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_get_pnames);2027 emitCTICall(instruction + i, i, Interpreter::cti_op_get_pnames); 2019 2028 emitPutVirtualRegister(instruction[i + 1].u.operand); 2020 2029 i += 3; … … 2024 2033 emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 0, X86::ecx); 2025 2034 unsigned target = instruction[i + 3].u.operand; 2026 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_next_pname);2035 emitCTICall(instruction + i, i, Interpreter::cti_op_next_pname); 2027 2036 __ testl_rr(X86::eax, X86::eax); 2028 X86Assembler::JmpSrc endOfIter = __ emitUnlinkedJe();2037 JmpSrc endOfIter = __ emitUnlinkedJe(); 2029 2038 emitPutVirtualRegister(instruction[i + 1].u.operand); 2030 2039 m_jmpTable.append(JmpTable(__ emitUnlinkedJmp(), i + 3 + target)); … … 2035 2044 case op_push_scope: { 2036 2045 emitPutCTIArgFromVirtualRegister(instruction[i + 1].u.operand, 0, X86::ecx); 2037 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_push_scope);2046 emitCTICall(instruction + i, i, Interpreter::cti_op_push_scope); 2038 2047 i += 2; 2039 2048 break; 2040 2049 } 2041 2050 case op_pop_scope: { 2042 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_pop_scope);2051 emitCTICall(instruction + i, i, Interpreter::cti_op_pop_scope); 2043 2052 i += 1; 2044 2053 break; … … 2066 2075 2067 2076 __ testl_i32r(JSImmediate::TagBitTypeInteger, X86::eax); 2068 X86Assembler::JmpSrc wasImmediate = __ emitUnlinkedJnz();2077 JmpSrc wasImmediate = __ emitUnlinkedJnz(); 2069 2078 2070 2079 emitJumpSlowCaseIfNotJSCell(X86::eax, i, srcVReg); 2071 2080 2072 __ movl_mr( OBJECT_OFFSET(JSCell, m_structure), X86::eax, X86::ecx);2073 __ cmpl_i32m(NumberType, OBJECT_OFFSET(Structure, m_typeInfo.m_type), X86::ecx);2081 __ movl_mr(FIELD_OFFSET(JSCell, m_structure), X86::eax, X86::ecx); 2082 __ cmpl_i32m(NumberType, FIELD_OFFSET(Structure, m_typeInfo.m_type), X86::ecx); 2074 2083 2075 2084 m_slowCases.append(SlowCaseEntry(__ emitUnlinkedJne(), i)); … … 2084 2093 emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 0, X86::ecx); 2085 2094 emitPutCTIArgFromVirtualRegister(instruction[i + 3].u.operand, 4, X86::ecx); 2086 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_in);2095 emitCTICall(instruction + i, i, Interpreter::cti_op_in); 2087 2096 emitPutVirtualRegister(instruction[i + 1].u.operand); 2088 2097 i += 4; … … 2093 2102 emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 0); 2094 2103 emitPutCTIArgFromVirtualRegister(instruction[i + 3].u.operand, 4, X86::ecx); 2095 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_push_new_scope);2104 emitCTICall(instruction + i, i, Interpreter::cti_op_push_new_scope); 2096 2105 emitPutVirtualRegister(instruction[i + 1].u.operand); 2097 2106 i += 4; … … 2107 2116 unsigned count = instruction[i + 1].u.operand; 2108 2117 emitPutCTIArgConstant(count, 0); 2109 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_jmp_scopes);2118 emitCTICall(instruction + i, i, Interpreter::cti_op_jmp_scopes); 2110 2119 unsigned target = instruction[i + 2].u.operand; 2111 2120 m_jmpTable.append(JmpTable(__ emitUnlinkedJmp(), i + 2 + target)); … … 2117 2126 emitPutCTIArgConstant(instruction[i + 2].u.operand, 4); 2118 2127 emitPutCTIArgFromVirtualRegister(instruction[i + 3].u.operand, 8, X86::ecx); 2119 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_put_by_index);2128 emitCTICall(instruction + i, i, Interpreter::cti_op_put_by_index); 2120 2129 i += 4; 2121 2130 break; … … 2133 2142 emitPutCTIArgFromVirtualRegister(scrutinee, 0, X86::ecx); 2134 2143 emitPutCTIArgConstant(tableIndex, 4); 2135 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_switch_imm);2144 emitCTICall(instruction + i, i, Interpreter::cti_op_switch_imm); 2136 2145 __ jmp_r(X86::eax); 2137 2146 i += 4; … … 2150 2159 emitPutCTIArgFromVirtualRegister(scrutinee, 0, X86::ecx); 2151 2160 emitPutCTIArgConstant(tableIndex, 4); 2152 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_switch_char);2161 emitCTICall(instruction + i, i, Interpreter::cti_op_switch_char); 2153 2162 __ jmp_r(X86::eax); 2154 2163 i += 4; … … 2166 2175 emitPutCTIArgFromVirtualRegister(scrutinee, 0, X86::ecx); 2167 2176 emitPutCTIArgConstant(tableIndex, 4); 2168 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_switch_string);2177 emitCTICall(instruction + i, i, Interpreter::cti_op_switch_string); 2169 2178 __ jmp_r(X86::eax); 2170 2179 i += 4; … … 2174 2183 emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 0, X86::ecx); 2175 2184 emitPutCTIArgFromVirtualRegister(instruction[i + 3].u.operand, 4, X86::ecx); 2176 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_del_by_val);2185 emitCTICall(instruction + i, i, Interpreter::cti_op_del_by_val); 2177 2186 emitPutVirtualRegister(instruction[i + 1].u.operand); 2178 2187 i += 4; … … 2184 2193 emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 4); 2185 2194 emitPutCTIArgFromVirtualRegister(instruction[i + 3].u.operand, 8, X86::ecx); 2186 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_put_getter);2195 emitCTICall(instruction + i, i, Interpreter::cti_op_put_getter); 2187 2196 i += 4; 2188 2197 break; … … 2193 2202 emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 4); 2194 2203 emitPutCTIArgFromVirtualRegister(instruction[i + 3].u.operand, 8, X86::ecx); 2195 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_put_setter);2204 emitCTICall(instruction + i, i, Interpreter::cti_op_put_setter); 2196 2205 i += 4; 2197 2206 break; … … 2202 2211 emitPutCTIArgConstant(asInteger(message), 4); 2203 2212 emitPutCTIArgConstant(m_codeBlock->lineNumberForVPC(&instruction[i]), 8); 2204 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_new_error);2213 emitCTICall(instruction + i, i, Interpreter::cti_op_new_error); 2205 2214 emitPutVirtualRegister(instruction[i + 1].u.operand); 2206 2215 i += 4; … … 2211 2220 emitPutCTIArgConstant(instruction[i + 2].u.operand, 4); 2212 2221 emitPutCTIArgConstant(instruction[i + 3].u.operand, 8); 2213 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_debug);2222 emitCTICall(instruction + i, i, Interpreter::cti_op_debug); 2214 2223 i += 4; 2215 2224 break; … … 2221 2230 emitGetVirtualRegister(src1, X86::eax, i); 2222 2231 __ testl_i32r(JSImmediate::TagMask, X86::eax); 2223 X86Assembler::JmpSrc isImmediate = __ emitUnlinkedJnz();2224 2225 __ movl_mr( OBJECT_OFFSET(JSCell, m_structure), X86::eax, X86::ecx);2226 __ testl_i32m(MasqueradesAsUndefined, OBJECT_OFFSET(Structure, m_typeInfo.m_flags), X86::ecx);2232 JmpSrc isImmediate = __ emitUnlinkedJnz(); 2233 2234 __ movl_mr(FIELD_OFFSET(JSCell, m_structure), X86::eax, X86::ecx); 2235 __ testl_i32m(MasqueradesAsUndefined, FIELD_OFFSET(Structure, m_typeInfo.m_flags), X86::ecx); 2227 2236 __ setnz_r(X86::eax); 2228 2237 2229 X86Assembler::JmpSrc wasNotImmediate = __ emitUnlinkedJmp();2238 JmpSrc wasNotImmediate = __ emitUnlinkedJmp(); 2230 2239 2231 2240 __ link(isImmediate, __ label()); … … 2251 2260 emitGetVirtualRegister(src1, X86::eax, i); 2252 2261 __ testl_i32r(JSImmediate::TagMask, X86::eax); 2253 X86Assembler::JmpSrc isImmediate = __ emitUnlinkedJnz();2254 2255 __ movl_mr( OBJECT_OFFSET(JSCell, m_structure), X86::eax, X86::ecx);2256 __ testl_i32m(MasqueradesAsUndefined, OBJECT_OFFSET(Structure, m_typeInfo.m_flags), X86::ecx);2262 JmpSrc isImmediate = __ emitUnlinkedJnz(); 2263 2264 __ movl_mr(FIELD_OFFSET(JSCell, m_structure), X86::eax, X86::ecx); 2265 __ testl_i32m(MasqueradesAsUndefined, FIELD_OFFSET(Structure, m_typeInfo.m_flags), X86::ecx); 2257 2266 __ setz_r(X86::eax); 2258 2267 2259 X86Assembler::JmpSrc wasNotImmediate = __ emitUnlinkedJmp();2268 JmpSrc wasNotImmediate = __ emitUnlinkedJmp(); 2260 2269 2261 2270 __ link(isImmediate, __ label()); … … 2294 2303 emitInitRegister(j); 2295 2304 2296 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_push_activation);2305 emitCTICall(instruction + i, i, Interpreter::cti_op_push_activation); 2297 2306 emitPutVirtualRegister(instruction[i + 1].u.operand); 2298 2307 … … 2301 2310 } 2302 2311 case op_create_arguments: { 2303 emitCTICall(instruction + i, i, (m_codeBlock->numParameters == 1) ? BytecodeInterpreter::cti_op_create_arguments_no_params : BytecodeInterpreter::cti_op_create_arguments);2312 emitCTICall(instruction + i, i, (m_codeBlock->numParameters == 1) ? Interpreter::cti_op_create_arguments_no_params : Interpreter::cti_op_create_arguments); 2304 2313 i += 1; 2305 2314 break; … … 2309 2318 2310 2319 emitJumpSlowCaseIfNotJSCell(X86::eax, i); 2311 __ movl_mr( OBJECT_OFFSET(JSCell, m_structure), X86::eax, X86::edx);2312 __ testl_i32m(NeedsThisConversion, OBJECT_OFFSET(Structure, m_typeInfo.m_flags), X86::edx);2320 __ movl_mr(FIELD_OFFSET(JSCell, m_structure), X86::eax, X86::edx); 2321 __ testl_i32m(NeedsThisConversion, FIELD_OFFSET(Structure, m_typeInfo.m_flags), X86::edx); 2313 2322 m_slowCases.append(SlowCaseEntry(__ emitUnlinkedJnz(), i)); 2314 2323 … … 2319 2328 emitGetCTIParam(CTI_ARGS_profilerReference, X86::eax); 2320 2329 __ cmpl_i32m(0, X86::eax); 2321 X86Assembler::JmpSrc noProfiler = __ emitUnlinkedJe();2330 JmpSrc noProfiler = __ emitUnlinkedJe(); 2322 2331 emitPutCTIArgFromVirtualRegister(instruction[i + 1].u.operand, 0, X86::eax); 2323 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_profile_will_call);2332 emitCTICall(instruction + i, i, Interpreter::cti_op_profile_will_call); 2324 2333 __ link(noProfiler, __ label()); 2325 2334 … … 2330 2339 emitGetCTIParam(CTI_ARGS_profilerReference, X86::eax); 2331 2340 __ cmpl_i32m(0, X86::eax); 2332 X86Assembler::JmpSrc noProfiler = __ emitUnlinkedJe();2341 JmpSrc noProfiler = __ emitUnlinkedJe(); 2333 2342 emitPutCTIArgFromVirtualRegister(instruction[i + 1].u.operand, 0, X86::eax); 2334 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_profile_did_call);2343 emitCTICall(instruction + i, i, Interpreter::cti_op_profile_did_call); 2335 2344 __ link(noProfiler, __ label()); 2336 2345 … … 2369 2378 emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 0, X86::ecx); \ 2370 2379 emitPutCTIArgFromVirtualRegister(instruction[i + 3].u.operand, 4, X86::ecx); \ 2371 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_##name); \2380 emitCTICall(instruction + i, i, Interpreter::cti_##name); \ 2372 2381 emitPutVirtualRegister(instruction[i + 1].u.operand); \ 2373 2382 i += 4; \ … … 2381 2390 emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 0, X86::ecx); \ 2382 2391 emitPutCTIArgFromVirtualRegister(instruction[i + 3].u.operand, 4, X86::ecx); \ 2383 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_##name); \2392 emitCTICall(instruction + i, i, Interpreter::cti_##name); \ 2384 2393 emitPutVirtualRegister(instruction[i + 1].u.operand); \ 2385 2394 i += 4; \ … … 2407 2416 __ link((++iter)->from, __ label()); 2408 2417 emitPutCTIArg(X86::eax, 0); 2409 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_convert_this);2418 emitCTICall(instruction + i, i, Interpreter::cti_op_convert_this); 2410 2419 emitPutVirtualRegister(instruction[i + 1].u.operand); 2411 2420 i += 2; … … 2417 2426 unsigned src2 = instruction[i + 3].u.operand; 2418 2427 if (JSValue* value = getConstantImmediateNumericArg(src1)) { 2419 X86Assembler::JmpSrc notImm = iter->from;2428 JmpSrc notImm = iter->from; 2420 2429 __ link((++iter)->from, __ label()); 2421 2430 __ subl_i32r(getDeTaggedConstantImmediate(value), X86::eax); … … 2423 2432 emitPutCTIArgFromVirtualRegister(src1, 0, X86::ecx); 2424 2433 emitPutCTIArg(X86::eax, 4); 2425 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_add);2434 emitCTICall(instruction + i, i, Interpreter::cti_op_add); 2426 2435 emitPutVirtualRegister(dst); 2427 2436 } else if (JSValue* value = getConstantImmediateNumericArg(src2)) { 2428 X86Assembler::JmpSrc notImm = iter->from;2437 JmpSrc notImm = iter->from; 2429 2438 __ link((++iter)->from, __ label()); 2430 2439 __ subl_i32r(getDeTaggedConstantImmediate(value), X86::eax); … … 2432 2441 emitPutCTIArg(X86::eax, 0); 2433 2442 emitPutCTIArgFromVirtualRegister(src2, 4, X86::ecx); 2434 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_add);2443 emitCTICall(instruction + i, i, Interpreter::cti_op_add); 2435 2444 emitPutVirtualRegister(dst); 2436 2445 } else { … … 2447 2456 case op_get_by_val: { 2448 2457 // The slow case that handles accesses to arrays (below) may jump back up to here. 2449 X86Assembler::JmpDst beginGetByValSlow = __ label();2450 2451 X86Assembler::JmpSrc notImm = iter->from;2458 JmpDst beginGetByValSlow = __ label(); 2459 2460 JmpSrc notImm = iter->from; 2452 2461 __ link((++iter)->from, __ label()); 2453 2462 __ link((++iter)->from, __ label()); … … 2456 2465 emitPutCTIArg(X86::eax, 0); 2457 2466 emitPutCTIArg(X86::edx, 4); 2458 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_get_by_val);2467 emitCTICall(instruction + i, i, Interpreter::cti_op_get_by_val); 2459 2468 emitPutVirtualRegister(instruction[i + 1].u.operand); 2460 2469 __ link(__ emitUnlinkedJmp(), m_labels[i + 4]); … … 2463 2472 // First, check if this is an access to the vector 2464 2473 __ link((++iter)->from, __ label()); 2465 __ cmpl_rm(X86::edx, OBJECT_OFFSET(ArrayStorage, m_vectorLength), X86::ecx);2474 __ cmpl_rm(X86::edx, FIELD_OFFSET(ArrayStorage, m_vectorLength), X86::ecx); 2466 2475 __ link(__ emitUnlinkedJbe(), beginGetByValSlow); 2467 2476 2468 2477 // okay, missed the fast region, but it is still in the vector. Get the value. 2469 __ movl_mr( OBJECT_OFFSET(ArrayStorage, m_vector[0]), X86::ecx, X86::edx, sizeof(JSValue*), X86::ecx);2478 __ movl_mr(FIELD_OFFSET(ArrayStorage, m_vector[0]), X86::ecx, X86::edx, sizeof(JSValue*), X86::ecx); 2470 2479 // Check whether the value loaded is zero; if so we need to return undefined. 2471 2480 __ testl_rr(X86::ecx, X86::ecx); … … 2493 2502 2494 2503 emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 0, X86::ecx); 2495 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_negate);2504 emitCTICall(instruction + i, i, Interpreter::cti_op_negate); 2496 2505 emitPutVirtualRegister(instruction[i + 1].u.operand); 2497 2506 i += 4; … … 2503 2512 emitPutCTIArg(X86::eax, 0); 2504 2513 emitPutCTIArg(X86::ecx, 4); 2505 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_rshift);2514 emitCTICall(instruction + i, i, Interpreter::cti_op_rshift); 2506 2515 emitPutVirtualRegister(instruction[i + 1].u.operand); 2507 2516 i += 4; … … 2509 2518 } 2510 2519 case op_lshift: { 2511 X86Assembler::JmpSrc notImm1 = iter->from;2512 X86Assembler::JmpSrc notImm2 = (++iter)->from;2520 JmpSrc notImm1 = iter->from; 2521 JmpSrc notImm2 = (++iter)->from; 2513 2522 __ link((++iter)->from, __ label()); 2514 2523 emitGetVirtualRegisters(instruction[i + 2].u.operand, X86::eax, instruction[i + 3].u.operand, X86::ecx, i); … … 2517 2526 emitPutCTIArg(X86::eax, 0); 2518 2527 emitPutCTIArg(X86::ecx, 4); 2519 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_lshift);2528 emitCTICall(instruction + i, i, Interpreter::cti_op_lshift); 2520 2529 emitPutVirtualRegister(instruction[i + 1].u.operand); 2521 2530 i += 4; … … 2531 2540 emitPutCTIArg(X86::edx, 0); 2532 2541 emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 4, X86::ecx); 2533 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_loop_if_less);2542 emitCTICall(instruction + i, i, Interpreter::cti_op_loop_if_less); 2534 2543 __ testl_rr(X86::eax, X86::eax); 2535 2544 __ link(__ emitUnlinkedJne(), m_labels[i + 3 + target]); … … 2539 2548 emitPutCTIArg(X86::eax, 0); 2540 2549 emitPutCTIArg(X86::edx, 4); 2541 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_loop_if_less);2550 emitCTICall(instruction + i, i, Interpreter::cti_op_loop_if_less); 2542 2551 __ testl_rr(X86::eax, X86::eax); 2543 2552 __ link(__ emitUnlinkedJne(), m_labels[i + 3 + target]); … … 2555 2564 emitPutCTIArg(X86::eax, 0); 2556 2565 emitPutCTIArg(X86::edx, 8); 2557 X86Assembler::JmpSrc call = emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_put_by_id);2566 JmpSrc call = emitCTICall(instruction + i, i, Interpreter::cti_op_put_by_id); 2558 2567 2559 2568 // Track the location of the call; this will be used to recover repatch information. … … 2577 2586 2578 2587 #ifndef NDEBUG 2579 X86Assembler::JmpDst coldPathBegin = __ label();2588 JmpDst coldPathBegin = __ label(); 2580 2589 #endif 2581 2590 emitPutCTIArg(X86::eax, 0); 2582 2591 Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 3].u.operand]); 2583 2592 emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 4); 2584 X86Assembler::JmpSrc call = emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_get_by_id);2585 ASSERT( X86Assembler::getDifferenceBetweenLabels(coldPathBegin, call) == repatchOffsetGetByIdSlowCaseCall);2593 JmpSrc call = emitCTICall(instruction + i, i, Interpreter::cti_op_get_by_id); 2594 ASSERT(__ getDifferenceBetweenLabels(coldPathBegin, call) == repatchOffsetGetByIdSlowCaseCall); 2586 2595 emitPutVirtualRegister(instruction[i + 1].u.operand); 2587 2596 … … 2603 2612 emitPutCTIArg(X86::edx, 0); 2604 2613 emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 4, X86::ecx); 2605 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_loop_if_lesseq);2614 emitCTICall(instruction + i, i, Interpreter::cti_op_loop_if_lesseq); 2606 2615 __ testl_rr(X86::eax, X86::eax); 2607 2616 __ link(__ emitUnlinkedJne(), m_labels[i + 3 + target]); … … 2611 2620 emitPutCTIArg(X86::eax, 0); 2612 2621 emitPutCTIArg(X86::edx, 4); 2613 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_loop_if_lesseq);2622 emitCTICall(instruction + i, i, Interpreter::cti_op_loop_if_lesseq); 2614 2623 __ testl_rr(X86::eax, X86::eax); 2615 2624 __ link(__ emitUnlinkedJne(), m_labels[i + 3 + target]); … … 2620 2629 case op_pre_inc: { 2621 2630 unsigned srcDst = instruction[i + 1].u.operand; 2622 X86Assembler::JmpSrc notImm = iter->from;2631 JmpSrc notImm = iter->from; 2623 2632 __ link((++iter)->from, __ label()); 2624 2633 __ subl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), X86::eax); 2625 2634 __ link(notImm, __ label()); 2626 2635 emitPutCTIArg(X86::eax, 0); 2627 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_pre_inc);2636 emitCTICall(instruction + i, i, Interpreter::cti_op_pre_inc); 2628 2637 emitPutVirtualRegister(srcDst); 2629 2638 i += 2; … … 2632 2641 case op_put_by_val: { 2633 2642 // Normal slow cases - either is not an immediate imm, or is an array. 2634 X86Assembler::JmpSrc notImm = iter->from;2643 JmpSrc notImm = iter->from; 2635 2644 __ link((++iter)->from, __ label()); 2636 2645 __ link((++iter)->from, __ label()); … … 2641 2650 emitPutCTIArg(X86::edx, 4); 2642 2651 emitPutCTIArg(X86::ecx, 8); 2643 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_put_by_val);2652 emitCTICall(instruction + i, i, Interpreter::cti_op_put_by_val); 2644 2653 __ link(__ emitUnlinkedJmp(), m_labels[i + 4]); 2645 2654 … … 2651 2660 emitPutCTIArg(X86::edx, 4); 2652 2661 emitPutCTIArg(X86::ecx, 8); 2653 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_put_by_val_array);2662 emitCTICall(instruction + i, i, Interpreter::cti_op_put_by_val_array); 2654 2663 2655 2664 i += 4; … … 2661 2670 __ link(iter->from, __ label()); 2662 2671 emitPutCTIArg(X86::eax, 0); 2663 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_jtrue);2672 emitCTICall(instruction + i, i, Interpreter::cti_op_jtrue); 2664 2673 __ testl_rr(X86::eax, X86::eax); 2665 2674 unsigned target = instruction[i + 2].u.operand; … … 2670 2679 case op_pre_dec: { 2671 2680 unsigned srcDst = instruction[i + 1].u.operand; 2672 X86Assembler::JmpSrc notImm = iter->from;2681 JmpSrc notImm = iter->from; 2673 2682 __ link((++iter)->from, __ label()); 2674 2683 __ addl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), X86::eax); 2675 2684 __ link(notImm, __ label()); 2676 2685 emitPutCTIArg(X86::eax, 0); 2677 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_pre_dec);2686 emitCTICall(instruction + i, i, Interpreter::cti_op_pre_dec); 2678 2687 emitPutVirtualRegister(srcDst); 2679 2688 i += 2; … … 2687 2696 emitPutCTIArg(X86::edx, 0); 2688 2697 emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 4, X86::ecx); 2689 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_jless);2698 emitCTICall(instruction + i, i, Interpreter::cti_op_jless); 2690 2699 __ testl_rr(X86::eax, X86::eax); 2691 2700 __ link(__ emitUnlinkedJe(), m_labels[i + 3 + target]); … … 2695 2704 emitPutCTIArg(X86::eax, 0); 2696 2705 emitPutCTIArg(X86::edx, 4); 2697 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_jless);2706 emitCTICall(instruction + i, i, Interpreter::cti_op_jless); 2698 2707 __ testl_rr(X86::eax, X86::eax); 2699 2708 __ link(__ emitUnlinkedJe(), m_labels[i + 3 + target]); … … 2706 2715 __ xorl_i8r(JSImmediate::FullTagTypeBool, X86::eax); 2707 2716 emitPutCTIArg(X86::eax, 0); 2708 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_not);2717 emitCTICall(instruction + i, i, Interpreter::cti_op_not); 2709 2718 emitPutVirtualRegister(instruction[i + 1].u.operand); 2710 2719 i += 3; … … 2714 2723 __ link(iter->from, __ label()); 2715 2724 emitPutCTIArg(X86::eax, 0); 2716 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_jtrue);2725 emitCTICall(instruction + i, i, Interpreter::cti_op_jtrue); 2717 2726 __ testl_rr(X86::eax, X86::eax); 2718 2727 unsigned target = instruction[i + 2].u.operand; … … 2726 2735 __ link((++iter)->from, __ label()); 2727 2736 emitPutCTIArg(X86::eax, 0); 2728 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_post_inc);2737 emitCTICall(instruction + i, i, Interpreter::cti_op_post_inc); 2729 2738 emitPutVirtualRegister(srcDst, X86::edx); 2730 2739 emitPutVirtualRegister(instruction[i + 1].u.operand); … … 2735 2744 __ link(iter->from, __ label()); 2736 2745 emitPutCTIArg(X86::eax, 0); 2737 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_bitnot);2746 emitCTICall(instruction + i, i, Interpreter::cti_op_bitnot); 2738 2747 emitPutVirtualRegister(instruction[i + 1].u.operand); 2739 2748 i += 3; … … 2748 2757 emitPutCTIArgFromVirtualRegister(src1, 0, X86::ecx); 2749 2758 emitPutCTIArg(X86::eax, 4); 2750 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_bitand);2759 emitCTICall(instruction + i, i, Interpreter::cti_op_bitand); 2751 2760 emitPutVirtualRegister(dst); 2752 2761 } else if (getConstantImmediateNumericArg(src2)) { … … 2754 2763 emitPutCTIArg(X86::eax, 0); 2755 2764 emitPutCTIArgFromVirtualRegister(src2, 4, X86::ecx); 2756 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_bitand);2765 emitCTICall(instruction + i, i, Interpreter::cti_op_bitand); 2757 2766 emitPutVirtualRegister(dst); 2758 2767 } else { … … 2760 2769 emitPutCTIArgFromVirtualRegister(src1, 0, X86::ecx); 2761 2770 emitPutCTIArg(X86::edx, 4); 2762 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_bitand);2771 emitCTICall(instruction + i, i, Interpreter::cti_op_bitand); 2763 2772 emitPutVirtualRegister(dst); 2764 2773 } … … 2769 2778 __ link(iter->from, __ label()); 2770 2779 emitPutCTIArg(X86::eax, 0); 2771 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_jtrue);2780 emitCTICall(instruction + i, i, Interpreter::cti_op_jtrue); 2772 2781 __ testl_rr(X86::eax, X86::eax); 2773 2782 unsigned target = instruction[i + 2].u.operand; … … 2781 2790 __ link((++iter)->from, __ label()); 2782 2791 emitPutCTIArg(X86::eax, 0); 2783 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_post_dec);2792 emitCTICall(instruction + i, i, Interpreter::cti_op_post_dec); 2784 2793 emitPutVirtualRegister(srcDst, X86::edx); 2785 2794 emitPutVirtualRegister(instruction[i + 1].u.operand); … … 2791 2800 emitPutCTIArg(X86::eax, 0); 2792 2801 emitPutCTIArg(X86::edx, 4); 2793 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_bitxor);2802 emitCTICall(instruction + i, i, Interpreter::cti_op_bitxor); 2794 2803 emitPutVirtualRegister(instruction[i + 1].u.operand); 2795 2804 i += 5; … … 2800 2809 emitPutCTIArg(X86::eax, 0); 2801 2810 emitPutCTIArg(X86::edx, 4); 2802 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_bitor);2811 emitCTICall(instruction + i, i, Interpreter::cti_op_bitor); 2803 2812 emitPutVirtualRegister(instruction[i + 1].u.operand); 2804 2813 i += 5; … … 2809 2818 emitPutCTIArg(X86::eax, 0); 2810 2819 emitPutCTIArg(X86::edx, 4); 2811 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_eq);2820 emitCTICall(instruction + i, i, Interpreter::cti_op_eq); 2812 2821 emitPutVirtualRegister(instruction[i + 1].u.operand); 2813 2822 i += 4; … … 2818 2827 emitPutCTIArg(X86::eax, 0); 2819 2828 emitPutCTIArg(X86::edx, 4); 2820 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_neq);2829 emitCTICall(instruction + i, i, Interpreter::cti_op_neq); 2821 2830 emitPutVirtualRegister(instruction[i + 1].u.operand); 2822 2831 i += 4; … … 2832 2841 emitPutCTIArgFromVirtualRegister(instruction[i + 3].u.operand, 4, X86::ecx); 2833 2842 emitPutCTIArgFromVirtualRegister(instruction[i + 4].u.operand, 8, X86::ecx); 2834 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_instanceof);2843 emitCTICall(instruction + i, i, Interpreter::cti_op_instanceof); 2835 2844 emitPutVirtualRegister(instruction[i + 1].u.operand); 2836 2845 i += 5; … … 2838 2847 } 2839 2848 case op_mod: { 2840 X86Assembler::JmpSrc notImm1 = iter->from;2841 X86Assembler::JmpSrc notImm2 = (++iter)->from;2849 JmpSrc notImm1 = iter->from; 2850 JmpSrc notImm2 = (++iter)->from; 2842 2851 __ link((++iter)->from, __ label()); 2843 2852 emitFastArithReTagImmediate(X86::eax); … … 2847 2856 emitPutCTIArg(X86::eax, 0); 2848 2857 emitPutCTIArg(X86::ecx, 4); 2849 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_mod);2858 emitCTICall(instruction + i, i, Interpreter::cti_op_mod); 2850 2859 emitPutVirtualRegister(instruction[i + 1].u.operand); 2851 2860 i += 4; … … 2865 2874 emitPutCTIArgFromVirtualRegister(src1, 0, X86::ecx); 2866 2875 emitPutCTIArgFromVirtualRegister(src2, 4, X86::ecx); 2867 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_mul);2876 emitCTICall(instruction + i, i, Interpreter::cti_op_mul); 2868 2877 emitPutVirtualRegister(dst); 2869 2878 } else if (src2Value && ((value = JSImmediate::intValue(src2Value)) > 0)) { … … 2873 2882 emitPutCTIArgFromVirtualRegister(src1, 0, X86::ecx); 2874 2883 emitPutCTIArgFromVirtualRegister(src2, 4, X86::ecx); 2875 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_mul);2884 emitCTICall(instruction + i, i, Interpreter::cti_op_mul); 2876 2885 emitPutVirtualRegister(dst); 2877 2886 } else … … 2899 2908 // Fast check for JS function. 2900 2909 __ testl_i32r(JSImmediate::TagMask, X86::ecx); 2901 X86Assembler::JmpSrc callLinkFailNotObject = __ emitUnlinkedJne();2910 JmpSrc callLinkFailNotObject = __ emitUnlinkedJne(); 2902 2911 __ cmpl_i32m(reinterpret_cast<unsigned>(m_interpreter->m_jsFunctionVptr), X86::ecx); 2903 X86Assembler::JmpSrc callLinkFailNotJSFunction = __ emitUnlinkedJne();2912 JmpSrc callLinkFailNotJSFunction = __ emitUnlinkedJne(); 2904 2913 2905 2914 // First, in the case of a construct, allocate the new object. 2906 2915 if (opcodeID == op_construct) { 2907 emitCTICall(instruction, i, BytecodeInterpreter::cti_op_construct_JSConstruct);2916 emitCTICall(instruction, i, Interpreter::cti_op_construct_JSConstruct); 2908 2917 emitPutVirtualRegister(registerOffset - RegisterFile::CallFrameHeaderSize - argCount); 2909 2918 emitGetVirtualRegister(callee, X86::ecx, i); … … 2919 2928 emitNakedCall(i, m_interpreter->m_ctiVirtualCallPreLink); 2920 2929 2921 X86Assembler::JmpSrc storeResultForFirstRun = __ emitUnlinkedJmp();2930 JmpSrc storeResultForFirstRun = __ emitUnlinkedJmp(); 2922 2931 2923 2932 // This is the address for the cold path *after* the first run (which tries to link the call). … … 2932 2941 // Check for JSFunctions. 2933 2942 __ testl_i32r(JSImmediate::TagMask, X86::ecx); 2934 X86Assembler::JmpSrc isNotObject = __ emitUnlinkedJne();2943 JmpSrc isNotObject = __ emitUnlinkedJne(); 2935 2944 __ cmpl_i32m(reinterpret_cast<unsigned>(m_interpreter->m_jsFunctionVptr), X86::ecx); 2936 X86Assembler::JmpSrc isJSFunction = __ emitUnlinkedJe();2945 JmpSrc isJSFunction = __ emitUnlinkedJe(); 2937 2946 2938 2947 // This handles host functions 2939 X86Assembler::JmpDst notJSFunctionlabel = __ label();2948 JmpDst notJSFunctionlabel = __ label(); 2940 2949 __ link(isNotObject, notJSFunctionlabel); 2941 2950 __ link(callLinkFailNotObject, notJSFunctionlabel); 2942 2951 __ link(callLinkFailNotJSFunction, notJSFunctionlabel); 2943 emitCTICall(instruction + i, i, ((opcodeID == op_construct) ? BytecodeInterpreter::cti_op_construct_NotJSConstruct : BytecodeInterpreter::cti_op_call_NotJSFunction));2944 X86Assembler::JmpSrc wasNotJSFunction = __ emitUnlinkedJmp();2952 emitCTICall(instruction + i, i, ((opcodeID == op_construct) ? Interpreter::cti_op_construct_NotJSConstruct : Interpreter::cti_op_call_NotJSFunction)); 2953 JmpSrc wasNotJSFunction = __ emitUnlinkedJmp(); 2945 2954 2946 2955 // Next, handle JSFunctions... … … 2949 2958 // First, in the case of a construct, allocate the new object. 2950 2959 if (opcodeID == op_construct) { 2951 emitCTICall(instruction, i, BytecodeInterpreter::cti_op_construct_JSConstruct);2960 emitCTICall(instruction, i, Interpreter::cti_op_construct_JSConstruct); 2952 2961 emitPutVirtualRegister(registerOffset - RegisterFile::CallFrameHeaderSize - argCount); 2953 2962 emitGetVirtualRegister(callee, X86::ecx, i); … … 2962 2971 2963 2972 // Put the return value in dst. In the interpreter, op_ret does this. 2964 X86Assembler::JmpDst storeResult = __ label();2973 JmpDst storeResult = __ label(); 2965 2974 __ link(wasNotJSFunction, storeResult); 2966 2975 __ link(storeResultForFirstRun, storeResult); … … 2981 2990 2982 2991 emitPutCTIArg(X86::eax, 0); 2983 emitCTICall(instruction + i, i, BytecodeInterpreter::cti_op_to_jsnumber);2992 emitCTICall(instruction + i, i, Interpreter::cti_op_to_jsnumber); 2984 2993 2985 2994 emitPutVirtualRegister(instruction[i + 1].u.operand); … … 3016 3025 emitPutToCallFrameHeader(X86::ecx, RegisterFile::ReturnPC); 3017 3026 3018 X86Assembler::JmpSrc slowRegisterFileCheck;3019 X86Assembler::JmpDst afterRegisterFileCheck;3027 JmpSrc slowRegisterFileCheck; 3028 JmpDst afterRegisterFileCheck; 3020 3029 if (m_codeBlock->codeType == FunctionCode) { 3021 3030 // In the case of a fast linked call, we do not set this up in the caller. … … 3024 3033 emitGetCTIParam(CTI_ARGS_registerFile, X86::eax); 3025 3034 __ leal_mr(m_codeBlock->numCalleeRegisters * sizeof(Register), X86::edi, X86::edx); 3026 __ cmpl_mr( OBJECT_OFFSET(RegisterFile, m_end), X86::eax, X86::edx);3035 __ cmpl_mr(FIELD_OFFSET(RegisterFile, m_end), X86::eax, X86::edx); 3027 3036 slowRegisterFileCheck = __ emitUnlinkedJg(); 3028 3037 afterRegisterFileCheck = __ label(); … … 3035 3044 if (m_codeBlock->codeType == FunctionCode) { 3036 3045 __ link(slowRegisterFileCheck, __ label()); 3037 emitCTICall(m_codeBlock->instructions.begin(), 0, BytecodeInterpreter::cti_register_file_check);3038 X86Assembler::JmpSrc backToBody = __ emitUnlinkedJmp();3046 emitCTICall(m_codeBlock->instructions.begin(), 0, Interpreter::cti_register_file_check); 3047 JmpSrc backToBody = __ emitUnlinkedJmp(); 3039 3048 __ link(backToBody, afterRegisterFileCheck); 3040 3049 } … … 3042 3051 ASSERT(m_jmpTable.isEmpty()); 3043 3052 3044 void* code = __ copy();3053 void* code = __ executableCopy(); 3045 3054 ASSERT(code); 3046 3055 … … 3078 3087 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) { 3079 3088 if (iter->to) 3080 X86Assembler::link(code, iter->from, iter->to);3089 __ link(code, iter->from, iter->to); 3081 3090 m_codeBlock->ctiReturnAddressVPCMap.add(__ getRelocatedAddress(code, iter->from), iter->bytecodeIndex); 3082 3091 } … … 3084 3093 // Link absolute addresses for jsr 3085 3094 for (Vector<JSRInfo>::iterator iter = m_jsrSites.begin(); iter != m_jsrSites.end(); ++iter) 3086 X86Assembler::linkAbsoluteAddress(code, iter->addrPosition, iter->target);3095 __ linkAbsoluteAddress(code, iter->addrPosition, iter->target); 3087 3096 3088 3097 for (unsigned i = 0; i < m_codeBlock->propertyAccessInstructions.size(); ++i) { 3089 3098 StructureStubInfo& info = m_codeBlock->propertyAccessInstructions[i]; 3090 info.callReturnLocation = X86Assembler::getRelocatedAddress(code, m_propertyAccessCompilationInfo[i].callReturnLocation);3091 info.hotPathBegin = X86Assembler::getRelocatedAddress(code, m_propertyAccessCompilationInfo[i].hotPathBegin);3099 info.callReturnLocation = __ getRelocatedAddress(code, m_propertyAccessCompilationInfo[i].callReturnLocation); 3100 info.hotPathBegin = __ getRelocatedAddress(code, m_propertyAccessCompilationInfo[i].hotPathBegin); 3092 3101 } 3093 3102 for (unsigned i = 0; i < m_codeBlock->callLinkInfos.size(); ++i) { 3094 3103 CallLinkInfo& info = m_codeBlock->callLinkInfos[i]; 3095 info.callReturnLocation = X86Assembler::getRelocatedAddress(code, m_callStructureStubCompilationInfo[i].callReturnLocation);3096 info.hotPathBegin = X86Assembler::getRelocatedAddress(code, m_callStructureStubCompilationInfo[i].hotPathBegin);3097 info.hotPathOther = X86Assembler::getRelocatedAddress(code, m_callStructureStubCompilationInfo[i].hotPathOther);3098 info.coldPathOther = X86Assembler::getRelocatedAddress(code, m_callStructureStubCompilationInfo[i].coldPathOther);3104 info.callReturnLocation = __ getRelocatedAddress(code, m_callStructureStubCompilationInfo[i].callReturnLocation); 3105 info.hotPathBegin = __ getRelocatedAddress(code, m_callStructureStubCompilationInfo[i].hotPathBegin); 3106 info.hotPathOther = __ getRelocatedAddress(code, m_callStructureStubCompilationInfo[i].hotPathOther); 3107 info.coldPathOther = __ getRelocatedAddress(code, m_callStructureStubCompilationInfo[i].coldPathOther); 3099 3108 } 3100 3109 … … 3106 3115 // Check eax is an object of the right Structure. 3107 3116 __ testl_i32r(JSImmediate::TagMask, X86::eax); 3108 X86Assembler::JmpSrc failureCases1 = __ emitUnlinkedJne();3109 __ cmpl_i32m(reinterpret_cast<uint32_t>(structure), OBJECT_OFFSET(JSCell, m_structure), X86::eax);3110 X86Assembler::JmpSrc failureCases2 = __ emitUnlinkedJne();3117 JmpSrc failureCases1 = __ emitUnlinkedJne(); 3118 __ cmpl_i32m(reinterpret_cast<uint32_t>(structure), FIELD_OFFSET(JSCell, m_structure), X86::eax); 3119 JmpSrc failureCases2 = __ emitUnlinkedJne(); 3111 3120 3112 3121 // Checks out okay! - getDirectOffset 3113 __ movl_mr( OBJECT_OFFSET(JSObject, m_propertyStorage), X86::eax, X86::eax);3122 __ movl_mr(FIELD_OFFSET(JSObject, m_propertyStorage), X86::eax, X86::eax); 3114 3123 __ movl_mr(cachedOffset * sizeof(JSValue*), X86::eax, X86::eax); 3115 3124 __ ret(); 3116 3125 3117 void* code = __ copy();3126 void* code = __ executableCopy(); 3118 3127 ASSERT(code); 3119 3128 3120 X86Assembler::link(code, failureCases1, reinterpret_cast<void*>(BytecodeInterpreter::cti_op_get_by_id_fail));3121 X86Assembler::link(code, failureCases2, reinterpret_cast<void*>(BytecodeInterpreter::cti_op_get_by_id_fail));3129 __ link(code, failureCases1, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_fail)); 3130 __ link(code, failureCases2, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_fail)); 3122 3131 3123 3132 m_codeBlock->getStubInfo(returnAddress).stubRoutine = code; … … 3132 3141 3133 3142 // We don't want to repatch more than once - in future go to cti_op_put_by_id_generic. 3134 ctiRepatchCallByReturnAddress(returnAddress, reinterpret_cast<void*>( BytecodeInterpreter::cti_op_get_by_id_fail));3143 ctiRepatchCallByReturnAddress(returnAddress, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_fail)); 3135 3144 3136 3145 // The prototype object definitely exists (if this stub exists the CodeBlock is referencing a Structure that is … … 3142 3151 // check eax is an object of the right Structure. 3143 3152 __ testl_i32r(JSImmediate::TagMask, X86::eax); 3144 X86Assembler::JmpSrc failureCases1 = __ emitUnlinkedJne();3145 __ cmpl_i32m(reinterpret_cast<uint32_t>(structure), OBJECT_OFFSET(JSCell, m_structure), X86::eax);3146 X86Assembler::JmpSrc failureCases2 = __ emitUnlinkedJne();3153 JmpSrc failureCases1 = __ emitUnlinkedJne(); 3154 __ cmpl_i32m(reinterpret_cast<uint32_t>(structure), FIELD_OFFSET(JSCell, m_structure), X86::eax); 3155 JmpSrc failureCases2 = __ emitUnlinkedJne(); 3147 3156 3148 3157 // Check the prototype object's Structure had not changed. 3149 3158 Structure** prototypeStructureAddress = &(protoObject->m_structure); 3150 3159 __ cmpl_i32m(reinterpret_cast<uint32_t>(prototypeStructure), static_cast<void*>(prototypeStructureAddress)); 3151 X86Assembler::JmpSrc failureCases3 = __ emitUnlinkedJne();3160 JmpSrc failureCases3 = __ emitUnlinkedJne(); 3152 3161 3153 3162 // Checks out okay! - getDirectOffset 3154 3163 __ movl_mr(cachedOffset * sizeof(JSValue*), X86::edx, X86::eax); 3155 3164 3156 X86Assembler::JmpSrc success = __ emitUnlinkedJmp();3157 3158 void* code = __ copy();3165 JmpSrc success = __ emitUnlinkedJmp(); 3166 3167 void* code = __ executableCopy(); 3159 3168 ASSERT(code); 3160 3169 3161 3170 // Use the repatch information to link the failure cases back to the original slow case routine. 3162 3171 void* slowCaseBegin = reinterpret_cast<char*>(info.callReturnLocation) - repatchOffsetGetByIdSlowCaseCall; 3163 X86Assembler::link(code, failureCases1, slowCaseBegin);3164 X86Assembler::link(code, failureCases2, slowCaseBegin);3165 X86Assembler::link(code, failureCases3, slowCaseBegin);3172 __ link(code, failureCases1, slowCaseBegin); 3173 __ link(code, failureCases2, slowCaseBegin); 3174 __ link(code, failureCases3, slowCaseBegin); 3166 3175 3167 3176 // On success return back to the hot patch code, at a point it will perform the store to dest for us. 3168 3177 intptr_t successDest = (intptr_t)(info.hotPathBegin) + repatchOffsetGetByIdPropertyMapOffset; 3169 X86Assembler::link(code, success, reinterpret_cast<void*>(successDest));3178 __ link(code, success, reinterpret_cast<void*>(successDest)); 3170 3179 3171 3180 // Track the stub we have created so that it will be deleted later. … … 3175 3184 // FIXME: should revert this repatching, on failure. 3176 3185 intptr_t jmpLocation = reinterpret_cast<intptr_t>(info.hotPathBegin) + repatchOffsetGetByIdBranchToSlowCase; 3177 X86Assembler::repatchBranchOffset(jmpLocation, code);3186 __ repatchBranchOffset(jmpLocation, code); 3178 3187 #else 3179 3188 // The prototype object definitely exists (if this stub exists the CodeBlock is referencing a Structure that is … … 3185 3194 // check eax is an object of the right Structure. 3186 3195 __ testl_i32r(JSImmediate::TagMask, X86::eax); 3187 X86Assembler::JmpSrc failureCases1 = __ emitUnlinkedJne();3188 __ cmpl_i32m(reinterpret_cast<uint32_t>(structure), OBJECT_OFFSET(JSCell, m_structure), X86::eax);3189 X86Assembler::JmpSrc failureCases2 = __ emitUnlinkedJne();3196 JmpSrc failureCases1 = __ emitUnlinkedJne(); 3197 __ cmpl_i32m(reinterpret_cast<uint32_t>(structure), FIELD_OFFSET(JSCell, m_structure), X86::eax); 3198 JmpSrc failureCases2 = __ emitUnlinkedJne(); 3190 3199 3191 3200 // Check the prototype object's Structure had not changed. 3192 3201 Structure** prototypeStructureAddress = &(protoObject->m_structure); 3193 3202 __ cmpl_i32m(reinterpret_cast<uint32_t>(prototypeStructure), static_cast<void*>(prototypeStructureAddress)); 3194 X86Assembler::JmpSrc failureCases3 = __ emitUnlinkedJne();3203 JmpSrc failureCases3 = __ emitUnlinkedJne(); 3195 3204 3196 3205 // Checks out okay! - getDirectOffset … … 3199 3208 __ ret(); 3200 3209 3201 void* code = __ copy();3210 void* code = __ executableCopy(); 3202 3211 ASSERT(code); 3203 3212 3204 X86Assembler::link(code, failureCases1, reinterpret_cast<void*>(BytecodeInterpreter::cti_op_get_by_id_fail));3205 X86Assembler::link(code, failureCases2, reinterpret_cast<void*>(BytecodeInterpreter::cti_op_get_by_id_fail));3206 X86Assembler::link(code, failureCases3, reinterpret_cast<void*>(BytecodeInterpreter::cti_op_get_by_id_fail));3213 __ link(code, failureCases1, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_fail)); 3214 __ link(code, failureCases2, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_fail)); 3215 __ link(code, failureCases3, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_fail)); 3207 3216 3208 3217 m_codeBlock->getStubInfo(returnAddress).stubRoutine = code; … … 3216 3225 ASSERT(count); 3217 3226 3218 Vector< X86Assembler::JmpSrc> bucketsOfFail;3227 Vector<JmpSrc> bucketsOfFail; 3219 3228 3220 3229 // Check eax is an object of the right Structure. 3221 3230 __ testl_i32r(JSImmediate::TagMask, X86::eax); 3222 3231 bucketsOfFail.append(__ emitUnlinkedJne()); 3223 __ cmpl_i32m(reinterpret_cast<uint32_t>(structure), OBJECT_OFFSET(JSCell, m_structure), X86::eax);3232 __ cmpl_i32m(reinterpret_cast<uint32_t>(structure), FIELD_OFFSET(JSCell, m_structure), X86::eax); 3224 3233 bucketsOfFail.append(__ emitUnlinkedJne()); 3225 3234 … … 3245 3254 bucketsOfFail.append(__ emitUnlinkedJmp()); 3246 3255 3247 void* code = __ copy();3256 void* code = __ executableCopy(); 3248 3257 ASSERT(code); 3249 3258 3250 3259 for (unsigned i = 0; i < bucketsOfFail.size(); ++i) 3251 X86Assembler::link(code, bucketsOfFail[i], reinterpret_cast<void*>(BytecodeInterpreter::cti_op_get_by_id_fail));3260 __ link(code, bucketsOfFail[i], reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_fail)); 3252 3261 3253 3262 m_codeBlock->getStubInfo(returnAddress).stubRoutine = code; … … 3260 3269 // check eax is an object of the right Structure. 3261 3270 __ testl_i32r(JSImmediate::TagMask, X86::eax); 3262 X86Assembler::JmpSrc failureCases1 = __ emitUnlinkedJne();3263 __ cmpl_i32m(reinterpret_cast<uint32_t>(structure), OBJECT_OFFSET(JSCell, m_structure), X86::eax);3264 X86Assembler::JmpSrc failureCases2 = __ emitUnlinkedJne();3271 JmpSrc failureCases1 = __ emitUnlinkedJne(); 3272 __ cmpl_i32m(reinterpret_cast<uint32_t>(structure), FIELD_OFFSET(JSCell, m_structure), X86::eax); 3273 JmpSrc failureCases2 = __ emitUnlinkedJne(); 3265 3274 3266 3275 // checks out okay! - putDirectOffset 3267 __ movl_mr( OBJECT_OFFSET(JSObject, m_propertyStorage), X86::eax, X86::eax);3276 __ movl_mr(FIELD_OFFSET(JSObject, m_propertyStorage), X86::eax, X86::eax); 3268 3277 __ movl_rm(X86::edx, cachedOffset * sizeof(JSValue*), X86::eax); 3269 3278 __ ret(); 3270 3279 3271 void* code = __ copy();3280 void* code = __ executableCopy(); 3272 3281 ASSERT(code); 3273 3282 3274 X86Assembler::link(code, failureCases1, reinterpret_cast<void*>(BytecodeInterpreter::cti_op_put_by_id_fail));3275 X86Assembler::link(code, failureCases2, reinterpret_cast<void*>(BytecodeInterpreter::cti_op_put_by_id_fail));3283 __ link(code, failureCases1, reinterpret_cast<void*>(Interpreter::cti_op_put_by_id_fail)); 3284 __ link(code, failureCases2, reinterpret_cast<void*>(Interpreter::cti_op_put_by_id_fail)); 3276 3285 3277 3286 m_codeBlock->getStubInfo(returnAddress).stubRoutine = code; … … 3297 3306 void CTI::privateCompilePutByIdTransition(Structure* oldStructure, Structure* newStructure, size_t cachedOffset, StructureChain* chain, void* returnAddress) 3298 3307 { 3299 Vector< X86Assembler::JmpSrc, 16> failureCases;3308 Vector<JmpSrc, 16> failureCases; 3300 3309 // check eax is an object of the right Structure. 3301 3310 __ testl_i32r(JSImmediate::TagMask, X86::eax); 3302 3311 failureCases.append(__ emitUnlinkedJne()); 3303 __ cmpl_i32m(reinterpret_cast<uint32_t>(oldStructure), OBJECT_OFFSET(JSCell, m_structure), X86::eax);3312 __ cmpl_i32m(reinterpret_cast<uint32_t>(oldStructure), FIELD_OFFSET(JSCell, m_structure), X86::eax); 3304 3313 failureCases.append(__ emitUnlinkedJne()); 3305 Vector< X86Assembler::JmpSrc> successCases;3314 Vector<JmpSrc> successCases; 3306 3315 3307 3316 // ecx = baseObject 3308 __ movl_mr( OBJECT_OFFSET(JSCell, m_structure), X86::eax, X86::ecx);3317 __ movl_mr(FIELD_OFFSET(JSCell, m_structure), X86::eax, X86::ecx); 3309 3318 // proto(ecx) = baseObject->structure()->prototype() 3310 __ cmpl_i32m(ObjectType, OBJECT_OFFSET(Structure, m_typeInfo) + OBJECT_OFFSET(TypeInfo, m_type), X86::ecx);3319 __ cmpl_i32m(ObjectType, FIELD_OFFSET(Structure, m_typeInfo) + FIELD_OFFSET(TypeInfo, m_type), X86::ecx); 3311 3320 failureCases.append(__ emitUnlinkedJne()); 3312 __ movl_mr( OBJECT_OFFSET(Structure, m_prototype), X86::ecx, X86::ecx);3321 __ movl_mr(FIELD_OFFSET(Structure, m_prototype), X86::ecx, X86::ecx); 3313 3322 3314 3323 // ecx = baseObject->m_structure … … 3319 3328 3320 3329 // Check the structure id 3321 __ cmpl_i32m(reinterpret_cast<uint32_t>(it->get()), OBJECT_OFFSET(JSCell, m_structure), X86::ecx);3330 __ cmpl_i32m(reinterpret_cast<uint32_t>(it->get()), FIELD_OFFSET(JSCell, m_structure), X86::ecx); 3322 3331 failureCases.append(__ emitUnlinkedJne()); 3323 3332 3324 __ movl_mr( OBJECT_OFFSET(JSCell, m_structure), X86::ecx, X86::ecx);3325 __ cmpl_i32m(ObjectType, OBJECT_OFFSET(Structure, m_typeInfo) + OBJECT_OFFSET(TypeInfo, m_type), X86::ecx);3333 __ movl_mr(FIELD_OFFSET(JSCell, m_structure), X86::ecx, X86::ecx); 3334 __ cmpl_i32m(ObjectType, FIELD_OFFSET(Structure, m_typeInfo) + FIELD_OFFSET(TypeInfo, m_type), X86::ecx); 3326 3335 failureCases.append(__ emitUnlinkedJne()); 3327 __ movl_mr( OBJECT_OFFSET(Structure, m_prototype), X86::ecx, X86::ecx);3336 __ movl_mr(FIELD_OFFSET(Structure, m_prototype), X86::ecx, X86::ecx); 3328 3337 } 3329 3338 … … 3332 3341 __ link(successCases[i], __ label()); 3333 3342 3334 X86Assembler::JmpSrc callTarget;3343 JmpSrc callTarget; 3335 3344 3336 3345 // emit a call only if storage realloc is needed … … 3349 3358 __ subl_i8m(1, reinterpret_cast<void*>(oldStructure)); 3350 3359 __ addl_i8m(1, reinterpret_cast<void*>(newStructure)); 3351 __ movl_i32m(reinterpret_cast<uint32_t>(newStructure), OBJECT_OFFSET(JSCell, m_structure), X86::eax);3360 __ movl_i32m(reinterpret_cast<uint32_t>(newStructure), FIELD_OFFSET(JSCell, m_structure), X86::eax); 3352 3361 3353 3362 // write the value 3354 __ movl_mr( OBJECT_OFFSET(JSObject, m_propertyStorage), X86::eax, X86::eax);3363 __ movl_mr(FIELD_OFFSET(JSObject, m_propertyStorage), X86::eax, X86::eax); 3355 3364 __ movl_rm(X86::edx, cachedOffset * sizeof(JSValue*), X86::eax); 3356 3365 3357 3366 __ ret(); 3358 3367 3359 X86Assembler::JmpSrc failureJump;3368 JmpSrc failureJump; 3360 3369 if (failureCases.size()) { 3361 3370 for (unsigned i = 0; i < failureCases.size(); ++i) … … 3365 3374 } 3366 3375 3367 void* code = __ copy();3376 void* code = __ executableCopy(); 3368 3377 ASSERT(code); 3369 3378 3370 3379 if (failureCases.size()) 3371 X86Assembler::link(code, failureJump, reinterpret_cast<void*>(BytecodeInterpreter::cti_op_put_by_id_fail));3380 __ link(code, failureJump, reinterpret_cast<void*>(Interpreter::cti_op_put_by_id_fail)); 3372 3381 3373 3382 if (transitionWillNeedStorageRealloc(oldStructure, newStructure)) 3374 X86Assembler::link(code, callTarget, reinterpret_cast<void*>(resizePropertyStorage));3383 __ link(code, callTarget, reinterpret_cast<void*>(resizePropertyStorage)); 3375 3384 3376 3385 m_codeBlock->getStubInfo(returnAddress).stubRoutine = code; … … 3410 3419 // Check eax is an array 3411 3420 __ testl_i32r(JSImmediate::TagMask, X86::eax); 3412 X86Assembler::JmpSrc array_failureCases1 = __ emitUnlinkedJne();3421 JmpSrc array_failureCases1 = __ emitUnlinkedJne(); 3413 3422 __ cmpl_i32m(reinterpret_cast<unsigned>(m_interpreter->m_jsArrayVptr), X86::eax); 3414 X86Assembler::JmpSrc array_failureCases2 = __ emitUnlinkedJne();3423 JmpSrc array_failureCases2 = __ emitUnlinkedJne(); 3415 3424 3416 3425 // Checks out okay! - get the length from the storage 3417 __ movl_mr( OBJECT_OFFSET(JSArray, m_storage), X86::eax, X86::eax);3418 __ movl_mr( OBJECT_OFFSET(ArrayStorage, m_length), X86::eax, X86::eax);3426 __ movl_mr(FIELD_OFFSET(JSArray, m_storage), X86::eax, X86::eax); 3427 __ movl_mr(FIELD_OFFSET(ArrayStorage, m_length), X86::eax, X86::eax); 3419 3428 3420 3429 __ addl_rr(X86::eax, X86::eax); 3421 X86Assembler::JmpSrc array_failureCases3 = __ emitUnlinkedJo();3430 JmpSrc array_failureCases3 = __ emitUnlinkedJo(); 3422 3431 __ addl_i8r(1, X86::eax); 3423 3432 … … 3426 3435 // (2) The second function provides fast property access for string length 3427 3436 3428 X86Assembler::JmpDst stringLengthBegin = __ align(16);3437 JmpDst stringLengthBegin = __ align(16); 3429 3438 3430 3439 // Check eax is a string 3431 3440 __ testl_i32r(JSImmediate::TagMask, X86::eax); 3432 X86Assembler::JmpSrc string_failureCases1 = __ emitUnlinkedJne();3441 JmpSrc string_failureCases1 = __ emitUnlinkedJne(); 3433 3442 __ cmpl_i32m(reinterpret_cast<unsigned>(m_interpreter->m_jsStringVptr), X86::eax); 3434 X86Assembler::JmpSrc string_failureCases2 = __ emitUnlinkedJne();3443 JmpSrc string_failureCases2 = __ emitUnlinkedJne(); 3435 3444 3436 3445 // Checks out okay! - get the length from the Ustring. 3437 __ movl_mr( OBJECT_OFFSET(JSString, m_value) + OBJECT_OFFSET(UString, m_rep), X86::eax, X86::eax);3438 __ movl_mr( OBJECT_OFFSET(UString::Rep, len), X86::eax, X86::eax);3446 __ movl_mr(FIELD_OFFSET(JSString, m_value) + FIELD_OFFSET(UString, m_rep), X86::eax, X86::eax); 3447 __ movl_mr(FIELD_OFFSET(UString::Rep, len), X86::eax, X86::eax); 3439 3448 3440 3449 __ addl_rr(X86::eax, X86::eax); 3441 X86Assembler::JmpSrc string_failureCases3 = __ emitUnlinkedJo();3450 JmpSrc string_failureCases3 = __ emitUnlinkedJo(); 3442 3451 __ addl_i8r(1, X86::eax); 3443 3452 … … 3446 3455 // (3) Trampolines for the slow cases of op_call / op_call_eval / op_construct. 3447 3456 3448 X86Assembler::JmpDst virtualCallPreLinkBegin = __ align(16);3457 JmpDst virtualCallPreLinkBegin = __ align(16); 3449 3458 3450 3459 // Load the callee CodeBlock* into eax 3451 __ movl_mr( OBJECT_OFFSET(JSFunction, m_body), X86::ecx, X86::eax);3452 __ movl_mr( OBJECT_OFFSET(FunctionBodyNode, m_code), X86::eax, X86::eax);3460 __ movl_mr(FIELD_OFFSET(JSFunction, m_body), X86::ecx, X86::eax); 3461 __ movl_mr(FIELD_OFFSET(FunctionBodyNode, m_code), X86::eax, X86::eax); 3453 3462 __ testl_rr(X86::eax, X86::eax); 3454 X86Assembler::JmpSrc hasCodeBlock1 = __ emitUnlinkedJne();3463 JmpSrc hasCodeBlock1 = __ emitUnlinkedJne(); 3455 3464 __ popl_r(X86::ebx); 3456 3465 __ emitRestoreArgumentReference(); 3457 3466 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 3458 X86Assembler::JmpSrc callJSFunction1 = __ emitCall();3467 JmpSrc callJSFunction1 = __ emitCall(); 3459 3468 emitGetCTIArg(0, X86::ecx); 3460 3469 emitGetCTIArg(8, X86::edx); … … 3463 3472 3464 3473 // Check argCount matches callee arity. 3465 __ cmpl_rm(X86::edx, OBJECT_OFFSET(CodeBlock, numParameters), X86::eax);3466 X86Assembler::JmpSrc arityCheckOkay1 = __ emitUnlinkedJe();3474 __ cmpl_rm(X86::edx, FIELD_OFFSET(CodeBlock, numParameters), X86::eax); 3475 JmpSrc arityCheckOkay1 = __ emitUnlinkedJe(); 3467 3476 __ popl_r(X86::ebx); 3468 3477 emitPutCTIArg(X86::ebx, 4); … … 3470 3479 __ emitRestoreArgumentReference(); 3471 3480 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 3472 X86Assembler::JmpSrc callArityCheck1 = __ emitCall();3481 JmpSrc callArityCheck1 = __ emitCall(); 3473 3482 __ movl_rr(X86::edx, X86::edi); 3474 3483 emitGetCTIArg(0, X86::ecx); … … 3483 3492 __ emitRestoreArgumentReference(); 3484 3493 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 3485 X86Assembler::JmpSrc callDontLazyLinkCall = __ emitCall();3494 JmpSrc callDontLazyLinkCall = __ emitCall(); 3486 3495 __ pushl_r(X86::ebx); 3487 3496 3488 3497 __ jmp_r(X86::eax); 3489 3498 3490 X86Assembler::JmpDst virtualCallLinkBegin = __ align(16);3499 JmpDst virtualCallLinkBegin = __ align(16); 3491 3500 3492 3501 // Load the callee CodeBlock* into eax 3493 __ movl_mr( OBJECT_OFFSET(JSFunction, m_body), X86::ecx, X86::eax);3494 __ movl_mr( OBJECT_OFFSET(FunctionBodyNode, m_code), X86::eax, X86::eax);3502 __ movl_mr(FIELD_OFFSET(JSFunction, m_body), X86::ecx, X86::eax); 3503 __ movl_mr(FIELD_OFFSET(FunctionBodyNode, m_code), X86::eax, X86::eax); 3495 3504 __ testl_rr(X86::eax, X86::eax); 3496 X86Assembler::JmpSrc hasCodeBlock2 = __ emitUnlinkedJne();3505 JmpSrc hasCodeBlock2 = __ emitUnlinkedJne(); 3497 3506 __ popl_r(X86::ebx); 3498 3507 __ emitRestoreArgumentReference(); 3499 3508 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 3500 X86Assembler::JmpSrc callJSFunction2 = __ emitCall();3509 JmpSrc callJSFunction2 = __ emitCall(); 3501 3510 emitGetCTIArg(0, X86::ecx); 3502 3511 emitGetCTIArg(8, X86::edx); … … 3505 3514 3506 3515 // Check argCount matches callee arity. 3507 __ cmpl_rm(X86::edx, OBJECT_OFFSET(CodeBlock, numParameters), X86::eax);3508 X86Assembler::JmpSrc arityCheckOkay2 = __ emitUnlinkedJe();3516 __ cmpl_rm(X86::edx, FIELD_OFFSET(CodeBlock, numParameters), X86::eax); 3517 JmpSrc arityCheckOkay2 = __ emitUnlinkedJe(); 3509 3518 __ popl_r(X86::ebx); 3510 3519 emitPutCTIArg(X86::ebx, 4); … … 3512 3521 __ emitRestoreArgumentReference(); 3513 3522 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 3514 X86Assembler::JmpSrc callArityCheck2 = __ emitCall();3523 JmpSrc callArityCheck2 = __ emitCall(); 3515 3524 __ movl_rr(X86::edx, X86::edi); 3516 3525 emitGetCTIArg(0, X86::ecx); … … 3525 3534 __ emitRestoreArgumentReference(); 3526 3535 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 3527 X86Assembler::JmpSrc callLazyLinkCall = __ emitCall();3536 JmpSrc callLazyLinkCall = __ emitCall(); 3528 3537 __ pushl_r(X86::ebx); 3529 3538 3530 3539 __ jmp_r(X86::eax); 3531 3540 3532 X86Assembler::JmpDst virtualCallBegin = __ align(16);3541 JmpDst virtualCallBegin = __ align(16); 3533 3542 3534 3543 // Load the callee CodeBlock* into eax 3535 __ movl_mr( OBJECT_OFFSET(JSFunction, m_body), X86::ecx, X86::eax);3536 __ movl_mr( OBJECT_OFFSET(FunctionBodyNode, m_code), X86::eax, X86::eax);3544 __ movl_mr(FIELD_OFFSET(JSFunction, m_body), X86::ecx, X86::eax); 3545 __ movl_mr(FIELD_OFFSET(FunctionBodyNode, m_code), X86::eax, X86::eax); 3537 3546 __ testl_rr(X86::eax, X86::eax); 3538 X86Assembler::JmpSrc hasCodeBlock3 = __ emitUnlinkedJne();3547 JmpSrc hasCodeBlock3 = __ emitUnlinkedJne(); 3539 3548 __ popl_r(X86::ebx); 3540 3549 __ emitRestoreArgumentReference(); 3541 3550 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 3542 X86Assembler::JmpSrc callJSFunction3 = __ emitCall();3551 JmpSrc callJSFunction3 = __ emitCall(); 3543 3552 emitGetCTIArg(0, X86::ecx); 3544 3553 emitGetCTIArg(8, X86::edx); … … 3547 3556 3548 3557 // Check argCount matches callee arity. 3549 __ cmpl_rm(X86::edx, OBJECT_OFFSET(CodeBlock, numParameters), X86::eax);3550 X86Assembler::JmpSrc arityCheckOkay3 = __ emitUnlinkedJe();3558 __ cmpl_rm(X86::edx, FIELD_OFFSET(CodeBlock, numParameters), X86::eax); 3559 JmpSrc arityCheckOkay3 = __ emitUnlinkedJe(); 3551 3560 __ popl_r(X86::ebx); 3552 3561 emitPutCTIArg(X86::ebx, 4); … … 3554 3563 __ emitRestoreArgumentReference(); 3555 3564 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 3556 X86Assembler::JmpSrc callArityCheck3 = __ emitCall();3565 JmpSrc callArityCheck3 = __ emitCall(); 3557 3566 __ movl_rr(X86::edx, X86::edi); 3558 3567 emitGetCTIArg(0, X86::ecx); … … 3564 3573 3565 3574 // load ctiCode from the new codeBlock. 3566 __ movl_mr( OBJECT_OFFSET(CodeBlock, ctiCode), X86::eax, X86::eax);3575 __ movl_mr(FIELD_OFFSET(CodeBlock, ctiCode), X86::eax, X86::eax); 3567 3576 3568 3577 __ jmp_r(X86::eax); … … 3570 3579 // All trampolines constructed! copy the code, link up calls, and set the pointers on the Machine object. 3571 3580 3572 void* code = __ copy();3581 void* code = __ executableCopy(); 3573 3582 ASSERT(code); 3574 3583 3575 X86Assembler::link(code, array_failureCases1, reinterpret_cast<void*>(BytecodeInterpreter::cti_op_get_by_id_fail));3576 X86Assembler::link(code, array_failureCases2, reinterpret_cast<void*>(BytecodeInterpreter::cti_op_get_by_id_fail));3577 X86Assembler::link(code, array_failureCases3, reinterpret_cast<void*>(BytecodeInterpreter::cti_op_get_by_id_fail));3578 X86Assembler::link(code, string_failureCases1, reinterpret_cast<void*>(BytecodeInterpreter::cti_op_get_by_id_fail));3579 X86Assembler::link(code, string_failureCases2, reinterpret_cast<void*>(BytecodeInterpreter::cti_op_get_by_id_fail));3580 X86Assembler::link(code, string_failureCases3, reinterpret_cast<void*>(BytecodeInterpreter::cti_op_get_by_id_fail));3581 X86Assembler::link(code, callArityCheck1, reinterpret_cast<void*>(BytecodeInterpreter::cti_op_call_arityCheck));3582 X86Assembler::link(code, callArityCheck2, reinterpret_cast<void*>(BytecodeInterpreter::cti_op_call_arityCheck));3583 X86Assembler::link(code, callArityCheck3, reinterpret_cast<void*>(BytecodeInterpreter::cti_op_call_arityCheck));3584 X86Assembler::link(code, callJSFunction1, reinterpret_cast<void*>(BytecodeInterpreter::cti_op_call_JSFunction));3585 X86Assembler::link(code, callJSFunction2, reinterpret_cast<void*>(BytecodeInterpreter::cti_op_call_JSFunction));3586 X86Assembler::link(code, callJSFunction3, reinterpret_cast<void*>(BytecodeInterpreter::cti_op_call_JSFunction));3587 X86Assembler::link(code, callDontLazyLinkCall, reinterpret_cast<void*>(BytecodeInterpreter::cti_vm_dontLazyLinkCall));3588 X86Assembler::link(code, callLazyLinkCall, reinterpret_cast<void*>(BytecodeInterpreter::cti_vm_lazyLinkCall));3584 __ link(code, array_failureCases1, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_fail)); 3585 __ link(code, array_failureCases2, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_fail)); 3586 __ link(code, array_failureCases3, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_fail)); 3587 __ link(code, string_failureCases1, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_fail)); 3588 __ link(code, string_failureCases2, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_fail)); 3589 __ link(code, string_failureCases3, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_fail)); 3590 __ link(code, callArityCheck1, reinterpret_cast<void*>(Interpreter::cti_op_call_arityCheck)); 3591 __ link(code, callArityCheck2, reinterpret_cast<void*>(Interpreter::cti_op_call_arityCheck)); 3592 __ link(code, callArityCheck3, reinterpret_cast<void*>(Interpreter::cti_op_call_arityCheck)); 3593 __ link(code, callJSFunction1, reinterpret_cast<void*>(Interpreter::cti_op_call_JSFunction)); 3594 __ link(code, callJSFunction2, reinterpret_cast<void*>(Interpreter::cti_op_call_JSFunction)); 3595 __ link(code, callJSFunction3, reinterpret_cast<void*>(Interpreter::cti_op_call_JSFunction)); 3596 __ link(code, callDontLazyLinkCall, reinterpret_cast<void*>(Interpreter::cti_vm_dontLazyLinkCall)); 3597 __ link(code, callLazyLinkCall, reinterpret_cast<void*>(Interpreter::cti_vm_lazyLinkCall)); 3589 3598 3590 3599 m_interpreter->m_ctiArrayLengthTrampoline = code; 3591 m_interpreter->m_ctiStringLengthTrampoline = X86Assembler::getRelocatedAddress(code, stringLengthBegin);3592 m_interpreter->m_ctiVirtualCallPreLink = X86Assembler::getRelocatedAddress(code, virtualCallPreLinkBegin);3593 m_interpreter->m_ctiVirtualCallLink = X86Assembler::getRelocatedAddress(code, virtualCallLinkBegin);3594 m_interpreter->m_ctiVirtualCall = X86Assembler::getRelocatedAddress(code, virtualCallBegin);3595 } 3596 3597 void CTI::freeCTIMachineTrampolines( BytecodeInterpreter* interpreter)3600 m_interpreter->m_ctiStringLengthTrampoline = __ getRelocatedAddress(code, stringLengthBegin); 3601 m_interpreter->m_ctiVirtualCallPreLink = __ getRelocatedAddress(code, virtualCallPreLinkBegin); 3602 m_interpreter->m_ctiVirtualCallLink = __ getRelocatedAddress(code, virtualCallLinkBegin); 3603 m_interpreter->m_ctiVirtualCall = __ getRelocatedAddress(code, virtualCallBegin); 3604 } 3605 3606 void CTI::freeCTIMachineTrampolines(Interpreter* interpreter) 3598 3607 { 3599 3608 WTF::fastFreeExecutable(interpreter->m_ctiArrayLengthTrampoline); … … 3605 3614 3606 3615 // We don't want to repatch more than once - in future go to cti_op_get_by_id_generic. 3607 // Should probably go to BytecodeInterpreter::cti_op_get_by_id_fail, but that doesn't do anything interesting right now.3608 ctiRepatchCallByReturnAddress(returnAddress, reinterpret_cast<void*>( BytecodeInterpreter::cti_op_get_by_id_generic));3616 // Should probably go to Interpreter::cti_op_get_by_id_fail, but that doesn't do anything interesting right now. 3617 ctiRepatchCallByReturnAddress(returnAddress, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_generic)); 3609 3618 3610 3619 // Repatch the offset into the propoerty map to load from, then repatch the Structure to look for. … … 3618 3627 3619 3628 // We don't want to repatch more than once - in future go to cti_op_put_by_id_generic. 3620 // Should probably go to BytecodeInterpreter::cti_op_put_by_id_fail, but that doesn't do anything interesting right now.3621 ctiRepatchCallByReturnAddress(returnAddress, reinterpret_cast<void*>( BytecodeInterpreter::cti_op_put_by_id_generic));3629 // Should probably go to Interpreter::cti_op_put_by_id_fail, but that doesn't do anything interesting right now. 3630 ctiRepatchCallByReturnAddress(returnAddress, reinterpret_cast<void*>(Interpreter::cti_op_put_by_id_generic)); 3622 3631 3623 3632 // Repatch the offset into the propoerty map to load from, then repatch the Structure to look for. … … 3631 3640 3632 3641 // We don't want to repatch more than once - in future go to cti_op_put_by_id_generic. 3633 ctiRepatchCallByReturnAddress(returnAddress, reinterpret_cast<void*>( BytecodeInterpreter::cti_op_get_by_id_fail));3642 ctiRepatchCallByReturnAddress(returnAddress, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_fail)); 3634 3643 3635 3644 // Check eax is an array 3636 3645 __ testl_i32r(JSImmediate::TagMask, X86::eax); 3637 X86Assembler::JmpSrc failureCases1 = __ emitUnlinkedJne();3646 JmpSrc failureCases1 = __ emitUnlinkedJne(); 3638 3647 __ cmpl_i32m(reinterpret_cast<unsigned>(m_interpreter->m_jsArrayVptr), X86::eax); 3639 X86Assembler::JmpSrc failureCases2 = __ emitUnlinkedJne();3648 JmpSrc failureCases2 = __ emitUnlinkedJne(); 3640 3649 3641 3650 // Checks out okay! - get the length from the storage 3642 __ movl_mr( OBJECT_OFFSET(JSArray, m_storage), X86::eax, X86::ecx);3643 __ movl_mr( OBJECT_OFFSET(ArrayStorage, m_length), X86::ecx, X86::ecx);3651 __ movl_mr(FIELD_OFFSET(JSArray, m_storage), X86::eax, X86::ecx); 3652 __ movl_mr(FIELD_OFFSET(ArrayStorage, m_length), X86::ecx, X86::ecx); 3644 3653 3645 3654 __ cmpl_i32r(JSImmediate::maxImmediateInt, X86::ecx); 3646 X86Assembler::JmpSrc failureCases3 = __ emitUnlinkedJa();3655 JmpSrc failureCases3 = __ emitUnlinkedJa(); 3647 3656 3648 3657 __ addl_rr(X86::ecx, X86::ecx); 3649 3658 __ addl_i8r(1, X86::ecx); 3650 3659 __ movl_rr(X86::ecx, X86::eax); 3651 X86Assembler::JmpSrc success = __ emitUnlinkedJmp();3652 3653 void* code = __ copy();3660 JmpSrc success = __ emitUnlinkedJmp(); 3661 3662 void* code = __ executableCopy(); 3654 3663 ASSERT(code); 3655 3664 3656 3665 // Use the repatch information to link the failure cases back to the original slow case routine. 3657 3666 void* slowCaseBegin = reinterpret_cast<char*>(info.callReturnLocation) - repatchOffsetGetByIdSlowCaseCall; 3658 X86Assembler::link(code, failureCases1, slowCaseBegin);3659 X86Assembler::link(code, failureCases2, slowCaseBegin);3660 X86Assembler::link(code, failureCases3, slowCaseBegin);3667 __ link(code, failureCases1, slowCaseBegin); 3668 __ link(code, failureCases2, slowCaseBegin); 3669 __ link(code, failureCases3, slowCaseBegin); 3661 3670 3662 3671 // On success return back to the hot patch code, at a point it will perform the store to dest for us. 3663 3672 intptr_t successDest = (intptr_t)(info.hotPathBegin) + repatchOffsetGetByIdPropertyMapOffset; 3664 X86Assembler::link(code, success, reinterpret_cast<void*>(successDest));3673 __ link(code, success, reinterpret_cast<void*>(successDest)); 3665 3674 3666 3675 // Track the stub we have created so that it will be deleted later. … … 3670 3679 // FIXME: should revert this repatching, on failure. 3671 3680 intptr_t jmpLocation = reinterpret_cast<intptr_t>(info.hotPathBegin) + repatchOffsetGetByIdBranchToSlowCase; 3672 X86Assembler::repatchBranchOffset(jmpLocation, code);3673 } 3674 3675 void CTI::emitGetVariableObjectRegister( X86Assembler::RegisterID variableObject, int index, X86Assembler::RegisterID dst)3676 { 3677 __ movl_mr( JSVariableObject::offsetOf_d(), variableObject, dst);3678 __ movl_mr( JSVariableObject::offsetOf_Data_registers(), dst, dst);3681 __ repatchBranchOffset(jmpLocation, code); 3682 } 3683 3684 void CTI::emitGetVariableObjectRegister(RegisterID variableObject, int index, RegisterID dst) 3685 { 3686 __ movl_mr(FIELD_OFFSET(JSVariableObject, d), variableObject, dst); 3687 __ movl_mr(FIELD_OFFSET(JSVariableObject::JSVariableObjectData, registers), dst, dst); 3679 3688 __ movl_mr(index * sizeof(Register), dst, dst); 3680 3689 } 3681 3690 3682 void CTI::emitPutVariableObjectRegister( X86Assembler::RegisterID src, X86Assembler::RegisterID variableObject, int index)3683 { 3684 __ movl_mr( JSVariableObject::offsetOf_d(), variableObject, variableObject);3685 __ movl_mr( JSVariableObject::offsetOf_Data_registers(), variableObject, variableObject);3691 void CTI::emitPutVariableObjectRegister(RegisterID src, RegisterID variableObject, int index) 3692 { 3693 __ movl_mr(FIELD_OFFSET(JSVariableObject, d), variableObject, src); 3694 __ movl_mr(FIELD_OFFSET(JSVariableObject::JSVariableObjectData, registers), src, src); 3686 3695 __ movl_rm(src, index * sizeof(Register), variableObject); 3687 3696 } -
trunk/JavaScriptCore/VM/CTI.h
r38440 r38461 97 97 class CodeBlock; 98 98 class JSPropertyNameIterator; 99 class BytecodeInterpreter;99 class Interpreter; 100 100 class Register; 101 101 class RegisterFile; … … 118 118 119 119 struct CallRecord { 120 X86Assembler::JmpSrc from; 120 typedef X86Assembler::JmpSrc JmpSrc; 121 122 JmpSrc from; 121 123 void* to; 122 124 unsigned bytecodeIndex; … … 126 128 } 127 129 128 CallRecord( X86Assembler::JmpSrc f, CTIHelper_j t, unsigned i)129 : from(f) 130 , to(reinterpret_cast<void*>(t)) 131 , bytecodeIndex(i) 132 { 133 } 134 135 CallRecord( X86Assembler::JmpSrc f, CTIHelper_o t, unsigned i)136 : from(f) 137 , to(reinterpret_cast<void*>(t)) 138 , bytecodeIndex(i) 139 { 140 } 141 142 CallRecord( X86Assembler::JmpSrc f, CTIHelper_p t, unsigned i)143 : from(f) 144 , to(reinterpret_cast<void*>(t)) 145 , bytecodeIndex(i) 146 { 147 } 148 149 CallRecord( X86Assembler::JmpSrc f, CTIHelper_v t, unsigned i)150 : from(f) 151 , to(reinterpret_cast<void*>(t)) 152 , bytecodeIndex(i) 153 { 154 } 155 156 CallRecord( X86Assembler::JmpSrc f, CTIHelper_s t, unsigned i)157 : from(f) 158 , to(reinterpret_cast<void*>(t)) 159 , bytecodeIndex(i) 160 { 161 } 162 163 CallRecord( X86Assembler::JmpSrc f, CTIHelper_b t, unsigned i)164 : from(f) 165 , to(reinterpret_cast<void*>(t)) 166 , bytecodeIndex(i) 167 { 168 } 169 170 CallRecord( X86Assembler::JmpSrc f, CTIHelper_2 t, unsigned i)171 : from(f) 172 , to(reinterpret_cast<void*>(t)) 173 , bytecodeIndex(i) 174 { 175 } 176 177 CallRecord( X86Assembler::JmpSrc f, unsigned i)130 CallRecord(JmpSrc f, CTIHelper_j t, unsigned i) 131 : from(f) 132 , to(reinterpret_cast<void*>(t)) 133 , bytecodeIndex(i) 134 { 135 } 136 137 CallRecord(JmpSrc f, CTIHelper_o t, unsigned i) 138 : from(f) 139 , to(reinterpret_cast<void*>(t)) 140 , bytecodeIndex(i) 141 { 142 } 143 144 CallRecord(JmpSrc f, CTIHelper_p t, unsigned i) 145 : from(f) 146 , to(reinterpret_cast<void*>(t)) 147 , bytecodeIndex(i) 148 { 149 } 150 151 CallRecord(JmpSrc f, CTIHelper_v t, unsigned i) 152 : from(f) 153 , to(reinterpret_cast<void*>(t)) 154 , bytecodeIndex(i) 155 { 156 } 157 158 CallRecord(JmpSrc f, CTIHelper_s t, unsigned i) 159 : from(f) 160 , to(reinterpret_cast<void*>(t)) 161 , bytecodeIndex(i) 162 { 163 } 164 165 CallRecord(JmpSrc f, CTIHelper_b t, unsigned i) 166 : from(f) 167 , to(reinterpret_cast<void*>(t)) 168 , bytecodeIndex(i) 169 { 170 } 171 172 CallRecord(JmpSrc f, CTIHelper_2 t, unsigned i) 173 : from(f) 174 , to(reinterpret_cast<void*>(t)) 175 , bytecodeIndex(i) 176 { 177 } 178 179 CallRecord(JmpSrc f, unsigned i) 178 180 : from(f) 179 181 , to(0) … … 184 186 185 187 struct JmpTable { 186 X86Assembler::JmpSrc from; 188 typedef X86Assembler::JmpSrc JmpSrc; 189 190 JmpSrc from; 187 191 unsigned to; 188 192 189 JmpTable( X86Assembler::JmpSrc f, unsigned t)193 JmpTable(JmpSrc f, unsigned t) 190 194 : from(f) 191 195 , to(t) … … 195 199 196 200 struct SlowCaseEntry { 197 X86Assembler::JmpSrc from; 201 typedef X86Assembler::JmpSrc JmpSrc; 202 203 JmpSrc from; 198 204 unsigned to; 199 205 unsigned hint; 200 206 201 SlowCaseEntry( X86Assembler::JmpSrc f, unsigned t, unsigned h = 0)207 SlowCaseEntry(JmpSrc f, unsigned t, unsigned h = 0) 202 208 : from(f) 203 209 , to(t) … … 242 248 243 249 struct StructureStubCompilationInfo { 244 X86Assembler::JmpSrc callReturnLocation; 245 X86Assembler::JmpDst hotPathBegin; 246 X86Assembler::JmpSrc hotPathOther; 247 X86Assembler::JmpDst coldPathOther; 250 typedef X86Assembler::JmpSrc JmpSrc; 251 typedef X86Assembler::JmpDst JmpDst; 252 253 JmpSrc callReturnLocation; 254 JmpDst hotPathBegin; 255 JmpSrc hotPathOther; 256 JmpDst coldPathOther; 248 257 }; 249 258 … … 257 266 258 267 class CTI { 268 typedef X86Assembler::JmpSrc JmpSrc; 269 typedef X86Assembler::JmpDst JmpDst; 270 typedef X86Assembler::RegisterID RegisterID; 271 typedef X86Assembler::XMMRegisterID XMMRegisterID; 272 259 273 static const int repatchGetByIdDefaultStructure = -1; 260 274 // Magic number - initial offset cannot be representable as a signed 8bit value, or the X86Assembler … … 325 339 cti.privateCompileCTIMachineTrampolines(); 326 340 } 327 static void freeCTIMachineTrampolines( BytecodeInterpreter*);341 static void freeCTIMachineTrampolines(Interpreter*); 328 342 329 343 static void patchGetByIdSelf(CodeBlock* codeBlock, Structure* structure, size_t cachedOffset, void* returnAddress); … … 367 381 enum CompileOpStrictEqType { OpStrictEq, OpNStrictEq }; 368 382 void compileOpStrictEq(Instruction* instruction, unsigned i, CompileOpStrictEqType type); 369 void putDoubleResultToJSNumberCellOrJSImmediate(X 86::XMMRegisterID xmmSource, X86::RegisterID jsNumberCell, unsigned dst, X86Assembler::JmpSrc* wroteJSNumberCell, X86::XMMRegisterID tempXmm, X86::RegisterID tempReg1, X86::RegisterID tempReg2);383 void putDoubleResultToJSNumberCellOrJSImmediate(XMMRegisterID xmmSource, RegisterID jsNumberCell, unsigned dst, JmpSrc* wroteJSNumberCell, XMMRegisterID tempXmm, RegisterID tempReg1, RegisterID tempReg2); 370 384 void compileBinaryArithOp(OpcodeID, unsigned dst, unsigned src1, unsigned src2, OperandTypes opi, unsigned i); 371 385 void compileBinaryArithOpSlowCase(Instruction*, OpcodeID, Vector<SlowCaseEntry>::iterator& iter, unsigned dst, unsigned src1, unsigned src2, OperandTypes opi, unsigned i); 372 386 373 void emitGetVirtualRegister(int src, X86Assembler::RegisterID dst, unsigned i);374 void emitGetVirtualRegisters(int src1, X86Assembler::RegisterID dst1, int src2, X86Assembler::RegisterID dst2, unsigned i);375 void emitPutVirtualRegister(unsigned dst, X86Assembler::RegisterID from = X86::eax);376 377 void emitPutCTIArg( X86Assembler::RegisterID src, unsigned offset);378 void emitPutCTIArgFromVirtualRegister(unsigned src, unsigned offset, X86Assembler::RegisterID scratch);387 void emitGetVirtualRegister(int src, RegisterID dst, unsigned i); 388 void emitGetVirtualRegisters(int src1, RegisterID dst1, int src2, RegisterID dst2, unsigned i); 389 void emitPutVirtualRegister(unsigned dst, RegisterID from = X86::eax); 390 391 void emitPutCTIArg(RegisterID src, unsigned offset); 392 void emitPutCTIArgFromVirtualRegister(unsigned src, unsigned offset, RegisterID scratch); 379 393 void emitPutCTIArgConstant(unsigned value, unsigned offset); 380 void emitGetCTIArg(unsigned offset, X86Assembler::RegisterID dst);394 void emitGetCTIArg(unsigned offset, RegisterID dst); 381 395 382 396 void emitInitRegister(unsigned dst); 383 397 384 398 void emitPutCTIParam(void* value, unsigned name); 385 void emitPutCTIParam( X86Assembler::RegisterID from, unsigned name);386 void emitGetCTIParam(unsigned name, X86Assembler::RegisterID to);387 388 void emitPutToCallFrameHeader( X86Assembler::RegisterID from, RegisterFile::CallFrameHeaderEntry entry);389 void emitGetFromCallFrameHeader(RegisterFile::CallFrameHeaderEntry entry, X86Assembler::RegisterID to);399 void emitPutCTIParam(RegisterID from, unsigned name); 400 void emitGetCTIParam(unsigned name, RegisterID to); 401 402 void emitPutToCallFrameHeader(RegisterID from, RegisterFile::CallFrameHeaderEntry entry); 403 void emitGetFromCallFrameHeader(RegisterFile::CallFrameHeaderEntry entry, RegisterID to); 390 404 391 405 JSValue* getConstantImmediateNumericArg(unsigned src); … … 393 407 394 408 bool linkSlowCaseIfNotJSCell(const Vector<SlowCaseEntry>::iterator&, int vReg); 395 void emitJumpSlowCaseIfNotJSCell( X86Assembler::RegisterID, unsigned bytecodeIndex);396 void emitJumpSlowCaseIfNotJSCell( X86Assembler::RegisterID, unsigned bytecodeIndex, int VReg);397 398 void emitJumpSlowCaseIfNotImmNum( X86Assembler::RegisterID, unsigned bytecodeIndex);399 void emitJumpSlowCaseIfNotImmNums( X86Assembler::RegisterID, X86Assembler::RegisterID, unsigned bytecodeIndex);400 401 void emitFastArithDeTagImmediate( X86Assembler::RegisterID);402 X86Assembler::JmpSrc emitFastArithDeTagImmediateJumpIfZero(X86Assembler::RegisterID);403 void emitFastArithReTagImmediate( X86Assembler::RegisterID);404 void emitFastArithPotentiallyReTagImmediate( X86Assembler::RegisterID);405 void emitFastArithImmToInt( X86Assembler::RegisterID);406 void emitFastArithIntToImmOrSlowCase( X86Assembler::RegisterID, unsigned bytecodeIndex);407 void emitFastArithIntToImmNoCheck( X86Assembler::RegisterID);408 X86Assembler::JmpSrc emitArithIntToImmWithJump(X86Assembler::RegisterID reg);409 410 void emitTagAsBoolImmediate( X86Assembler::RegisterID reg);409 void emitJumpSlowCaseIfNotJSCell(RegisterID, unsigned bytecodeIndex); 410 void emitJumpSlowCaseIfNotJSCell(RegisterID, unsigned bytecodeIndex, int VReg); 411 412 void emitJumpSlowCaseIfNotImmNum(RegisterID, unsigned bytecodeIndex); 413 void emitJumpSlowCaseIfNotImmNums(RegisterID, RegisterID, unsigned bytecodeIndex); 414 415 void emitFastArithDeTagImmediate(RegisterID); 416 JmpSrc emitFastArithDeTagImmediateJumpIfZero(RegisterID); 417 void emitFastArithReTagImmediate(RegisterID); 418 void emitFastArithPotentiallyReTagImmediate(RegisterID); 419 void emitFastArithImmToInt(RegisterID); 420 void emitFastArithIntToImmOrSlowCase(RegisterID, unsigned bytecodeIndex); 421 void emitFastArithIntToImmNoCheck(RegisterID); 422 JmpSrc emitArithIntToImmWithJump(RegisterID reg); 423 424 void emitTagAsBoolImmediate(RegisterID reg); 411 425 412 426 void emitAllocateNumber(JSGlobalData*, unsigned); 413 427 414 X86Assembler::JmpSrc emitNakedCall(unsigned bytecodeIndex, X86::RegisterID);415 X86Assembler::JmpSrc emitNakedCall(unsigned bytecodeIndex, void* function);416 X86Assembler::JmpSrc emitNakedFastCall(unsigned bytecodeIndex, void*);417 X86Assembler::JmpSrc emitCTICall(Instruction*, unsigned bytecodeIndex, CTIHelper_j);418 X86Assembler::JmpSrc emitCTICall(Instruction*, unsigned bytecodeIndex, CTIHelper_o);419 X86Assembler::JmpSrc emitCTICall(Instruction*, unsigned bytecodeIndex, CTIHelper_p);420 X86Assembler::JmpSrc emitCTICall(Instruction*, unsigned bytecodeIndex, CTIHelper_v);421 X86Assembler::JmpSrc emitCTICall(Instruction*, unsigned bytecodeIndex, CTIHelper_s);422 X86Assembler::JmpSrc emitCTICall(Instruction*, unsigned bytecodeIndex, CTIHelper_b);423 X86Assembler::JmpSrc emitCTICall(Instruction*, unsigned bytecodeIndex, CTIHelper_2);424 425 void emitGetVariableObjectRegister( X86Assembler::RegisterID variableObject, int index, X86Assembler::RegisterID dst);426 void emitPutVariableObjectRegister( X86Assembler::RegisterID src, X86Assembler::RegisterID variableObject, int index);428 JmpSrc emitNakedCall(unsigned bytecodeIndex, X86::RegisterID); 429 JmpSrc emitNakedCall(unsigned bytecodeIndex, void* function); 430 JmpSrc emitNakedFastCall(unsigned bytecodeIndex, void*); 431 JmpSrc emitCTICall(Instruction*, unsigned bytecodeIndex, CTIHelper_j); 432 JmpSrc emitCTICall(Instruction*, unsigned bytecodeIndex, CTIHelper_o); 433 JmpSrc emitCTICall(Instruction*, unsigned bytecodeIndex, CTIHelper_p); 434 JmpSrc emitCTICall(Instruction*, unsigned bytecodeIndex, CTIHelper_v); 435 JmpSrc emitCTICall(Instruction*, unsigned bytecodeIndex, CTIHelper_s); 436 JmpSrc emitCTICall(Instruction*, unsigned bytecodeIndex, CTIHelper_b); 437 JmpSrc emitCTICall(Instruction*, unsigned bytecodeIndex, CTIHelper_2); 438 439 void emitGetVariableObjectRegister(RegisterID variableObject, int index, RegisterID dst); 440 void emitPutVariableObjectRegister(RegisterID src, RegisterID variableObject, int index); 427 441 428 442 void emitSlowScriptCheck(Instruction*, unsigned bytecodeIndex); … … 434 448 435 449 X86Assembler m_assembler; 436 BytecodeInterpreter* m_interpreter;450 Interpreter* m_interpreter; 437 451 JSGlobalData* m_globalData; 438 452 CodeBlock* m_codeBlock; 439 453 440 454 Vector<CallRecord> m_calls; 441 Vector< X86Assembler::JmpDst> m_labels;455 Vector<JmpDst> m_labels; 442 456 Vector<StructureStubCompilationInfo> m_propertyAccessCompilationInfo; 443 457 Vector<StructureStubCompilationInfo> m_callStructureStubCompilationInfo; … … 445 459 446 460 struct JSRInfo { 447 X86Assembler::JmpDst addrPosition;448 X86Assembler::JmpDst target;449 450 JSRInfo(const X86Assembler::JmpDst& storeLocation, const X86Assembler::JmpDst& targetLocation)461 JmpDst addrPosition; 462 JmpDst target; 463 464 JSRInfo(const JmpDst& storeLocation, const JmpDst& targetLocation) 451 465 : addrPosition(storeLocation) 452 466 , target(targetLocation) -
trunk/JavaScriptCore/VM/CodeBlock.cpp
r38440 r38461 182 182 void CodeBlock::printStructures(const Instruction* vPC) const 183 183 { 184 BytecodeInterpreter* interpreter = globalData->interpreter;184 Interpreter* interpreter = globalData->interpreter; 185 185 unsigned instructionOffset = vPC - instructions.begin(); 186 186 … … 989 989 void CodeBlock::derefStructures(Instruction* vPC) const 990 990 { 991 BytecodeInterpreter* interpreter = globalData->interpreter;991 Interpreter* interpreter = globalData->interpreter; 992 992 993 993 if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_self)) { … … 1027 1027 void CodeBlock::refStructures(Instruction* vPC) const 1028 1028 { 1029 BytecodeInterpreter* interpreter = globalData->interpreter;1029 Interpreter* interpreter = globalData->interpreter; 1030 1030 1031 1031 if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_self)) { -
trunk/JavaScriptCore/VM/Machine.cpp
r38440 r38461 178 178 return n1 < n2; 179 179 180 BytecodeInterpreter* interpreter = callFrame->interpreter();180 Interpreter* interpreter = callFrame->interpreter(); 181 181 if (interpreter->isJSString(v1) && interpreter->isJSString(v2)) 182 182 return asString(v1)->value() < asString(v2)->value(); … … 203 203 return n1 <= n2; 204 204 205 BytecodeInterpreter* interpreter = callFrame->interpreter();205 Interpreter* interpreter = callFrame->interpreter(); 206 206 if (interpreter->isJSString(v1) && interpreter->isJSString(v2)) 207 207 return !(asString(v2)->value() < asString(v1)->value()); … … 324 324 } 325 325 326 NEVER_INLINE bool BytecodeInterpreter::resolve(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue)326 NEVER_INLINE bool Interpreter::resolve(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue) 327 327 { 328 328 int dst = (vPC + 1)->u.operand; … … 352 352 } 353 353 354 NEVER_INLINE bool BytecodeInterpreter::resolveSkip(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue)354 NEVER_INLINE bool Interpreter::resolveSkip(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue) 355 355 { 356 356 CodeBlock* codeBlock = callFrame->codeBlock(); … … 385 385 } 386 386 387 NEVER_INLINE bool BytecodeInterpreter::resolveGlobal(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue)387 NEVER_INLINE bool Interpreter::resolveGlobal(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue) 388 388 { 389 389 int dst = (vPC + 1)->u.operand; … … 448 448 } 449 449 450 NEVER_INLINE void BytecodeInterpreter::resolveBase(CallFrame* callFrame, Instruction* vPC)450 NEVER_INLINE void Interpreter::resolveBase(CallFrame* callFrame, Instruction* vPC) 451 451 { 452 452 int dst = (vPC + 1)->u.operand; … … 455 455 } 456 456 457 NEVER_INLINE bool BytecodeInterpreter::resolveBaseAndProperty(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue)457 NEVER_INLINE bool Interpreter::resolveBaseAndProperty(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue) 458 458 { 459 459 int baseDst = (vPC + 1)->u.operand; … … 491 491 } 492 492 493 NEVER_INLINE bool BytecodeInterpreter::resolveBaseAndFunc(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue)493 NEVER_INLINE bool Interpreter::resolveBaseAndFunc(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue) 494 494 { 495 495 int baseDst = (vPC + 1)->u.operand; … … 536 536 } 537 537 538 ALWAYS_INLINE CallFrame* BytecodeInterpreter::slideRegisterWindowForCall(CodeBlock* newCodeBlock, RegisterFile* registerFile, CallFrame* callFrame, size_t registerOffset, int argc)538 ALWAYS_INLINE CallFrame* Interpreter::slideRegisterWindowForCall(CodeBlock* newCodeBlock, RegisterFile* registerFile, CallFrame* callFrame, size_t registerOffset, int argc) 539 539 { 540 540 Register* r = callFrame->registers(); … … 581 581 } 582 582 583 NEVER_INLINE JSValue* BytecodeInterpreter::callEval(CallFrame* callFrame, RegisterFile* registerFile, Register* argv, int argc, int registerOffset, JSValue*& exceptionValue)583 NEVER_INLINE JSValue* Interpreter::callEval(CallFrame* callFrame, RegisterFile* registerFile, Register* argv, int argc, int registerOffset, JSValue*& exceptionValue) 584 584 { 585 585 if (argc < 2) … … 604 604 } 605 605 606 BytecodeInterpreter::BytecodeInterpreter()606 Interpreter::Interpreter() 607 607 : m_sampler(0) 608 608 #if ENABLE(CTI) … … 642 642 } 643 643 644 void BytecodeInterpreter::initialize(JSGlobalData* globalData)644 void Interpreter::initialize(JSGlobalData* globalData) 645 645 { 646 646 #if ENABLE(CTI) … … 651 651 } 652 652 653 BytecodeInterpreter::~BytecodeInterpreter()653 Interpreter::~Interpreter() 654 654 { 655 655 #if ENABLE(CTI) … … 660 660 #ifndef NDEBUG 661 661 662 void BytecodeInterpreter::dumpCallFrame(CallFrame* callFrame)662 void Interpreter::dumpCallFrame(CallFrame* callFrame) 663 663 { 664 664 callFrame->codeBlock()->dump(callFrame); … … 666 666 } 667 667 668 void BytecodeInterpreter::dumpRegisters(CallFrame* callFrame)668 void Interpreter::dumpRegisters(CallFrame* callFrame) 669 669 { 670 670 printf("Register frame: \n\n"); … … 744 744 #endif 745 745 746 bool BytecodeInterpreter::isOpcode(Opcode opcode)746 bool Interpreter::isOpcode(Opcode opcode) 747 747 { 748 748 #if HAVE(COMPUTED_GOTO) … … 755 755 } 756 756 757 NEVER_INLINE bool BytecodeInterpreter::unwindCallFrame(CallFrame*& callFrame, JSValue* exceptionValue, const Instruction*& vPC, CodeBlock*& codeBlock)757 NEVER_INLINE bool Interpreter::unwindCallFrame(CallFrame*& callFrame, JSValue* exceptionValue, const Instruction*& vPC, CodeBlock*& codeBlock) 758 758 { 759 759 CodeBlock* oldCodeBlock = codeBlock; … … 798 798 } 799 799 800 NEVER_INLINE Instruction* BytecodeInterpreter::throwException(CallFrame*& callFrame, JSValue*& exceptionValue, const Instruction* vPC, bool explicitThrow)800 NEVER_INLINE Instruction* Interpreter::throwException(CallFrame*& callFrame, JSValue*& exceptionValue, const Instruction* vPC, bool explicitThrow) 801 801 { 802 802 // Set up the exception object … … 897 897 }; 898 898 899 JSValue* BytecodeInterpreter::execute(ProgramNode* programNode, CallFrame* callFrame, ScopeChainNode* scopeChain, JSObject* thisObj, JSValue** exception)899 JSValue* Interpreter::execute(ProgramNode* programNode, CallFrame* callFrame, ScopeChainNode* scopeChain, JSObject* thisObj, JSValue** exception) 900 900 { 901 901 ASSERT(!scopeChain->globalData->exception); … … 958 958 } 959 959 960 JSValue* BytecodeInterpreter::execute(FunctionBodyNode* functionBodyNode, CallFrame* callFrame, JSFunction* function, JSObject* thisObj, const ArgList& args, ScopeChainNode* scopeChain, JSValue** exception)960 JSValue* Interpreter::execute(FunctionBodyNode* functionBodyNode, CallFrame* callFrame, JSFunction* function, JSObject* thisObj, const ArgList& args, ScopeChainNode* scopeChain, JSValue** exception) 961 961 { 962 962 ASSERT(!scopeChain->globalData->exception); … … 1020 1020 } 1021 1021 1022 JSValue* BytecodeInterpreter::execute(EvalNode* evalNode, CallFrame* callFrame, JSObject* thisObj, ScopeChainNode* scopeChain, JSValue** exception)1022 JSValue* Interpreter::execute(EvalNode* evalNode, CallFrame* callFrame, JSObject* thisObj, ScopeChainNode* scopeChain, JSValue** exception) 1023 1023 { 1024 1024 return execute(evalNode, callFrame, thisObj, m_registerFile.size() + evalNode->bytecode(scopeChain).numParameters + RegisterFile::CallFrameHeaderSize, scopeChain, exception); 1025 1025 } 1026 1026 1027 JSValue* BytecodeInterpreter::execute(EvalNode* evalNode, CallFrame* callFrame, JSObject* thisObj, int globalRegisterOffset, ScopeChainNode* scopeChain, JSValue** exception)1027 JSValue* Interpreter::execute(EvalNode* evalNode, CallFrame* callFrame, JSObject* thisObj, int globalRegisterOffset, ScopeChainNode* scopeChain, JSValue** exception) 1028 1028 { 1029 1029 ASSERT(!scopeChain->globalData->exception); … … 1112 1112 } 1113 1113 1114 NEVER_INLINE void BytecodeInterpreter::debug(CallFrame* callFrame, DebugHookID debugHookID, int firstLine, int lastLine)1114 NEVER_INLINE void Interpreter::debug(CallFrame* callFrame, DebugHookID debugHookID, int firstLine, int lastLine) 1115 1115 { 1116 1116 Debugger* debugger = callFrame->dynamicGlobalObject()->debugger(); … … 1140 1140 } 1141 1141 1142 void BytecodeInterpreter::resetTimeoutCheck()1142 void Interpreter::resetTimeoutCheck() 1143 1143 { 1144 1144 m_ticksUntilNextTimeoutCheck = initialTickCountThreshold; … … 1189 1189 // We have to return a JSValue here, gcc seems to produce worse code if 1190 1190 // we attempt to return a bool 1191 ALWAYS_INLINE JSValue* BytecodeInterpreter::checkTimeout(JSGlobalObject* globalObject)1191 ALWAYS_INLINE JSValue* Interpreter::checkTimeout(JSGlobalObject* globalObject) 1192 1192 { 1193 1193 unsigned currentTime = getCPUTime(); … … 1225 1225 } 1226 1226 1227 NEVER_INLINE ScopeChainNode* BytecodeInterpreter::createExceptionScope(CallFrame* callFrame, const Instruction* vPC)1227 NEVER_INLINE ScopeChainNode* Interpreter::createExceptionScope(CallFrame* callFrame, const Instruction* vPC) 1228 1228 { 1229 1229 int dst = (++vPC)->u.operand; … … 1247 1247 } 1248 1248 1249 NEVER_INLINE void BytecodeInterpreter::tryCachePutByID(CallFrame* callFrame, CodeBlock* codeBlock, Instruction* vPC, JSValue* baseValue, const PutPropertySlot& slot)1249 NEVER_INLINE void Interpreter::tryCachePutByID(CallFrame* callFrame, CodeBlock* codeBlock, Instruction* vPC, JSValue* baseValue, const PutPropertySlot& slot) 1250 1250 { 1251 1251 // Recursive invocation may already have specialized this instruction. … … 1317 1317 } 1318 1318 1319 NEVER_INLINE void BytecodeInterpreter::uncachePutByID(CodeBlock* codeBlock, Instruction* vPC)1319 NEVER_INLINE void Interpreter::uncachePutByID(CodeBlock* codeBlock, Instruction* vPC) 1320 1320 { 1321 1321 codeBlock->derefStructures(vPC); … … 1324 1324 } 1325 1325 1326 NEVER_INLINE void BytecodeInterpreter::tryCacheGetByID(CallFrame* callFrame, CodeBlock* codeBlock, Instruction* vPC, JSValue* baseValue, const Identifier& propertyName, const PropertySlot& slot)1326 NEVER_INLINE void Interpreter::tryCacheGetByID(CallFrame* callFrame, CodeBlock* codeBlock, Instruction* vPC, JSValue* baseValue, const Identifier& propertyName, const PropertySlot& slot) 1327 1327 { 1328 1328 // Recursive invocation may already have specialized this instruction. … … 1442 1442 } 1443 1443 1444 NEVER_INLINE void BytecodeInterpreter::uncacheGetByID(CodeBlock* codeBlock, Instruction* vPC)1444 NEVER_INLINE void Interpreter::uncacheGetByID(CodeBlock* codeBlock, Instruction* vPC) 1445 1445 { 1446 1446 codeBlock->derefStructures(vPC); … … 1449 1449 } 1450 1450 1451 JSValue* BytecodeInterpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFile, CallFrame* callFrame, JSValue** exception)1451 JSValue* Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFile, CallFrame* callFrame, JSValue** exception) 1452 1452 { 1453 1453 // One-time initialization of our address tables. We have to put this code … … 3986 3986 } 3987 3987 3988 JSValue* BytecodeInterpreter::retrieveArguments(CallFrame* callFrame, JSFunction* function) const3988 JSValue* Interpreter::retrieveArguments(CallFrame* callFrame, JSFunction* function) const 3989 3989 { 3990 3990 CallFrame* functionCallFrame = findFunctionCallFrame(callFrame, function); … … 4010 4010 } 4011 4011 4012 JSValue* BytecodeInterpreter::retrieveCaller(CallFrame* callFrame, InternalFunction* function) const4012 JSValue* Interpreter::retrieveCaller(CallFrame* callFrame, InternalFunction* function) const 4013 4013 { 4014 4014 CallFrame* functionCallFrame = findFunctionCallFrame(callFrame, function); … … 4027 4027 } 4028 4028 4029 void BytecodeInterpreter::retrieveLastCaller(CallFrame* callFrame, int& lineNumber, intptr_t& sourceID, UString& sourceURL, JSValue*& function) const4029 void Interpreter::retrieveLastCaller(CallFrame* callFrame, int& lineNumber, intptr_t& sourceID, UString& sourceURL, JSValue*& function) const 4030 4030 { 4031 4031 function = noValue(); … … 4048 4048 } 4049 4049 4050 CallFrame* BytecodeInterpreter::findFunctionCallFrame(CallFrame* callFrame, InternalFunction* function)4050 CallFrame* Interpreter::findFunctionCallFrame(CallFrame* callFrame, InternalFunction* function) 4051 4051 { 4052 4052 for (CallFrame* candidate = callFrame; candidate; candidate = candidate->callerFrame()->removeHostCallFrameFlag()) { … … 4059 4059 #if ENABLE(CTI) 4060 4060 4061 NEVER_INLINE void BytecodeInterpreter::tryCTICachePutByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const PutPropertySlot& slot)4061 NEVER_INLINE void Interpreter::tryCTICachePutByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const PutPropertySlot& slot) 4062 4062 { 4063 4063 // The interpreter checks for recursion here; I do not believe this can occur in CTI. … … 4128 4128 } 4129 4129 4130 NEVER_INLINE void BytecodeInterpreter::tryCTICacheGetByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const Identifier& propertyName, const PropertySlot& slot)4130 NEVER_INLINE void Interpreter::tryCTICacheGetByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const Identifier& propertyName, const PropertySlot& slot) 4131 4131 { 4132 4132 // FIXME: Write a test that proves we need to check for recursion here just … … 4345 4345 } while (0) 4346 4346 4347 JSObject* BytecodeInterpreter::cti_op_convert_this(CTI_ARGS)4347 JSObject* Interpreter::cti_op_convert_this(CTI_ARGS) 4348 4348 { 4349 4349 CTI_STACK_HACK(); … … 4357 4357 } 4358 4358 4359 void BytecodeInterpreter::cti_op_end(CTI_ARGS)4359 void Interpreter::cti_op_end(CTI_ARGS) 4360 4360 { 4361 4361 CTI_STACK_HACK(); … … 4366 4366 } 4367 4367 4368 JSValue* BytecodeInterpreter::cti_op_add(CTI_ARGS)4368 JSValue* Interpreter::cti_op_add(CTI_ARGS) 4369 4369 { 4370 4370 CTI_STACK_HACK(); … … 4411 4411 } 4412 4412 4413 JSValue* BytecodeInterpreter::cti_op_pre_inc(CTI_ARGS)4413 JSValue* Interpreter::cti_op_pre_inc(CTI_ARGS) 4414 4414 { 4415 4415 CTI_STACK_HACK(); … … 4423 4423 } 4424 4424 4425 void BytecodeInterpreter::cti_timeout_check(CTI_ARGS)4425 void Interpreter::cti_timeout_check(CTI_ARGS) 4426 4426 { 4427 4427 CTI_STACK_HACK(); … … 4433 4433 } 4434 4434 4435 void BytecodeInterpreter::cti_register_file_check(CTI_ARGS)4435 void Interpreter::cti_register_file_check(CTI_ARGS) 4436 4436 { 4437 4437 CTI_STACK_HACK(); … … 4447 4447 } 4448 4448 4449 int BytecodeInterpreter::cti_op_loop_if_less(CTI_ARGS)4449 int Interpreter::cti_op_loop_if_less(CTI_ARGS) 4450 4450 { 4451 4451 CTI_STACK_HACK(); … … 4460 4460 } 4461 4461 4462 int BytecodeInterpreter::cti_op_loop_if_lesseq(CTI_ARGS)4462 int Interpreter::cti_op_loop_if_lesseq(CTI_ARGS) 4463 4463 { 4464 4464 CTI_STACK_HACK(); … … 4473 4473 } 4474 4474 4475 JSObject* BytecodeInterpreter::cti_op_new_object(CTI_ARGS)4475 JSObject* Interpreter::cti_op_new_object(CTI_ARGS) 4476 4476 { 4477 4477 CTI_STACK_HACK(); … … 4480 4480 } 4481 4481 4482 void BytecodeInterpreter::cti_op_put_by_id(CTI_ARGS)4482 void Interpreter::cti_op_put_by_id(CTI_ARGS) 4483 4483 { 4484 4484 CTI_STACK_HACK(); … … 4495 4495 } 4496 4496 4497 void BytecodeInterpreter::cti_op_put_by_id_second(CTI_ARGS)4497 void Interpreter::cti_op_put_by_id_second(CTI_ARGS) 4498 4498 { 4499 4499 CTI_STACK_HACK(); … … 4505 4505 } 4506 4506 4507 void BytecodeInterpreter::cti_op_put_by_id_generic(CTI_ARGS)4507 void Interpreter::cti_op_put_by_id_generic(CTI_ARGS) 4508 4508 { 4509 4509 CTI_STACK_HACK(); … … 4514 4514 } 4515 4515 4516 void BytecodeInterpreter::cti_op_put_by_id_fail(CTI_ARGS)4516 void Interpreter::cti_op_put_by_id_fail(CTI_ARGS) 4517 4517 { 4518 4518 CTI_STACK_HACK(); … … 4530 4530 } 4531 4531 4532 JSValue* BytecodeInterpreter::cti_op_get_by_id(CTI_ARGS)4532 JSValue* Interpreter::cti_op_get_by_id(CTI_ARGS) 4533 4533 { 4534 4534 CTI_STACK_HACK(); … … 4547 4547 } 4548 4548 4549 JSValue* BytecodeInterpreter::cti_op_get_by_id_second(CTI_ARGS)4549 JSValue* Interpreter::cti_op_get_by_id_second(CTI_ARGS) 4550 4550 { 4551 4551 CTI_STACK_HACK(); … … 4564 4564 } 4565 4565 4566 JSValue* BytecodeInterpreter::cti_op_get_by_id_generic(CTI_ARGS)4566 JSValue* Interpreter::cti_op_get_by_id_generic(CTI_ARGS) 4567 4567 { 4568 4568 CTI_STACK_HACK(); … … 4579 4579 } 4580 4580 4581 JSValue* BytecodeInterpreter::cti_op_get_by_id_fail(CTI_ARGS)4581 JSValue* Interpreter::cti_op_get_by_id_fail(CTI_ARGS) 4582 4582 { 4583 4583 CTI_STACK_HACK(); … … 4597 4597 } 4598 4598 4599 JSValue* BytecodeInterpreter::cti_op_instanceof(CTI_ARGS)4599 JSValue* Interpreter::cti_op_instanceof(CTI_ARGS) 4600 4600 { 4601 4601 CTI_STACK_HACK(); … … 4637 4637 } 4638 4638 4639 JSValue* BytecodeInterpreter::cti_op_del_by_id(CTI_ARGS)4639 JSValue* Interpreter::cti_op_del_by_id(CTI_ARGS) 4640 4640 { 4641 4641 CTI_STACK_HACK(); … … 4651 4651 } 4652 4652 4653 JSValue* BytecodeInterpreter::cti_op_mul(CTI_ARGS)4653 JSValue* Interpreter::cti_op_mul(CTI_ARGS) 4654 4654 { 4655 4655 CTI_STACK_HACK(); … … 4669 4669 } 4670 4670 4671 JSObject* BytecodeInterpreter::cti_op_new_func(CTI_ARGS)4671 JSObject* Interpreter::cti_op_new_func(CTI_ARGS) 4672 4672 { 4673 4673 CTI_STACK_HACK(); … … 4676 4676 } 4677 4677 4678 void* BytecodeInterpreter::cti_op_call_JSFunction(CTI_ARGS)4678 void* Interpreter::cti_op_call_JSFunction(CTI_ARGS) 4679 4679 { 4680 4680 CTI_STACK_HACK(); … … 4694 4694 } 4695 4695 4696 VoidPtrPair BytecodeInterpreter::cti_op_call_arityCheck(CTI_ARGS)4696 VoidPtrPair Interpreter::cti_op_call_arityCheck(CTI_ARGS) 4697 4697 { 4698 4698 CTI_STACK_HACK(); … … 4741 4741 } 4742 4742 4743 void* BytecodeInterpreter::cti_vm_dontLazyLinkCall(CTI_ARGS)4743 void* Interpreter::cti_vm_dontLazyLinkCall(CTI_ARGS) 4744 4744 { 4745 4745 CTI_STACK_HACK(); … … 4755 4755 } 4756 4756 4757 void* BytecodeInterpreter::cti_vm_lazyLinkCall(CTI_ARGS)4757 void* Interpreter::cti_vm_lazyLinkCall(CTI_ARGS) 4758 4758 { 4759 4759 CTI_STACK_HACK(); … … 4770 4770 } 4771 4771 4772 JSObject* BytecodeInterpreter::cti_op_push_activation(CTI_ARGS)4772 JSObject* Interpreter::cti_op_push_activation(CTI_ARGS) 4773 4773 { 4774 4774 CTI_STACK_HACK(); … … 4779 4779 } 4780 4780 4781 JSValue* BytecodeInterpreter::cti_op_call_NotJSFunction(CTI_ARGS)4781 JSValue* Interpreter::cti_op_call_NotJSFunction(CTI_ARGS) 4782 4782 { 4783 4783 CTI_STACK_HACK(); … … 4825 4825 } 4826 4826 4827 void BytecodeInterpreter::cti_op_create_arguments(CTI_ARGS)4827 void Interpreter::cti_op_create_arguments(CTI_ARGS) 4828 4828 { 4829 4829 CTI_STACK_HACK(); … … 4834 4834 } 4835 4835 4836 void BytecodeInterpreter::cti_op_create_arguments_no_params(CTI_ARGS)4836 void Interpreter::cti_op_create_arguments_no_params(CTI_ARGS) 4837 4837 { 4838 4838 CTI_STACK_HACK(); … … 4843 4843 } 4844 4844 4845 void BytecodeInterpreter::cti_op_tear_off_activation(CTI_ARGS)4845 void Interpreter::cti_op_tear_off_activation(CTI_ARGS) 4846 4846 { 4847 4847 CTI_STACK_HACK(); … … 4851 4851 } 4852 4852 4853 void BytecodeInterpreter::cti_op_tear_off_arguments(CTI_ARGS)4853 void Interpreter::cti_op_tear_off_arguments(CTI_ARGS) 4854 4854 { 4855 4855 CTI_STACK_HACK(); … … 4859 4859 } 4860 4860 4861 void BytecodeInterpreter::cti_op_profile_will_call(CTI_ARGS)4861 void Interpreter::cti_op_profile_will_call(CTI_ARGS) 4862 4862 { 4863 4863 CTI_STACK_HACK(); … … 4867 4867 } 4868 4868 4869 void BytecodeInterpreter::cti_op_profile_did_call(CTI_ARGS)4869 void Interpreter::cti_op_profile_did_call(CTI_ARGS) 4870 4870 { 4871 4871 CTI_STACK_HACK(); … … 4875 4875 } 4876 4876 4877 void BytecodeInterpreter::cti_op_ret_scopeChain(CTI_ARGS)4877 void Interpreter::cti_op_ret_scopeChain(CTI_ARGS) 4878 4878 { 4879 4879 CTI_STACK_HACK(); … … 4883 4883 } 4884 4884 4885 JSObject* BytecodeInterpreter::cti_op_new_array(CTI_ARGS)4885 JSObject* Interpreter::cti_op_new_array(CTI_ARGS) 4886 4886 { 4887 4887 CTI_STACK_HACK(); … … 4891 4891 } 4892 4892 4893 JSValue* BytecodeInterpreter::cti_op_resolve(CTI_ARGS)4893 JSValue* Interpreter::cti_op_resolve(CTI_ARGS) 4894 4894 { 4895 4895 CTI_STACK_HACK(); … … 4920 4920 } 4921 4921 4922 JSObject* BytecodeInterpreter::cti_op_construct_JSConstruct(CTI_ARGS)4922 JSObject* Interpreter::cti_op_construct_JSConstruct(CTI_ARGS) 4923 4923 { 4924 4924 CTI_STACK_HACK(); … … 4937 4937 } 4938 4938 4939 JSValue* BytecodeInterpreter::cti_op_construct_NotJSConstruct(CTI_ARGS)4939 JSValue* Interpreter::cti_op_construct_NotJSConstruct(CTI_ARGS) 4940 4940 { 4941 4941 CTI_STACK_HACK(); … … 4969 4969 } 4970 4970 4971 JSValue* BytecodeInterpreter::cti_op_get_by_val(CTI_ARGS)4972 { 4973 CTI_STACK_HACK(); 4974 4975 CallFrame* callFrame = ARG_callFrame; 4976 BytecodeInterpreter* interpreter = ARG_globalData->interpreter;4971 JSValue* Interpreter::cti_op_get_by_val(CTI_ARGS) 4972 { 4973 CTI_STACK_HACK(); 4974 4975 CallFrame* callFrame = ARG_callFrame; 4976 Interpreter* interpreter = ARG_globalData->interpreter; 4977 4977 4978 4978 JSValue* baseValue = ARG_src1; … … 5003 5003 } 5004 5004 5005 VoidPtrPair BytecodeInterpreter::cti_op_resolve_func(CTI_ARGS)5005 VoidPtrPair Interpreter::cti_op_resolve_func(CTI_ARGS) 5006 5006 { 5007 5007 CTI_STACK_HACK(); … … 5047 5047 } 5048 5048 5049 JSValue* BytecodeInterpreter::cti_op_sub(CTI_ARGS)5049 JSValue* Interpreter::cti_op_sub(CTI_ARGS) 5050 5050 { 5051 5051 CTI_STACK_HACK(); … … 5065 5065 } 5066 5066 5067 void BytecodeInterpreter::cti_op_put_by_val(CTI_ARGS)5068 { 5069 CTI_STACK_HACK(); 5070 5071 CallFrame* callFrame = ARG_callFrame; 5072 BytecodeInterpreter* interpreter = ARG_globalData->interpreter;5067 void Interpreter::cti_op_put_by_val(CTI_ARGS) 5068 { 5069 CTI_STACK_HACK(); 5070 5071 CallFrame* callFrame = ARG_callFrame; 5072 Interpreter* interpreter = ARG_globalData->interpreter; 5073 5073 5074 5074 JSValue* baseValue = ARG_src1; … … 5099 5099 } 5100 5100 5101 void BytecodeInterpreter::cti_op_put_by_val_array(CTI_ARGS)5101 void Interpreter::cti_op_put_by_val_array(CTI_ARGS) 5102 5102 { 5103 5103 CTI_STACK_HACK(); … … 5125 5125 } 5126 5126 5127 JSValue* BytecodeInterpreter::cti_op_lesseq(CTI_ARGS)5127 JSValue* Interpreter::cti_op_lesseq(CTI_ARGS) 5128 5128 { 5129 5129 CTI_STACK_HACK(); … … 5135 5135 } 5136 5136 5137 int BytecodeInterpreter::cti_op_loop_if_true(CTI_ARGS)5137 int Interpreter::cti_op_loop_if_true(CTI_ARGS) 5138 5138 { 5139 5139 CTI_STACK_HACK(); … … 5148 5148 } 5149 5149 5150 JSValue* BytecodeInterpreter::cti_op_negate(CTI_ARGS)5150 JSValue* Interpreter::cti_op_negate(CTI_ARGS) 5151 5151 { 5152 5152 CTI_STACK_HACK(); … … 5164 5164 } 5165 5165 5166 JSValue* BytecodeInterpreter::cti_op_resolve_base(CTI_ARGS)5166 JSValue* Interpreter::cti_op_resolve_base(CTI_ARGS) 5167 5167 { 5168 5168 CTI_STACK_HACK(); … … 5171 5171 } 5172 5172 5173 JSValue* BytecodeInterpreter::cti_op_resolve_skip(CTI_ARGS)5173 JSValue* Interpreter::cti_op_resolve_skip(CTI_ARGS) 5174 5174 { 5175 5175 CTI_STACK_HACK(); … … 5205 5205 } 5206 5206 5207 JSValue* BytecodeInterpreter::cti_op_resolve_global(CTI_ARGS)5207 JSValue* Interpreter::cti_op_resolve_global(CTI_ARGS) 5208 5208 { 5209 5209 CTI_STACK_HACK(); … … 5235 5235 } 5236 5236 5237 JSValue* BytecodeInterpreter::cti_op_div(CTI_ARGS)5237 JSValue* Interpreter::cti_op_div(CTI_ARGS) 5238 5238 { 5239 5239 CTI_STACK_HACK(); … … 5253 5253 } 5254 5254 5255 JSValue* BytecodeInterpreter::cti_op_pre_dec(CTI_ARGS)5255 JSValue* Interpreter::cti_op_pre_dec(CTI_ARGS) 5256 5256 { 5257 5257 CTI_STACK_HACK(); … … 5265 5265 } 5266 5266 5267 int BytecodeInterpreter::cti_op_jless(CTI_ARGS)5267 int Interpreter::cti_op_jless(CTI_ARGS) 5268 5268 { 5269 5269 CTI_STACK_HACK(); … … 5278 5278 } 5279 5279 5280 JSValue* BytecodeInterpreter::cti_op_not(CTI_ARGS)5280 JSValue* Interpreter::cti_op_not(CTI_ARGS) 5281 5281 { 5282 5282 CTI_STACK_HACK(); … … 5291 5291 } 5292 5292 5293 int SFX_CALL BytecodeInterpreter::cti_op_jtrue(CTI_ARGS)5293 int SFX_CALL Interpreter::cti_op_jtrue(CTI_ARGS) 5294 5294 { 5295 5295 CTI_STACK_HACK(); … … 5304 5304 } 5305 5305 5306 VoidPtrPair BytecodeInterpreter::cti_op_post_inc(CTI_ARGS)5306 VoidPtrPair Interpreter::cti_op_post_inc(CTI_ARGS) 5307 5307 { 5308 5308 CTI_STACK_HACK(); … … 5319 5319 } 5320 5320 5321 JSValue* BytecodeInterpreter::cti_op_eq(CTI_ARGS)5321 JSValue* Interpreter::cti_op_eq(CTI_ARGS) 5322 5322 { 5323 5323 CTI_STACK_HACK(); … … 5334 5334 } 5335 5335 5336 JSValue* BytecodeInterpreter::cti_op_lshift(CTI_ARGS)5336 JSValue* Interpreter::cti_op_lshift(CTI_ARGS) 5337 5337 { 5338 5338 CTI_STACK_HACK(); … … 5354 5354 } 5355 5355 5356 JSValue* BytecodeInterpreter::cti_op_bitand(CTI_ARGS)5356 JSValue* Interpreter::cti_op_bitand(CTI_ARGS) 5357 5357 { 5358 5358 CTI_STACK_HACK(); … … 5372 5372 } 5373 5373 5374 JSValue* BytecodeInterpreter::cti_op_rshift(CTI_ARGS)5374 JSValue* Interpreter::cti_op_rshift(CTI_ARGS) 5375 5375 { 5376 5376 CTI_STACK_HACK(); … … 5392 5392 } 5393 5393 5394 JSValue* BytecodeInterpreter::cti_op_bitnot(CTI_ARGS)5394 JSValue* Interpreter::cti_op_bitnot(CTI_ARGS) 5395 5395 { 5396 5396 CTI_STACK_HACK(); … … 5408 5408 } 5409 5409 5410 VoidPtrPair BytecodeInterpreter::cti_op_resolve_with_base(CTI_ARGS)5410 VoidPtrPair Interpreter::cti_op_resolve_with_base(CTI_ARGS) 5411 5411 { 5412 5412 CTI_STACK_HACK(); … … 5444 5444 } 5445 5445 5446 JSObject* BytecodeInterpreter::cti_op_new_func_exp(CTI_ARGS)5446 JSObject* Interpreter::cti_op_new_func_exp(CTI_ARGS) 5447 5447 { 5448 5448 CTI_STACK_HACK(); … … 5451 5451 } 5452 5452 5453 JSValue* BytecodeInterpreter::cti_op_mod(CTI_ARGS)5453 JSValue* Interpreter::cti_op_mod(CTI_ARGS) 5454 5454 { 5455 5455 CTI_STACK_HACK(); … … 5465 5465 } 5466 5466 5467 JSValue* BytecodeInterpreter::cti_op_less(CTI_ARGS)5467 JSValue* Interpreter::cti_op_less(CTI_ARGS) 5468 5468 { 5469 5469 CTI_STACK_HACK(); … … 5475 5475 } 5476 5476 5477 JSValue* BytecodeInterpreter::cti_op_neq(CTI_ARGS)5477 JSValue* Interpreter::cti_op_neq(CTI_ARGS) 5478 5478 { 5479 5479 CTI_STACK_HACK(); … … 5490 5490 } 5491 5491 5492 VoidPtrPair BytecodeInterpreter::cti_op_post_dec(CTI_ARGS)5492 VoidPtrPair Interpreter::cti_op_post_dec(CTI_ARGS) 5493 5493 { 5494 5494 CTI_STACK_HACK(); … … 5505 5505 } 5506 5506 5507 JSValue* BytecodeInterpreter::cti_op_urshift(CTI_ARGS)5507 JSValue* Interpreter::cti_op_urshift(CTI_ARGS) 5508 5508 { 5509 5509 CTI_STACK_HACK(); … … 5523 5523 } 5524 5524 5525 JSValue* BytecodeInterpreter::cti_op_bitxor(CTI_ARGS)5525 JSValue* Interpreter::cti_op_bitxor(CTI_ARGS) 5526 5526 { 5527 5527 CTI_STACK_HACK(); … … 5537 5537 } 5538 5538 5539 JSObject* BytecodeInterpreter::cti_op_new_regexp(CTI_ARGS)5539 JSObject* Interpreter::cti_op_new_regexp(CTI_ARGS) 5540 5540 { 5541 5541 CTI_STACK_HACK(); … … 5544 5544 } 5545 5545 5546 JSValue* BytecodeInterpreter::cti_op_bitor(CTI_ARGS)5546 JSValue* Interpreter::cti_op_bitor(CTI_ARGS) 5547 5547 { 5548 5548 CTI_STACK_HACK(); … … 5558 5558 } 5559 5559 5560 JSValue* BytecodeInterpreter::cti_op_call_eval(CTI_ARGS)5560 JSValue* Interpreter::cti_op_call_eval(CTI_ARGS) 5561 5561 { 5562 5562 CTI_STACK_HACK(); … … 5565 5565 RegisterFile* registerFile = ARG_registerFile; 5566 5566 5567 BytecodeInterpreter* interpreter = ARG_globalData->interpreter;5567 Interpreter* interpreter = ARG_globalData->interpreter; 5568 5568 5569 5569 JSValue* funcVal = ARG_src1; … … 5589 5589 } 5590 5590 5591 JSValue* BytecodeInterpreter::cti_op_throw(CTI_ARGS)5591 JSValue* Interpreter::cti_op_throw(CTI_ARGS) 5592 5592 { 5593 5593 CTI_STACK_HACK(); … … 5616 5616 } 5617 5617 5618 JSPropertyNameIterator* BytecodeInterpreter::cti_op_get_pnames(CTI_ARGS)5618 JSPropertyNameIterator* Interpreter::cti_op_get_pnames(CTI_ARGS) 5619 5619 { 5620 5620 CTI_STACK_HACK(); … … 5623 5623 } 5624 5624 5625 JSValue* BytecodeInterpreter::cti_op_next_pname(CTI_ARGS)5625 JSValue* Interpreter::cti_op_next_pname(CTI_ARGS) 5626 5626 { 5627 5627 CTI_STACK_HACK(); … … 5634 5634 } 5635 5635 5636 void BytecodeInterpreter::cti_op_push_scope(CTI_ARGS)5636 void Interpreter::cti_op_push_scope(CTI_ARGS) 5637 5637 { 5638 5638 CTI_STACK_HACK(); … … 5643 5643 } 5644 5644 5645 void BytecodeInterpreter::cti_op_pop_scope(CTI_ARGS)5645 void Interpreter::cti_op_pop_scope(CTI_ARGS) 5646 5646 { 5647 5647 CTI_STACK_HACK(); … … 5650 5650 } 5651 5651 5652 JSValue* BytecodeInterpreter::cti_op_typeof(CTI_ARGS)5652 JSValue* Interpreter::cti_op_typeof(CTI_ARGS) 5653 5653 { 5654 5654 CTI_STACK_HACK(); … … 5657 5657 } 5658 5658 5659 JSValue* BytecodeInterpreter::cti_op_is_undefined(CTI_ARGS)5659 JSValue* Interpreter::cti_op_is_undefined(CTI_ARGS) 5660 5660 { 5661 5661 CTI_STACK_HACK(); … … 5665 5665 } 5666 5666 5667 JSValue* BytecodeInterpreter::cti_op_is_boolean(CTI_ARGS)5667 JSValue* Interpreter::cti_op_is_boolean(CTI_ARGS) 5668 5668 { 5669 5669 CTI_STACK_HACK(); … … 5672 5672 } 5673 5673 5674 JSValue* BytecodeInterpreter::cti_op_is_number(CTI_ARGS)5674 JSValue* Interpreter::cti_op_is_number(CTI_ARGS) 5675 5675 { 5676 5676 CTI_STACK_HACK(); … … 5679 5679 } 5680 5680 5681 JSValue* BytecodeInterpreter::cti_op_is_string(CTI_ARGS)5681 JSValue* Interpreter::cti_op_is_string(CTI_ARGS) 5682 5682 { 5683 5683 CTI_STACK_HACK(); … … 5686 5686 } 5687 5687 5688 JSValue* BytecodeInterpreter::cti_op_is_object(CTI_ARGS)5688 JSValue* Interpreter::cti_op_is_object(CTI_ARGS) 5689 5689 { 5690 5690 CTI_STACK_HACK(); … … 5693 5693 } 5694 5694 5695 JSValue* BytecodeInterpreter::cti_op_is_function(CTI_ARGS)5695 JSValue* Interpreter::cti_op_is_function(CTI_ARGS) 5696 5696 { 5697 5697 CTI_STACK_HACK(); … … 5700 5700 } 5701 5701 5702 JSValue* BytecodeInterpreter::cti_op_stricteq(CTI_ARGS)5702 JSValue* Interpreter::cti_op_stricteq(CTI_ARGS) 5703 5703 { 5704 5704 CTI_STACK_HACK(); … … 5714 5714 } 5715 5715 5716 JSValue* BytecodeInterpreter::cti_op_nstricteq(CTI_ARGS)5716 JSValue* Interpreter::cti_op_nstricteq(CTI_ARGS) 5717 5717 { 5718 5718 CTI_STACK_HACK(); … … 5728 5728 } 5729 5729 5730 JSValue* BytecodeInterpreter::cti_op_to_jsnumber(CTI_ARGS)5730 JSValue* Interpreter::cti_op_to_jsnumber(CTI_ARGS) 5731 5731 { 5732 5732 CTI_STACK_HACK(); … … 5740 5740 } 5741 5741 5742 JSValue* BytecodeInterpreter::cti_op_in(CTI_ARGS)5742 JSValue* Interpreter::cti_op_in(CTI_ARGS) 5743 5743 { 5744 5744 CTI_STACK_HACK(); … … 5768 5768 } 5769 5769 5770 JSObject* BytecodeInterpreter::cti_op_push_new_scope(CTI_ARGS)5770 JSObject* Interpreter::cti_op_push_new_scope(CTI_ARGS) 5771 5771 { 5772 5772 CTI_STACK_HACK(); … … 5779 5779 } 5780 5780 5781 void BytecodeInterpreter::cti_op_jmp_scopes(CTI_ARGS)5781 void Interpreter::cti_op_jmp_scopes(CTI_ARGS) 5782 5782 { 5783 5783 CTI_STACK_HACK(); … … 5792 5792 } 5793 5793 5794 void BytecodeInterpreter::cti_op_put_by_index(CTI_ARGS)5794 void Interpreter::cti_op_put_by_index(CTI_ARGS) 5795 5795 { 5796 5796 CTI_STACK_HACK(); … … 5802 5802 } 5803 5803 5804 void* BytecodeInterpreter::cti_op_switch_imm(CTI_ARGS)5804 void* Interpreter::cti_op_switch_imm(CTI_ARGS) 5805 5805 { 5806 5806 CTI_STACK_HACK(); … … 5819 5819 } 5820 5820 5821 void* BytecodeInterpreter::cti_op_switch_char(CTI_ARGS)5821 void* Interpreter::cti_op_switch_char(CTI_ARGS) 5822 5822 { 5823 5823 CTI_STACK_HACK(); … … 5839 5839 } 5840 5840 5841 void* BytecodeInterpreter::cti_op_switch_string(CTI_ARGS)5841 void* Interpreter::cti_op_switch_string(CTI_ARGS) 5842 5842 { 5843 5843 CTI_STACK_HACK(); … … 5858 5858 } 5859 5859 5860 JSValue* BytecodeInterpreter::cti_op_del_by_val(CTI_ARGS)5860 JSValue* Interpreter::cti_op_del_by_val(CTI_ARGS) 5861 5861 { 5862 5862 CTI_STACK_HACK(); … … 5883 5883 } 5884 5884 5885 void BytecodeInterpreter::cti_op_put_getter(CTI_ARGS)5885 void Interpreter::cti_op_put_getter(CTI_ARGS) 5886 5886 { 5887 5887 CTI_STACK_HACK(); … … 5896 5896 } 5897 5897 5898 void BytecodeInterpreter::cti_op_put_setter(CTI_ARGS)5898 void Interpreter::cti_op_put_setter(CTI_ARGS) 5899 5899 { 5900 5900 CTI_STACK_HACK(); … … 5909 5909 } 5910 5910 5911 JSObject* BytecodeInterpreter::cti_op_new_error(CTI_ARGS)5911 JSObject* Interpreter::cti_op_new_error(CTI_ARGS) 5912 5912 { 5913 5913 CTI_STACK_HACK(); … … 5922 5922 } 5923 5923 5924 void BytecodeInterpreter::cti_op_debug(CTI_ARGS)5924 void Interpreter::cti_op_debug(CTI_ARGS) 5925 5925 { 5926 5926 CTI_STACK_HACK(); … … 5935 5935 } 5936 5936 5937 JSValue* BytecodeInterpreter::cti_vm_throw(CTI_ARGS)5937 JSValue* Interpreter::cti_vm_throw(CTI_ARGS) 5938 5938 { 5939 5939 CTI_STACK_HACK(); -
trunk/JavaScriptCore/VM/Machine.h
r38434 r38461 102 102 enum { MaxReentryDepth = 128 }; 103 103 104 class BytecodeInterpreter {104 class Interpreter { 105 105 friend class CTI; 106 106 public: 107 BytecodeInterpreter();108 ~ BytecodeInterpreter();107 Interpreter(); 108 ~Interpreter(); 109 109 110 110 void initialize(JSGlobalData*); -
trunk/JavaScriptCore/VM/Register.h
r38423 r38461 60 60 private: 61 61 friend class ExecState; 62 friend class BytecodeInterpreter;63 64 // Only CallFrame and BytecodeInterpreter should use these functions.62 friend class Interpreter; 63 64 // Only CallFrame and Interpreter should use these functions. 65 65 66 66 Register(intptr_t); … … 171 171 } 172 172 173 // BytecodeInterpreter functions173 // Interpreter functions 174 174 175 175 ALWAYS_INLINE Register::Register(Arguments* arguments) -
trunk/JavaScriptCore/VM/SamplingTool.h
r38428 r38461 41 41 class CodeBlock; 42 42 class ExecState; 43 class BytecodeInterpreter;43 class Interpreter; 44 44 class ScopeNode; 45 45 struct Instruction; … … 126 126 #endif 127 127 128 SamplingTool( BytecodeInterpreter* interpreter)128 SamplingTool(Interpreter* interpreter) 129 129 : m_interpreter(interpreter) 130 130 , m_running(false) … … 189 189 void run(); 190 190 191 BytecodeInterpreter* m_interpreter;191 Interpreter* m_interpreter; 192 192 193 193 // Sampling thread state. -
trunk/JavaScriptCore/bytecompiler/CodeGenerator.cpp
r38441 r38461 142 142 143 143 m_scopeNode->children().shrinkCapacity(0); 144 if (m_codeType != EvalCode) { // eval code needs to hang on to its declaration stacks to keep declaration info alive until BytecodeInterpreter::execute time.144 if (m_codeType != EvalCode) { // eval code needs to hang on to its declaration stacks to keep declaration info alive until Interpreter::execute time. 145 145 m_scopeNode->varStack().shrinkCapacity(0); 146 146 m_scopeNode->functionStack().shrinkCapacity(0); … … 237 237 codeBlock->globalData = m_globalData; 238 238 239 // FIXME: Move code that modifies the global object to BytecodeInterpreter::execute.239 // FIXME: Move code that modifies the global object to Interpreter::execute. 240 240 241 241 m_codeBlock->numParameters = 1; // Allocate space for "this" -
trunk/JavaScriptCore/jsc.cpp
r38442 r38461 321 321 322 322 #if ENABLE(OPCODE_SAMPLING) 323 BytecodeInterpreter* interpreter = globalObject->globalData()->interpreter;323 Interpreter* interpreter = globalObject->globalData()->interpreter; 324 324 interpreter->setSampler(new SamplingTool(machine)); 325 325 #endif -
trunk/JavaScriptCore/masm/X86Assembler.h
r38434 r38461 123 123 } 124 124 125 void* copy()125 void* executableCopy() 126 126 { 127 127 if (!m_size) … … 1107 1107 } 1108 1108 1109 void* copy()1110 { 1111 return m_buffer-> copy();1109 void* executableCopy() 1110 { 1111 return m_buffer->executableCopy(); 1112 1112 } 1113 1113 -
trunk/JavaScriptCore/runtime/ExecState.h
r38423 r38461 83 83 const CommonIdentifiers& propertyNames() const { return *globalData().propertyNames; } 84 84 const ArgList& emptyList() const { return *globalData().emptyList; } 85 BytecodeInterpreter* interpreter() { return globalData().interpreter; }85 Interpreter* interpreter() { return globalData().interpreter; } 86 86 Heap* heap() { return &globalData().heap; } 87 87 … … 98 98 friend class JSActivation; 99 99 friend class JSGlobalObject; 100 friend class BytecodeInterpreter;100 friend class Interpreter; 101 101 102 102 static CallFrame* create(Register* callFrameBase) { return static_cast<CallFrame*>(callFrameBase); } -
trunk/JavaScriptCore/runtime/JSCell.h
r38440 r38461 39 39 friend class JSString; 40 40 friend class JSValue; 41 friend class BytecodeInterpreter;41 friend class Interpreter; 42 42 43 43 private: -
trunk/JavaScriptCore/runtime/JSFunction.h
r38440 r38461 40 40 class JSFunction : public InternalFunction { 41 41 friend class CTI; 42 friend class BytecodeInterpreter;42 friend class Interpreter; 43 43 44 44 typedef InternalFunction Base; -
trunk/JavaScriptCore/runtime/JSGlobalData.cpp
r38440 r38461 65 65 66 66 JSGlobalData::JSGlobalData(bool isShared) 67 : interpreter(new BytecodeInterpreter)67 : interpreter(new Interpreter) 68 68 , exception(noValue()) 69 69 , arrayTable(new HashTable(JSC::arrayTable)) -
trunk/JavaScriptCore/runtime/JSGlobalData.h
r38440 r38461 48 48 class JSObject; 49 49 class Lexer; 50 class BytecodeInterpreter;50 class Interpreter; 51 51 class Parser; 52 52 class ParserRefCounted; … … 64 64 ~JSGlobalData(); 65 65 66 BytecodeInterpreter* interpreter;66 Interpreter* interpreter; 67 67 68 68 JSValue* exception; -
trunk/JavaScriptCore/runtime/JSImmediate.h
r38148 r38461 87 87 class JSImmediate { 88 88 private: 89 friend class CTI; // Whooo!89 friend class CTI; 90 90 91 91 static const uintptr_t TagMask = 0x3u; // primary tag is 2 bits long -
trunk/JavaScriptCore/runtime/JSString.h
r38440 r38461 61 61 class JSString : public JSCell { 62 62 friend class CTI; 63 friend class BytecodeInterpreter;63 friend class Interpreter; 64 64 65 65 public: -
trunk/JavaScriptCore/runtime/JSValue.h
r38137 r38461 29 29 #include "UString.h" 30 30 #include <stddef.h> // for size_t 31 32 // The magic number 0x4000 is not important here, it is being subtracted back out (avoiding using zero since this33 // can have unexpected effects in this type of macro, particularly where multiple-inheritance is involved).34 #define OBJECT_OFFSET(class, member) (reinterpret_cast<ptrdiff_t>(&(reinterpret_cast<class*>(0x4000)->member)) - 0x4000)35 31 36 32 namespace JSC { -
trunk/JavaScriptCore/runtime/JSVariableObject.h
r38440 r38461 42 42 43 43 class JSVariableObject : public JSObject { 44 friend class CTI; 45 44 46 public: 45 47 SymbolTable& symbolTable() const { return *d->symbolTable; } … … 73 75 OwnArrayPtr<Register> registerArray; // Independent copy of registers, used when a variable object copies its registers out of the register file. 74 76 75 static inline ptrdiff_t offsetOf_registers()76 {77 return OBJECT_OFFSET(JSVariableObjectData, registers);78 }79 80 77 private: 81 78 JSVariableObjectData(const JSVariableObjectData&); … … 98 95 99 96 JSVariableObjectData* d; 100 101 public:102 static inline ptrdiff_t offsetOf_d()103 {104 return OBJECT_OFFSET(JSVariableObject, d);105 }106 107 static inline ptrdiff_t offsetOf_Data_registers()108 {109 return JSVariableObjectData::offsetOf_registers();110 }111 97 }; 112 98 -
trunk/JavaScriptCore/runtime/RegExp.cpp
r38438 r38461 22 22 #include "RegExp.h" 23 23 24 #include "CTI.h"25 24 #include "Lexer.h" 26 25 #include <pcre/pcre.h> … … 28 27 #include <stdlib.h> 29 28 #include <string.h> 30 #include <wrec/WREC.h>31 29 #include <wtf/Assertions.h> 32 30 #include <wtf/OwnArrayPtr.h> … … 46 44 { 47 45 #if ENABLE(WREC) 48 m_wrecFunction = WREC::compileRegExp(globalData->interpreter, pattern, &m_numSubpatterns, &m_constructionError);46 m_wrecFunction = compileRegExp(globalData->interpreter, pattern, &m_numSubpatterns, &m_constructionError); 49 47 if (m_wrecFunction) 50 48 return; … … 89 87 90 88 #if ENABLE(WREC) 91 m_wrecFunction = WREC::compileRegExp(globalData->interpreter, pattern, &m_numSubpatterns, &m_constructionError, (m_flagBits & IgnoreCase), (m_flagBits & Multiline));89 m_wrecFunction = compileRegExp(globalData->interpreter, pattern, &m_numSubpatterns, &m_constructionError, (m_flagBits & IgnoreCase), (m_flagBits & Multiline)); 92 90 if (m_wrecFunction) 93 91 return; … … 110 108 #if ENABLE(WREC) 111 109 if (m_wrecFunction) 112 WTF::fastFreeExecutable( m_wrecFunction);110 WTF::fastFreeExecutable(reinterpret_cast<void*>(m_wrecFunction)); 113 111 #endif 114 112 } … … 137 135 ovector->set(offsetVector); 138 136 139 int result = reinterpret_cast<WRECFunction>(m_wrecFunction)(s.data(), i, s.size(), offsetVector);137 int result = m_wrecFunction(s.data(), i, s.size(), offsetVector); 140 138 141 139 if (result < 0) { -
trunk/JavaScriptCore/runtime/RegExp.h
r38137 r38461 23 23 24 24 #include "UString.h" 25 #include "WREC.h" 25 26 #include <wtf/Forward.h> 26 27 #include <wtf/RefCounted.h> … … 67 68 68 69 #if ENABLE(WREC) 69 // Called as a WRECFunction 70 void* m_wrecFunction; 70 WREC::RegExpFunction m_wrecFunction; 71 71 #endif 72 72 }; -
trunk/JavaScriptCore/wrec/CharacterClassConstructor.cpp
r38434 r38461 33 33 34 34 using namespace WTF; 35 using namespace JSC; 36 37 namespace WREC { 35 36 namespace JSC { namespace WREC { 38 37 39 38 static const UChar asciiNewlines[2] = { '\n', '\r' }; … … 357 356 } 358 357 359 } // namespaceWREC358 } } // namespace JSC::WREC 360 359 361 360 #endif // ENABLE(WREC) -
trunk/JavaScriptCore/wrec/CharacterClassConstructor.h
r38434 r38461 27 27 #define CharacterClassConstructor_h 28 28 29 #include <wtf/Platform.h> 30 29 31 #if ENABLE(WREC) 30 32 31 33 #include "UString.h" 32 34 33 namespace WREC {35 namespace JSC { namespace WREC { 34 36 35 37 struct CharacterClassRange { … … 115 117 }; 116 118 117 } // namespaceWREC119 } } // namespace JSC::WREC 118 120 119 121 #endif // ENABLE(WREC) -
trunk/JavaScriptCore/wrec/WREC.cpp
r38434 r38461 36 36 37 37 using namespace WTF; 38 using namespace JSC; 39 40 namespace WREC { 38 39 namespace JSC { namespace WREC { 41 40 42 41 class GenerateAtomFunctor { … … 1329 1328 static const int MaxPatternSize = (1 << 16); 1330 1329 1331 void* compileRegExp(BytecodeInterpreter* interpreter, const UString& pattern, unsigned* numSubpatterns_ptr, const char** error_ptr, bool ignoreCase, bool multiline)1330 RegExpFunction compileRegExp(Interpreter* interpreter, const UString& pattern, unsigned* numSubpatterns_ptr, const char** error_ptr, bool ignoreCase, bool multiline) 1332 1331 { 1333 1332 // TODO: better error messages … … 1415 1414 *numSubpatterns_ptr = parser.m_numSubpatterns; 1416 1415 1417 void* code = __ copy();1416 void* code = __ executableCopy(); 1418 1417 ASSERT(code); 1419 return code;1420 } 1421 1422 } // namespaceWREC1418 return reinterpret_cast<RegExpFunction>(code); 1419 } 1420 1421 } } // namespace JSC::WREC 1423 1422 1424 1423 #endif // ENABLE(WREC) -
trunk/JavaScriptCore/wrec/WREC.h
r38434 r38461 27 27 #define WREC_h 28 28 29 #include <wtf/Platform.h> 30 29 31 #if ENABLE(WREC) 30 32 … … 41 43 42 44 namespace JSC { 43 class BytecodeInterpreter;45 class Interpreter; 44 46 } 45 47 46 namespace WREC {48 namespace JSC { namespace WREC { 47 49 48 50 class GenerateAtomFunctor; … … 50 52 struct CharacterClass; 51 53 52 typedef int (* WRECFunction)(const UChar* input, unsigned start, unsigned length, int* output) WREC_CALL;53 54 void* compileRegExp(JSC::BytecodeInterpreter*, const JSC::UString& pattern, unsigned* numSubpatterns_ptr, const char** error_ptr, bool ignoreCase = false, bool multiline = false);54 typedef int (*RegExpFunction)(const UChar* input, unsigned start, unsigned length, int* output) WREC_CALL; 55 56 RegExpFunction compileRegExp(Interpreter*, const UString& pattern, unsigned* numSubpatterns_ptr, const char** error_ptr, bool ignoreCase = false, bool multiline = false); 55 57 56 58 struct Quantifier { … … 86 88 class Generator { 87 89 public: 88 Generator(Parser& parser, JSC::X86Assembler& assembler)90 Generator(Parser& parser, X86Assembler& assembler) 89 91 : m_parser(parser) 90 92 , m_assembler(assembler) … … 92 94 } 93 95 94 typedef JSC::X86Assembler::JmpSrc JmpSrc; 95 typedef JSC::X86Assembler::JmpDst JmpDst; 96 typedef X86Assembler::JmpSrc JmpSrc; 97 typedef X86Assembler::JmpDst JmpDst; 98 typedef X86Assembler::RegisterID RegisterID; 96 99 97 100 // these regs setup by the params 98 static const JSC::X86Assembler::RegisterID inputRegister = JSC::X86::eax;99 static const JSC::X86Assembler::RegisterID currentPositionRegister = JSC::X86::edx;100 static const JSC::X86Assembler::RegisterID lengthRegister = JSC::X86::ecx;101 static const JSC::X86Assembler::RegisterID currentValueRegister = JSC::X86::esi;102 static const JSC::X86Assembler::RegisterID outputRegister = JSC::X86::edi;103 static const JSC::X86Assembler::RegisterID quantifierCountRegister = JSC::X86::ebx;101 static const RegisterID inputRegister = X86::eax; 102 static const RegisterID currentPositionRegister = X86::edx; 103 static const RegisterID lengthRegister = X86::ecx; 104 static const RegisterID currentValueRegister = X86::esi; 105 static const RegisterID outputRegister = X86::edi; 106 static const RegisterID quantifierCountRegister = X86::ebx; 104 107 105 108 friend class GenerateAtomFunctor; … … 109 112 friend class GenerateParenthesesNonGreedyFunctor; 110 113 111 void generateGreedyQuantifier(J SC::JmpSrcVector& failures, GenerateAtomFunctor& functor, unsigned min, unsigned max);112 void generateNonGreedyQuantifier(J SC::JmpSrcVector& failures, GenerateAtomFunctor& functor, unsigned min, unsigned max);114 void generateGreedyQuantifier(JmpSrcVector& failures, GenerateAtomFunctor& functor, unsigned min, unsigned max); 115 void generateNonGreedyQuantifier(JmpSrcVector& failures, GenerateAtomFunctor& functor, unsigned min, unsigned max); 113 116 void generateBacktrack1(); 114 117 void generateBacktrackBackreference(unsigned subpatternId); 115 void generateCharacterClass(J SC::JmpSrcVector& failures, CharacterClass& charClass, bool invert);116 void generateCharacterClassInverted(J SC::JmpSrcVector& failures, CharacterClass& charClass);117 void generateCharacterClassInvertedRange(J SC::JmpSrcVector& failures, JSC::JmpSrcVector& matchDest, const CharacterClassRange* ranges, unsigned count, unsigned* matchIndex, const UChar* matches, unsigned matchCount);118 void generatePatternCharacter(J SC::JmpSrcVector& failures, int ch);119 void generateAssertionWordBoundary(J SC::JmpSrcVector& failures, bool invert);120 void generateAssertionBOL(J SC::JmpSrcVector& failures);121 void generateAssertionEOL(J SC::JmpSrcVector& failures);122 void generateBackreference(J SC::JmpSrcVector& failures, unsigned subpatternID);123 void generateBackreferenceQuantifier(J SC::JmpSrcVector& failures, Quantifier::Type quantifierType, unsigned subpatternId, unsigned min, unsigned max);118 void generateCharacterClass(JmpSrcVector& failures, CharacterClass& charClass, bool invert); 119 void generateCharacterClassInverted(JmpSrcVector& failures, CharacterClass& charClass); 120 void generateCharacterClassInvertedRange(JmpSrcVector& failures, JmpSrcVector& matchDest, const CharacterClassRange* ranges, unsigned count, unsigned* matchIndex, const UChar* matches, unsigned matchCount); 121 void generatePatternCharacter(JmpSrcVector& failures, int ch); 122 void generateAssertionWordBoundary(JmpSrcVector& failures, bool invert); 123 void generateAssertionBOL(JmpSrcVector& failures); 124 void generateAssertionEOL(JmpSrcVector& failures); 125 void generateBackreference(JmpSrcVector& failures, unsigned subpatternID); 126 void generateBackreferenceQuantifier(JmpSrcVector& failures, Quantifier::Type quantifierType, unsigned subpatternId, unsigned min, unsigned max); 124 127 enum ParenthesesType { capturing, non_capturing, assertion, inverted_assertion }; // order is relied on in generateParentheses() 125 128 JmpSrc generateParentheses(ParenthesesType type); 126 JmpSrc generateParenthesesResetTrampoline(J SC::JmpSrcVector& newFailures, unsigned subpatternIdBefore, unsigned subpatternIdAfter);127 void generateParenthesesNonGreedy(J SC::JmpSrcVector& failures, JmpDst start, JmpSrc success, JmpSrc fail);128 129 void generateDisjunction(J SC::JmpSrcVector& successes, JSC::JmpSrcVector& failures);130 void terminateDisjunction(J SC::JmpSrcVector& successes);129 JmpSrc generateParenthesesResetTrampoline(JmpSrcVector& newFailures, unsigned subpatternIdBefore, unsigned subpatternIdAfter); 130 void generateParenthesesNonGreedy(JmpSrcVector& failures, JmpDst start, JmpSrc success, JmpSrc fail); 131 132 void generateDisjunction(JmpSrcVector& successes, JmpSrcVector& failures); 133 void terminateDisjunction(JmpSrcVector& successes); 131 134 132 135 private: 133 136 Parser& m_parser; 134 JSC::X86Assembler& m_assembler;137 X86Assembler& m_assembler; 135 138 }; 136 139 … … 140 143 bool m_multiline; 141 144 unsigned m_numSubpatterns; 142 enum WRECError{145 enum { 143 146 NoError, 144 147 Error_malformedCharacterClass, … … 151 154 } m_err; 152 155 153 Parser(const JSC::UString& pattern, bool ignoreCase, bool multiline, JSC::X86Assembler& assembler)156 Parser(const UString& pattern, bool ignoreCase, bool multiline, X86Assembler& assembler) 154 157 : m_ignoreCase(ignoreCase) 155 158 , m_multiline(multiline) … … 163 166 } 164 167 165 void parseAlternative(J SC::JmpSrcVector& failures)168 void parseAlternative(JmpSrcVector& failures) 166 169 { 167 170 while (parseTerm(failures)) { } 168 171 } 169 172 170 void parseDisjunction(J SC::JmpSrcVector& failures);171 172 bool parseTerm(J SC::JmpSrcVector& failures);173 bool parseEscape(J SC::JmpSrcVector& failures);174 bool parseOctalEscape(J SC::JmpSrcVector& failures);175 bool parseParentheses(J SC::JmpSrcVector& failures);176 bool parseCharacterClass(J SC::JmpSrcVector& failures);177 bool parseCharacterClassQuantifier(J SC::JmpSrcVector& failures, CharacterClass& charClass, bool invert);178 bool parsePatternCharacterQualifier(J SC::JmpSrcVector& failures, int ch);179 bool parseBackreferenceQuantifier(J SC::JmpSrcVector& failures, unsigned subpatternId);173 void parseDisjunction(JmpSrcVector& failures); 174 175 bool parseTerm(JmpSrcVector& failures); 176 bool parseEscape(JmpSrcVector& failures); 177 bool parseOctalEscape(JmpSrcVector& failures); 178 bool parseParentheses(JmpSrcVector& failures); 179 bool parseCharacterClass(JmpSrcVector& failures); 180 bool parseCharacterClassQuantifier(JmpSrcVector& failures, CharacterClass& charClass, bool invert); 181 bool parsePatternCharacterQualifier(JmpSrcVector& failures, int ch); 182 bool parseBackreferenceQuantifier(JmpSrcVector& failures, unsigned subpatternId); 180 183 181 184 ALWAYS_INLINE Quantifier parseGreedyQuantifier(); … … 256 259 }; 257 260 258 } // namespace JSC261 } } // namespace JSC::WREC 259 262 260 263 #endif // ENABLE(WREC)
Note:
See TracChangeset
for help on using the changeset viewer.