Changeset 156235 in webkit for trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp
- Timestamp:
- Sep 21, 2013, 4:10:45 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp
r156124 r156235 34 34 #include "DFGDriver.h" 35 35 #include "DFGOSRExit.h" 36 #include "DFGRepatch.h"37 36 #include "DFGThunks.h" 38 37 #include "DFGToFTLDeferredCompilationCallback.h" … … 46 45 #include "JIT.h" 47 46 #include "JITExceptions.h" 47 #include "JITOperationWrappers.h" 48 48 #include "JSActivation.h" 49 49 #include "VM.h" … … 52 52 #include "ObjectConstructor.h" 53 53 #include "Operations.h" 54 #include "Repatch.h" 54 55 #include "StringConstructor.h" 55 56 #include "TypedArrayInlines.h" … … 57 58 58 59 #if ENABLE(JIT) 59 60 #if CPU(MIPS)61 #if WTF_MIPS_PIC62 #define LOAD_FUNCTION_TO_T9(function) \63 ".set noreorder" "\n" \64 ".cpload $25" "\n" \65 ".set reorder" "\n" \66 "la $t9, " LOCAL_REFERENCE(function) "\n"67 #else68 #define LOAD_FUNCTION_TO_T9(function) "" "\n"69 #endif70 #endif71 72 60 #if ENABLE(DFG_JIT) 73 74 #if COMPILER(GCC) && CPU(X86_64)75 76 #define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, register) \77 asm( \78 ".globl " SYMBOL_STRING(function) "\n" \79 HIDE_SYMBOL(function) "\n" \80 SYMBOL_STRING(function) ":" "\n" \81 "mov (%rsp), %" STRINGIZE(register) "\n" \82 "jmp " LOCAL_REFERENCE(function##WithReturnAddress) "\n" \83 );84 #define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_E(function) FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, rsi)85 #define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_ECI(function) FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, rcx)86 #define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJI(function) FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, rcx)87 #define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(function) FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, r8)88 89 #elif COMPILER(GCC) && CPU(X86)90 91 #define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, offset) \92 asm( \93 ".text" "\n" \94 ".globl " SYMBOL_STRING(function) "\n" \95 HIDE_SYMBOL(function) "\n" \96 SYMBOL_STRING(function) ":" "\n" \97 "mov (%esp), %eax\n" \98 "mov %eax, " STRINGIZE(offset) "(%esp)\n" \99 "jmp " LOCAL_REFERENCE(function##WithReturnAddress) "\n" \100 );101 #define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_E(function) FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, 8)102 #define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_ECI(function) FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, 16)103 #define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJI(function) FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, 20)104 #define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(function) FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, 24)105 106 #elif COMPILER(GCC) && CPU(ARM_THUMB2)107 108 #define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_E(function) \109 asm ( \110 ".text" "\n" \111 ".align 2" "\n" \112 ".globl " SYMBOL_STRING(function) "\n" \113 HIDE_SYMBOL(function) "\n" \114 ".thumb" "\n" \115 ".thumb_func " THUMB_FUNC_PARAM(function) "\n" \116 SYMBOL_STRING(function) ":" "\n" \117 "mov a2, lr" "\n" \118 "b " LOCAL_REFERENCE(function) "WithReturnAddress" "\n" \119 );120 121 #define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_ECI(function) \122 asm ( \123 ".text" "\n" \124 ".align 2" "\n" \125 ".globl " SYMBOL_STRING(function) "\n" \126 HIDE_SYMBOL(function) "\n" \127 ".thumb" "\n" \128 ".thumb_func " THUMB_FUNC_PARAM(function) "\n" \129 SYMBOL_STRING(function) ":" "\n" \130 "mov a4, lr" "\n" \131 "b " LOCAL_REFERENCE(function) "WithReturnAddress" "\n" \132 );133 134 // EncodedJSValue in JSVALUE32_64 is a 64-bit integer. When being compiled in ARM EABI, it must be aligned even-numbered register (r0, r2 or [sp]).135 // As a result, return address will be at a 4-byte further location in the following cases.136 #if COMPILER_SUPPORTS(EABI) && CPU(ARM)137 #define INSTRUCTION_STORE_RETURN_ADDRESS_EJI "str lr, [sp, #4]"138 #define INSTRUCTION_STORE_RETURN_ADDRESS_EJCI "str lr, [sp, #8]"139 #else140 #define INSTRUCTION_STORE_RETURN_ADDRESS_EJI "str lr, [sp, #0]"141 #define INSTRUCTION_STORE_RETURN_ADDRESS_EJCI "str lr, [sp, #4]"142 #endif143 144 #define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJI(function) \145 asm ( \146 ".text" "\n" \147 ".align 2" "\n" \148 ".globl " SYMBOL_STRING(function) "\n" \149 HIDE_SYMBOL(function) "\n" \150 ".thumb" "\n" \151 ".thumb_func " THUMB_FUNC_PARAM(function) "\n" \152 SYMBOL_STRING(function) ":" "\n" \153 INSTRUCTION_STORE_RETURN_ADDRESS_EJI "\n" \154 "b " LOCAL_REFERENCE(function) "WithReturnAddress" "\n" \155 );156 157 #define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(function) \158 asm ( \159 ".text" "\n" \160 ".align 2" "\n" \161 ".globl " SYMBOL_STRING(function) "\n" \162 HIDE_SYMBOL(function) "\n" \163 ".thumb" "\n" \164 ".thumb_func " THUMB_FUNC_PARAM(function) "\n" \165 SYMBOL_STRING(function) ":" "\n" \166 INSTRUCTION_STORE_RETURN_ADDRESS_EJCI "\n" \167 "b " LOCAL_REFERENCE(function) "WithReturnAddress" "\n" \168 );169 170 #elif COMPILER(GCC) && CPU(ARM_TRADITIONAL)171 172 #define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_E(function) \173 asm ( \174 ".text" "\n" \175 ".globl " SYMBOL_STRING(function) "\n" \176 HIDE_SYMBOL(function) "\n" \177 INLINE_ARM_FUNCTION(function) \178 SYMBOL_STRING(function) ":" "\n" \179 "mov a2, lr" "\n" \180 "b " LOCAL_REFERENCE(function) "WithReturnAddress" "\n" \181 );182 183 #define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_ECI(function) \184 asm ( \185 ".text" "\n" \186 ".globl " SYMBOL_STRING(function) "\n" \187 HIDE_SYMBOL(function) "\n" \188 INLINE_ARM_FUNCTION(function) \189 SYMBOL_STRING(function) ":" "\n" \190 "mov a4, lr" "\n" \191 "b " LOCAL_REFERENCE(function) "WithReturnAddress" "\n" \192 );193 194 // EncodedJSValue in JSVALUE32_64 is a 64-bit integer. When being compiled in ARM EABI, it must be aligned even-numbered register (r0, r2 or [sp]).195 // As a result, return address will be at a 4-byte further location in the following cases.196 #if COMPILER_SUPPORTS(EABI) && CPU(ARM)197 #define INSTRUCTION_STORE_RETURN_ADDRESS_EJI "str lr, [sp, #4]"198 #define INSTRUCTION_STORE_RETURN_ADDRESS_EJCI "str lr, [sp, #8]"199 #else200 #define INSTRUCTION_STORE_RETURN_ADDRESS_EJI "str lr, [sp, #0]"201 #define INSTRUCTION_STORE_RETURN_ADDRESS_EJCI "str lr, [sp, #4]"202 #endif203 204 #define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJI(function) \205 asm ( \206 ".text" "\n" \207 ".globl " SYMBOL_STRING(function) "\n" \208 HIDE_SYMBOL(function) "\n" \209 INLINE_ARM_FUNCTION(function) \210 SYMBOL_STRING(function) ":" "\n" \211 INSTRUCTION_STORE_RETURN_ADDRESS_EJI "\n" \212 "b " LOCAL_REFERENCE(function) "WithReturnAddress" "\n" \213 );214 215 #define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(function) \216 asm ( \217 ".text" "\n" \218 ".globl " SYMBOL_STRING(function) "\n" \219 HIDE_SYMBOL(function) "\n" \220 INLINE_ARM_FUNCTION(function) \221 SYMBOL_STRING(function) ":" "\n" \222 INSTRUCTION_STORE_RETURN_ADDRESS_EJCI "\n" \223 "b " LOCAL_REFERENCE(function) "WithReturnAddress" "\n" \224 );225 226 #elif COMPILER(GCC) && CPU(MIPS)227 228 #define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_E(function) \229 asm( \230 ".text" "\n" \231 ".globl " SYMBOL_STRING(function) "\n" \232 HIDE_SYMBOL(function) "\n" \233 SYMBOL_STRING(function) ":" "\n" \234 LOAD_FUNCTION_TO_T9(function##WithReturnAddress) \235 "move $a1, $ra" "\n" \236 "b " LOCAL_REFERENCE(function) "WithReturnAddress" "\n" \237 );238 239 #define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_ECI(function) \240 asm( \241 ".text" "\n" \242 ".globl " SYMBOL_STRING(function) "\n" \243 HIDE_SYMBOL(function) "\n" \244 SYMBOL_STRING(function) ":" "\n" \245 LOAD_FUNCTION_TO_T9(function##WithReturnAddress) \246 "move $a3, $ra" "\n" \247 "b " LOCAL_REFERENCE(function) "WithReturnAddress" "\n" \248 );249 250 #define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJI(function) \251 asm( \252 ".text" "\n" \253 ".globl " SYMBOL_STRING(function) "\n" \254 HIDE_SYMBOL(function) "\n" \255 SYMBOL_STRING(function) ":" "\n" \256 LOAD_FUNCTION_TO_T9(function##WithReturnAddress) \257 "sw $ra, 20($sp)" "\n" \258 "b " LOCAL_REFERENCE(function) "WithReturnAddress" "\n" \259 );260 261 #define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(function) \262 asm( \263 ".text" "\n" \264 ".globl " SYMBOL_STRING(function) "\n" \265 HIDE_SYMBOL(function) "\n" \266 SYMBOL_STRING(function) ":" "\n" \267 LOAD_FUNCTION_TO_T9(function##WithReturnAddress) \268 "sw $ra, 24($sp)" "\n" \269 "b " LOCAL_REFERENCE(function) "WithReturnAddress" "\n" \270 );271 272 #elif COMPILER(GCC) && CPU(SH4)273 274 #define SH4_SCRATCH_REGISTER "r11"275 276 #define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_E(function) \277 asm( \278 ".text" "\n" \279 ".globl " SYMBOL_STRING(function) "\n" \280 HIDE_SYMBOL(function) "\n" \281 SYMBOL_STRING(function) ":" "\n" \282 "sts pr, r5" "\n" \283 "bra " LOCAL_REFERENCE(function) "WithReturnAddress" "\n" \284 "nop" "\n" \285 );286 287 #define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_ECI(function) \288 asm( \289 ".text" "\n" \290 ".globl " SYMBOL_STRING(function) "\n" \291 HIDE_SYMBOL(function) "\n" \292 SYMBOL_STRING(function) ":" "\n" \293 "sts pr, r7" "\n" \294 "mov.l 2f, " SH4_SCRATCH_REGISTER "\n" \295 "braf " SH4_SCRATCH_REGISTER "\n" \296 "nop" "\n" \297 "1: .balign 4" "\n" \298 "2: .long " LOCAL_REFERENCE(function) "WithReturnAddress-1b" "\n" \299 );300 301 #define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, offset, scratch) \302 asm( \303 ".text" "\n" \304 ".globl " SYMBOL_STRING(function) "\n" \305 HIDE_SYMBOL(function) "\n" \306 SYMBOL_STRING(function) ":" "\n" \307 "sts pr, " scratch "\n" \308 "mov.l " scratch ", @(" STRINGIZE(offset) ", r15)" "\n" \309 "mov.l 2f, " scratch "\n" \310 "braf " scratch "\n" \311 "nop" "\n" \312 "1: .balign 4" "\n" \313 "2: .long " LOCAL_REFERENCE(function) "WithReturnAddress-1b" "\n" \314 );315 316 #define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJI(function) FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, 0, SH4_SCRATCH_REGISTER)317 #define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(function) FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, 4, SH4_SCRATCH_REGISTER)318 319 #endif320 321 #define P_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_E(function) \322 void* DFG_OPERATION function##WithReturnAddress(ExecState*, ReturnAddressPtr) REFERENCED_FROM_ASM WTF_INTERNAL; \323 FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_E(function)324 325 #define J_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_ECI(function) \326 EncodedJSValue DFG_OPERATION function##WithReturnAddress(ExecState*, JSCell*, StringImpl*, ReturnAddressPtr) REFERENCED_FROM_ASM WTF_INTERNAL; \327 FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_ECI(function)328 329 #define J_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJI(function) \330 EncodedJSValue DFG_OPERATION function##WithReturnAddress(ExecState*, EncodedJSValue, StringImpl*, ReturnAddressPtr) REFERENCED_FROM_ASM WTF_INTERNAL; \331 FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJI(function)332 333 #define V_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(function) \334 void DFG_OPERATION function##WithReturnAddress(ExecState*, EncodedJSValue, JSCell*, StringImpl*, ReturnAddressPtr) REFERENCED_FROM_ASM WTF_INTERNAL; \335 FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(function)336 61 337 62 namespace JSC { namespace DFG { … … 358 83 359 84 template<bool strict> 360 ALWAYS_INLINE static void DFG_OPERATION operationPutByValInternal(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedProperty, EncodedJSValue encodedValue)85 ALWAYS_INLINE static void JIT_OPERATION operationPutByValInternal(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedProperty, EncodedJSValue encodedValue) 361 86 { 362 87 VM* vm = &exec->vm(); … … 467 192 extern "C" { 468 193 469 EncodedJSValue DFG_OPERATION operationToThis(ExecState* exec, EncodedJSValue encodedOp)194 EncodedJSValue JIT_OPERATION operationToThis(ExecState* exec, EncodedJSValue encodedOp) 470 195 { 471 196 VM* vm = &exec->vm(); … … 475 200 } 476 201 477 EncodedJSValue DFG_OPERATION operationToThisStrict(ExecState* exec, EncodedJSValue encodedOp)202 EncodedJSValue JIT_OPERATION operationToThisStrict(ExecState* exec, EncodedJSValue encodedOp) 478 203 { 479 204 VM* vm = &exec->vm(); … … 483 208 } 484 209 485 JSCell* DFG_OPERATION operationCreateThis(ExecState* exec, JSObject* constructor, int32_t inlineCapacity)210 JSCell* JIT_OPERATION operationCreateThis(ExecState* exec, JSObject* constructor, int32_t inlineCapacity) 486 211 { 487 212 VM* vm = &exec->vm(); … … 496 221 } 497 222 498 JSCell* DFG_OPERATION operationNewObject(ExecState* exec, Structure* structure)223 JSCell* JIT_OPERATION operationNewObject(ExecState* exec, Structure* structure) 499 224 { 500 225 VM* vm = &exec->vm(); … … 504 229 } 505 230 506 EncodedJSValue DFG_OPERATION operationValueAdd(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)231 EncodedJSValue JIT_OPERATION operationValueAdd(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) 507 232 { 508 233 VM* vm = &exec->vm(); … … 515 240 } 516 241 517 EncodedJSValue DFG_OPERATION operationValueAddNotNumber(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)242 EncodedJSValue JIT_OPERATION operationValueAddNotNumber(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) 518 243 { 519 244 VM* vm = &exec->vm(); … … 548 273 } 549 274 550 EncodedJSValue DFG_OPERATION operationGetByVal(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedProperty)275 EncodedJSValue JIT_OPERATION operationGetByVal(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedProperty) 551 276 { 552 277 VM* vm = &exec->vm(); … … 579 304 } 580 305 581 EncodedJSValue DFG_OPERATION operationGetByValCell(ExecState* exec, JSCell* base, EncodedJSValue encodedProperty)306 EncodedJSValue JIT_OPERATION operationGetByValCell(ExecState* exec, JSCell* base, EncodedJSValue encodedProperty) 582 307 { 583 308 VM* vm = &exec->vm(); … … 619 344 } 620 345 621 EncodedJSValue DFG_OPERATION operationGetByValArrayInt(ExecState* exec, JSArray* base, int32_t index)346 EncodedJSValue JIT_OPERATION operationGetByValArrayInt(ExecState* exec, JSArray* base, int32_t index) 622 347 { 623 348 return getByValCellInt(exec, base, index); 624 349 } 625 350 626 EncodedJSValue DFG_OPERATION operationGetByValStringInt(ExecState* exec, JSString* base, int32_t index)351 EncodedJSValue JIT_OPERATION operationGetByValStringInt(ExecState* exec, JSString* base, int32_t index) 627 352 { 628 353 return getByValCellInt(exec, base, index); 629 354 } 630 355 631 EncodedJSValue DFG_OPERATION operationGetById(ExecState* exec, EncodedJSValue base, StringImpl* uid) 632 { 633 VM* vm = &exec->vm(); 634 NativeCallFrameTracer tracer(vm, exec); 635 636 JSValue baseValue = JSValue::decode(base); 637 PropertySlot slot(baseValue); 638 Identifier ident(vm, uid); 639 return JSValue::encode(baseValue.get(exec, ident, slot)); 640 } 641 642 J_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJI(operationGetByIdBuildList); 643 EncodedJSValue DFG_OPERATION operationGetByIdBuildListWithReturnAddress(ExecState* exec, EncodedJSValue base, StringImpl* uid, ReturnAddressPtr returnAddress) 644 { 645 VM* vm = &exec->vm(); 646 NativeCallFrameTracer tracer(vm, exec); 647 648 Identifier ident(vm, uid); 649 StructureStubInfo& stubInfo = exec->codeBlock()->getStubInfo(returnAddress); 650 AccessType accessType = static_cast<AccessType>(stubInfo.accessType); 651 652 JSValue baseValue = JSValue::decode(base); 653 PropertySlot slot(baseValue); 654 JSValue result = baseValue.get(exec, ident, slot); 655 656 if (accessType == static_cast<AccessType>(stubInfo.accessType)) 657 buildGetByIDList(exec, baseValue, ident, slot, stubInfo); 658 659 return JSValue::encode(result); 660 } 661 662 J_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJI(operationGetByIdOptimize); 663 EncodedJSValue DFG_OPERATION operationGetByIdOptimizeWithReturnAddress(ExecState* exec, EncodedJSValue base, StringImpl* uid, ReturnAddressPtr returnAddress) 664 { 665 VM* vm = &exec->vm(); 666 NativeCallFrameTracer tracer(vm, exec); 667 668 Identifier ident(vm, uid); 669 StructureStubInfo& stubInfo = exec->codeBlock()->getStubInfo(returnAddress); 670 AccessType accessType = static_cast<AccessType>(stubInfo.accessType); 671 672 JSValue baseValue = JSValue::decode(base); 673 PropertySlot slot(baseValue); 674 JSValue result = baseValue.get(exec, ident, slot); 675 676 if (accessType == static_cast<AccessType>(stubInfo.accessType)) { 677 if (stubInfo.seen) 678 repatchGetByID(exec, baseValue, ident, slot, stubInfo); 679 else 680 stubInfo.seen = true; 681 } 682 683 return JSValue::encode(result); 684 } 685 686 J_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_ECI(operationInOptimize); 687 EncodedJSValue DFG_OPERATION operationInOptimizeWithReturnAddress(ExecState* exec, JSCell* base, StringImpl* key, ReturnAddressPtr returnAddress) 688 { 689 VM* vm = &exec->vm(); 690 NativeCallFrameTracer tracer(vm, exec); 691 692 if (!base->isObject()) { 693 vm->throwException(exec, createInvalidParameterError(exec, "in", base)); 694 return JSValue::encode(jsUndefined()); 695 } 696 697 StructureStubInfo& stubInfo = exec->codeBlock()->getStubInfo(returnAddress); 698 AccessType accessType = static_cast<AccessType>(stubInfo.accessType); 699 700 Identifier ident(vm, key); 701 PropertySlot slot(base); 702 bool result = asObject(base)->getPropertySlot(exec, ident, slot); 703 704 RELEASE_ASSERT(accessType == stubInfo.accessType); 705 706 if (stubInfo.seen) 707 repatchIn(exec, base, ident, result, slot, stubInfo); 708 else 709 stubInfo.seen = true; 710 711 return JSValue::encode(jsBoolean(result)); 712 } 713 714 EncodedJSValue DFG_OPERATION operationIn(ExecState* exec, JSCell* base, StringImpl* key) 715 { 716 VM* vm = &exec->vm(); 717 NativeCallFrameTracer tracer(vm, exec); 718 719 if (!base->isObject()) { 720 vm->throwException(exec, createInvalidParameterError(exec, "in", base)); 721 return JSValue::encode(jsUndefined()); 722 } 723 724 Identifier ident(vm, key); 725 return JSValue::encode(jsBoolean(asObject(base)->hasProperty(exec, ident))); 726 } 727 728 EncodedJSValue DFG_OPERATION operationGenericIn(ExecState* exec, JSCell* base, EncodedJSValue key) 729 { 730 VM* vm = &exec->vm(); 731 NativeCallFrameTracer tracer(vm, exec); 732 733 return JSValue::encode(jsBoolean(CommonSlowPaths::opIn(exec, JSValue::decode(key), base))); 734 } 735 736 EncodedJSValue DFG_OPERATION operationCallCustomGetter(ExecState* exec, JSCell* base, PropertySlot::GetValueFunc function, StringImpl* uid) 737 { 738 VM* vm = &exec->vm(); 739 NativeCallFrameTracer tracer(vm, exec); 740 741 Identifier ident(vm, uid); 742 743 return JSValue::encode(function(exec, asObject(base), ident)); 744 } 745 746 EncodedJSValue DFG_OPERATION operationCallGetter(ExecState* exec, JSCell* base, JSCell* getterSetter) 747 { 748 VM* vm = &exec->vm(); 749 NativeCallFrameTracer tracer(vm, exec); 750 751 return JSValue::encode(callGetter(exec, base, getterSetter)); 752 } 753 754 void DFG_OPERATION operationPutByValStrict(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedProperty, EncodedJSValue encodedValue) 356 void JIT_OPERATION operationPutByValStrict(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedProperty, EncodedJSValue encodedValue) 755 357 { 756 358 VM* vm = &exec->vm(); … … 760 362 } 761 363 762 void DFG_OPERATION operationPutByValNonStrict(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedProperty, EncodedJSValue encodedValue)364 void JIT_OPERATION operationPutByValNonStrict(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedProperty, EncodedJSValue encodedValue) 763 365 { 764 366 VM* vm = &exec->vm(); … … 768 370 } 769 371 770 void DFG_OPERATION operationPutByValCellStrict(ExecState* exec, JSCell* cell, EncodedJSValue encodedProperty, EncodedJSValue encodedValue)372 void JIT_OPERATION operationPutByValCellStrict(ExecState* exec, JSCell* cell, EncodedJSValue encodedProperty, EncodedJSValue encodedValue) 771 373 { 772 374 VM* vm = &exec->vm(); … … 776 378 } 777 379 778 void DFG_OPERATION operationPutByValCellNonStrict(ExecState* exec, JSCell* cell, EncodedJSValue encodedProperty, EncodedJSValue encodedValue)380 void JIT_OPERATION operationPutByValCellNonStrict(ExecState* exec, JSCell* cell, EncodedJSValue encodedProperty, EncodedJSValue encodedValue) 779 381 { 780 382 VM* vm = &exec->vm(); … … 784 386 } 785 387 786 void DFG_OPERATION operationPutByValBeyondArrayBoundsStrict(ExecState* exec, JSObject* array, int32_t index, EncodedJSValue encodedValue)388 void JIT_OPERATION operationPutByValBeyondArrayBoundsStrict(ExecState* exec, JSObject* array, int32_t index, EncodedJSValue encodedValue) 787 389 { 788 390 VM* vm = &exec->vm(); … … 799 401 } 800 402 801 void DFG_OPERATION operationPutByValBeyondArrayBoundsNonStrict(ExecState* exec, JSObject* array, int32_t index, EncodedJSValue encodedValue)403 void JIT_OPERATION operationPutByValBeyondArrayBoundsNonStrict(ExecState* exec, JSObject* array, int32_t index, EncodedJSValue encodedValue) 802 404 { 803 405 VM* vm = &exec->vm(); … … 814 416 } 815 417 816 void DFG_OPERATION operationPutDoubleByValBeyondArrayBoundsStrict(ExecState* exec, JSObject* array, int32_t index, double value)418 void JIT_OPERATION operationPutDoubleByValBeyondArrayBoundsStrict(ExecState* exec, JSObject* array, int32_t index, double value) 817 419 { 818 420 VM* vm = &exec->vm(); … … 831 433 } 832 434 833 void DFG_OPERATION operationPutDoubleByValBeyondArrayBoundsNonStrict(ExecState* exec, JSObject* array, int32_t index, double value)435 void JIT_OPERATION operationPutDoubleByValBeyondArrayBoundsNonStrict(ExecState* exec, JSObject* array, int32_t index, double value) 834 436 { 835 437 VM* vm = &exec->vm(); … … 848 450 } 849 451 850 EncodedJSValue DFG_OPERATION operationArrayPush(ExecState* exec, EncodedJSValue encodedValue, JSArray* array)452 EncodedJSValue JIT_OPERATION operationArrayPush(ExecState* exec, EncodedJSValue encodedValue, JSArray* array) 851 453 { 852 454 VM* vm = &exec->vm(); … … 857 459 } 858 460 859 EncodedJSValue DFG_OPERATION operationArrayPushDouble(ExecState* exec, double value, JSArray* array)461 EncodedJSValue JIT_OPERATION operationArrayPushDouble(ExecState* exec, double value, JSArray* array) 860 462 { 861 463 VM* vm = &exec->vm(); … … 866 468 } 867 469 868 EncodedJSValue DFG_OPERATION operationArrayPop(ExecState* exec, JSArray* array)470 EncodedJSValue JIT_OPERATION operationArrayPop(ExecState* exec, JSArray* array) 869 471 { 870 472 VM* vm = &exec->vm(); … … 874 476 } 875 477 876 EncodedJSValue DFG_OPERATION operationArrayPopAndRecoverLength(ExecState* exec, JSArray* array)478 EncodedJSValue JIT_OPERATION operationArrayPopAndRecoverLength(ExecState* exec, JSArray* array) 877 479 { 878 480 VM* vm = &exec->vm(); … … 884 486 } 885 487 886 EncodedJSValue DFG_OPERATION operationRegExpExec(ExecState* exec, JSCell* base, JSCell* argument)488 EncodedJSValue JIT_OPERATION operationRegExpExec(ExecState* exec, JSCell* base, JSCell* argument) 887 489 { 888 490 VM& vm = exec->vm(); … … 897 499 } 898 500 899 size_t DFG_OPERATION operationRegExpTest(ExecState* exec, JSCell* base, JSCell* argument)501 size_t JIT_OPERATION operationRegExpTest(ExecState* exec, JSCell* base, JSCell* argument) 900 502 { 901 503 VM& vm = exec->vm(); … … 912 514 } 913 515 914 void DFG_OPERATION operationPutByIdStrict(ExecState* exec, EncodedJSValue encodedValue, JSCell* base, StringImpl* uid) 915 { 916 VM* vm = &exec->vm(); 917 NativeCallFrameTracer tracer(vm, exec); 918 919 Identifier ident(vm, uid); 920 PutPropertySlot slot(true, exec->codeBlock()->putByIdContext()); 921 base->methodTable()->put(base, exec, ident, JSValue::decode(encodedValue), slot); 922 } 923 924 void DFG_OPERATION operationPutByIdNonStrict(ExecState* exec, EncodedJSValue encodedValue, JSCell* base, StringImpl* uid) 925 { 926 VM* vm = &exec->vm(); 927 NativeCallFrameTracer tracer(vm, exec); 928 929 Identifier ident(vm, uid); 930 PutPropertySlot slot(false, exec->codeBlock()->putByIdContext()); 931 base->methodTable()->put(base, exec, ident, JSValue::decode(encodedValue), slot); 932 } 933 934 void DFG_OPERATION operationPutByIdDirectStrict(ExecState* exec, EncodedJSValue encodedValue, JSCell* base, StringImpl* uid) 935 { 936 VM* vm = &exec->vm(); 937 NativeCallFrameTracer tracer(vm, exec); 938 939 Identifier ident(vm, uid); 940 PutPropertySlot slot(true, exec->codeBlock()->putByIdContext()); 941 ASSERT(base->isObject()); 942 asObject(base)->putDirect(exec->vm(), ident, JSValue::decode(encodedValue), slot); 943 } 944 945 void DFG_OPERATION operationPutByIdDirectNonStrict(ExecState* exec, EncodedJSValue encodedValue, JSCell* base, StringImpl* uid) 946 { 947 VM* vm = &exec->vm(); 948 NativeCallFrameTracer tracer(vm, exec); 949 950 Identifier ident(vm, uid); 951 PutPropertySlot slot(false, exec->codeBlock()->putByIdContext()); 952 ASSERT(base->isObject()); 953 asObject(base)->putDirect(exec->vm(), ident, JSValue::decode(encodedValue), slot); 954 } 955 956 V_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(operationPutByIdStrictOptimize); 957 void DFG_OPERATION operationPutByIdStrictOptimizeWithReturnAddress(ExecState* exec, EncodedJSValue encodedValue, JSCell* base, StringImpl* uid, ReturnAddressPtr returnAddress) 958 { 959 VM* vm = &exec->vm(); 960 NativeCallFrameTracer tracer(vm, exec); 961 962 Identifier ident(vm, uid); 963 StructureStubInfo& stubInfo = exec->codeBlock()->getStubInfo(returnAddress); 964 AccessType accessType = static_cast<AccessType>(stubInfo.accessType); 965 966 JSValue value = JSValue::decode(encodedValue); 967 JSValue baseValue(base); 968 PutPropertySlot slot(true, exec->codeBlock()->putByIdContext()); 969 970 baseValue.put(exec, ident, value, slot); 971 972 if (accessType != static_cast<AccessType>(stubInfo.accessType)) 973 return; 974 975 if (stubInfo.seen) 976 repatchPutByID(exec, baseValue, ident, slot, stubInfo, NotDirect); 977 else 978 stubInfo.seen = true; 979 } 980 981 V_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(operationPutByIdNonStrictOptimize); 982 void DFG_OPERATION operationPutByIdNonStrictOptimizeWithReturnAddress(ExecState* exec, EncodedJSValue encodedValue, JSCell* base, StringImpl* uid, ReturnAddressPtr returnAddress) 983 { 984 VM* vm = &exec->vm(); 985 NativeCallFrameTracer tracer(vm, exec); 986 987 Identifier ident(vm, uid); 988 StructureStubInfo& stubInfo = exec->codeBlock()->getStubInfo(returnAddress); 989 AccessType accessType = static_cast<AccessType>(stubInfo.accessType); 990 991 JSValue value = JSValue::decode(encodedValue); 992 JSValue baseValue(base); 993 PutPropertySlot slot(false, exec->codeBlock()->putByIdContext()); 994 995 baseValue.put(exec, ident, value, slot); 996 997 if (accessType != static_cast<AccessType>(stubInfo.accessType)) 998 return; 999 1000 if (stubInfo.seen) 1001 repatchPutByID(exec, baseValue, ident, slot, stubInfo, NotDirect); 1002 else 1003 stubInfo.seen = true; 1004 } 1005 1006 V_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(operationPutByIdDirectStrictOptimize); 1007 void DFG_OPERATION operationPutByIdDirectStrictOptimizeWithReturnAddress(ExecState* exec, EncodedJSValue encodedValue, JSCell* base, StringImpl* uid, ReturnAddressPtr returnAddress) 1008 { 1009 VM* vm = &exec->vm(); 1010 NativeCallFrameTracer tracer(vm, exec); 1011 1012 Identifier ident(vm, uid); 1013 StructureStubInfo& stubInfo = exec->codeBlock()->getStubInfo(returnAddress); 1014 AccessType accessType = static_cast<AccessType>(stubInfo.accessType); 1015 1016 JSValue value = JSValue::decode(encodedValue); 1017 PutPropertySlot slot(true, exec->codeBlock()->putByIdContext()); 1018 1019 ASSERT(base->isObject()); 1020 asObject(base)->putDirect(exec->vm(), ident, value, slot); 1021 1022 if (accessType != static_cast<AccessType>(stubInfo.accessType)) 1023 return; 1024 1025 if (stubInfo.seen) 1026 repatchPutByID(exec, base, ident, slot, stubInfo, Direct); 1027 else 1028 stubInfo.seen = true; 1029 } 1030 1031 V_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(operationPutByIdDirectNonStrictOptimize); 1032 void DFG_OPERATION operationPutByIdDirectNonStrictOptimizeWithReturnAddress(ExecState* exec, EncodedJSValue encodedValue, JSCell* base, StringImpl* uid, ReturnAddressPtr returnAddress) 1033 { 1034 VM* vm = &exec->vm(); 1035 NativeCallFrameTracer tracer(vm, exec); 1036 1037 Identifier ident(vm, uid); 1038 StructureStubInfo& stubInfo = exec->codeBlock()->getStubInfo(returnAddress); 1039 AccessType accessType = static_cast<AccessType>(stubInfo.accessType); 1040 1041 JSValue value = JSValue::decode(encodedValue); 1042 PutPropertySlot slot(false, exec->codeBlock()->putByIdContext()); 1043 1044 ASSERT(base->isObject()); 1045 asObject(base)->putDirect(exec->vm(), ident, value, slot); 1046 1047 if (accessType != static_cast<AccessType>(stubInfo.accessType)) 1048 return; 1049 1050 if (stubInfo.seen) 1051 repatchPutByID(exec, base, ident, slot, stubInfo, Direct); 1052 else 1053 stubInfo.seen = true; 1054 } 1055 1056 V_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(operationPutByIdStrictBuildList); 1057 void DFG_OPERATION operationPutByIdStrictBuildListWithReturnAddress(ExecState* exec, EncodedJSValue encodedValue, JSCell* base, StringImpl* uid, ReturnAddressPtr returnAddress) 1058 { 1059 VM* vm = &exec->vm(); 1060 NativeCallFrameTracer tracer(vm, exec); 1061 1062 Identifier ident(vm, uid); 1063 StructureStubInfo& stubInfo = exec->codeBlock()->getStubInfo(returnAddress); 1064 AccessType accessType = static_cast<AccessType>(stubInfo.accessType); 1065 1066 JSValue value = JSValue::decode(encodedValue); 1067 JSValue baseValue(base); 1068 PutPropertySlot slot(true, exec->codeBlock()->putByIdContext()); 1069 1070 baseValue.put(exec, ident, value, slot); 1071 1072 if (accessType != static_cast<AccessType>(stubInfo.accessType)) 1073 return; 1074 1075 buildPutByIdList(exec, baseValue, ident, slot, stubInfo, NotDirect); 1076 } 1077 1078 V_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(operationPutByIdNonStrictBuildList); 1079 void DFG_OPERATION operationPutByIdNonStrictBuildListWithReturnAddress(ExecState* exec, EncodedJSValue encodedValue, JSCell* base, StringImpl* uid, ReturnAddressPtr returnAddress) 1080 { 1081 VM* vm = &exec->vm(); 1082 NativeCallFrameTracer tracer(vm, exec); 1083 1084 Identifier ident(vm, uid); 1085 StructureStubInfo& stubInfo = exec->codeBlock()->getStubInfo(returnAddress); 1086 AccessType accessType = static_cast<AccessType>(stubInfo.accessType); 1087 1088 JSValue value = JSValue::decode(encodedValue); 1089 JSValue baseValue(base); 1090 PutPropertySlot slot(false, exec->codeBlock()->putByIdContext()); 1091 1092 baseValue.put(exec, ident, value, slot); 1093 1094 if (accessType != static_cast<AccessType>(stubInfo.accessType)) 1095 return; 1096 1097 buildPutByIdList(exec, baseValue, ident, slot, stubInfo, NotDirect); 1098 } 1099 1100 V_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(operationPutByIdDirectStrictBuildList); 1101 void DFG_OPERATION operationPutByIdDirectStrictBuildListWithReturnAddress(ExecState* exec, EncodedJSValue encodedValue, JSCell* base, StringImpl* uid, ReturnAddressPtr returnAddress) 1102 { 1103 VM* vm = &exec->vm(); 1104 NativeCallFrameTracer tracer(vm, exec); 1105 1106 Identifier ident(vm, uid); 1107 StructureStubInfo& stubInfo = exec->codeBlock()->getStubInfo(returnAddress); 1108 AccessType accessType = static_cast<AccessType>(stubInfo.accessType); 1109 1110 JSValue value = JSValue::decode(encodedValue); 1111 PutPropertySlot slot(true, exec->codeBlock()->putByIdContext()); 1112 1113 ASSERT(base->isObject()); 1114 asObject(base)->putDirect(exec->vm(), ident, value, slot); 1115 1116 if (accessType != static_cast<AccessType>(stubInfo.accessType)) 1117 return; 1118 1119 buildPutByIdList(exec, base, ident, slot, stubInfo, Direct); 1120 } 1121 1122 V_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(operationPutByIdDirectNonStrictBuildList); 1123 void DFG_OPERATION operationPutByIdDirectNonStrictBuildListWithReturnAddress(ExecState* exec, EncodedJSValue encodedValue, JSCell* base, StringImpl* uid, ReturnAddressPtr returnAddress) 1124 { 1125 VM* vm = &exec->vm(); 1126 NativeCallFrameTracer tracer(vm, exec); 1127 1128 Identifier ident(vm, uid); 1129 StructureStubInfo& stubInfo = exec->codeBlock()->getStubInfo(returnAddress); 1130 AccessType accessType = static_cast<AccessType>(stubInfo.accessType); 1131 1132 JSValue value = JSValue::decode(encodedValue); 1133 PutPropertySlot slot(false, exec->codeBlock()->putByIdContext()); 1134 1135 ASSERT(base->isObject()); 1136 asObject(base)->putDirect(exec->vm(), ident, value, slot); 1137 1138 if (accessType != static_cast<AccessType>(stubInfo.accessType)) 1139 return; 1140 1141 buildPutByIdList(exec, base, ident, slot, stubInfo, Direct); 1142 } 1143 1144 size_t DFG_OPERATION operationCompareLess(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) 516 size_t JIT_OPERATION operationCompareLess(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) 1145 517 { 1146 518 VM* vm = &exec->vm(); … … 1150 522 } 1151 523 1152 size_t DFG_OPERATION operationCompareLessEq(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)524 size_t JIT_OPERATION operationCompareLessEq(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) 1153 525 { 1154 526 VM* vm = &exec->vm(); … … 1158 530 } 1159 531 1160 size_t DFG_OPERATION operationCompareGreater(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)532 size_t JIT_OPERATION operationCompareGreater(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) 1161 533 { 1162 534 VM* vm = &exec->vm(); … … 1166 538 } 1167 539 1168 size_t DFG_OPERATION operationCompareGreaterEq(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)540 size_t JIT_OPERATION operationCompareGreaterEq(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) 1169 541 { 1170 542 VM* vm = &exec->vm(); … … 1174 546 } 1175 547 1176 size_t DFG_OPERATION operationCompareEq(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)548 size_t JIT_OPERATION operationCompareEq(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) 1177 549 { 1178 550 VM* vm = &exec->vm(); … … 1183 555 1184 556 #if USE(JSVALUE64) 1185 EncodedJSValue DFG_OPERATION operationCompareStringEq(ExecState* exec, JSCell* left, JSCell* right)557 EncodedJSValue JIT_OPERATION operationCompareStringEq(ExecState* exec, JSCell* left, JSCell* right) 1186 558 #else 1187 size_t DFG_OPERATION operationCompareStringEq(ExecState* exec, JSCell* left, JSCell* right)559 size_t JIT_OPERATION operationCompareStringEq(ExecState* exec, JSCell* left, JSCell* right) 1188 560 #endif 1189 561 { … … 1199 571 } 1200 572 1201 size_t DFG_OPERATION operationCompareStrictEqCell(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)573 size_t JIT_OPERATION operationCompareStrictEqCell(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) 1202 574 { 1203 575 VM* vm = &exec->vm(); … … 1213 585 } 1214 586 1215 size_t DFG_OPERATION operationCompareStrictEq(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)587 size_t JIT_OPERATION operationCompareStrictEq(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) 1216 588 { 1217 589 VM* vm = &exec->vm(); … … 1224 596 } 1225 597 1226 static void* handleHostCall(ExecState* execCallee, JSValue callee, CodeSpecializationKind kind) 1227 { 1228 ExecState* exec = execCallee->callerFrame(); 1229 VM* vm = &exec->vm(); 1230 1231 execCallee->setScope(exec->scope()); 1232 execCallee->setCodeBlock(0); 1233 1234 if (kind == CodeForCall) { 1235 CallData callData; 1236 CallType callType = getCallData(callee, callData); 1237 1238 ASSERT(callType != CallTypeJS); 1239 1240 if (callType == CallTypeHost) { 1241 NativeCallFrameTracer tracer(vm, execCallee); 1242 execCallee->setCallee(asObject(callee)); 1243 vm->hostCallReturnValue = JSValue::decode(callData.native.function(execCallee)); 1244 if (vm->exception()) 1245 return vm->getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(); 1246 1247 return reinterpret_cast<void*>(getHostCallReturnValue); 1248 } 1249 1250 ASSERT(callType == CallTypeNone); 1251 exec->vm().throwException(exec, createNotAFunctionError(exec, callee)); 1252 return vm->getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(); 1253 } 1254 1255 ASSERT(kind == CodeForConstruct); 1256 1257 ConstructData constructData; 1258 ConstructType constructType = getConstructData(callee, constructData); 1259 1260 ASSERT(constructType != ConstructTypeJS); 1261 1262 if (constructType == ConstructTypeHost) { 1263 NativeCallFrameTracer tracer(vm, execCallee); 1264 execCallee->setCallee(asObject(callee)); 1265 vm->hostCallReturnValue = JSValue::decode(constructData.native.function(execCallee)); 1266 if (vm->exception()) 1267 return vm->getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(); 1268 1269 return reinterpret_cast<void*>(getHostCallReturnValue); 1270 } 1271 1272 ASSERT(constructType == ConstructTypeNone); 1273 exec->vm().throwException(exec, createNotAConstructorError(exec, callee)); 1274 return vm->getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(); 1275 } 1276 1277 inline char* linkFor(ExecState* execCallee, CodeSpecializationKind kind) 1278 { 1279 ExecState* exec = execCallee->callerFrame(); 1280 VM* vm = &exec->vm(); 1281 NativeCallFrameTracer tracer(vm, exec); 1282 1283 JSValue calleeAsValue = execCallee->calleeAsValue(); 1284 JSCell* calleeAsFunctionCell = getJSFunction(calleeAsValue); 1285 if (!calleeAsFunctionCell) 1286 return reinterpret_cast<char*>(handleHostCall(execCallee, calleeAsValue, kind)); 1287 1288 JSFunction* callee = jsCast<JSFunction*>(calleeAsFunctionCell); 1289 execCallee->setScope(callee->scopeUnchecked()); 1290 ExecutableBase* executable = callee->executable(); 1291 1292 MacroAssemblerCodePtr codePtr; 1293 CodeBlock* codeBlock = 0; 1294 if (executable->isHostFunction()) 1295 codePtr = executable->generatedJITCodeFor(kind)->addressForCall(); 1296 else { 1297 FunctionExecutable* functionExecutable = static_cast<FunctionExecutable*>(executable); 1298 JSObject* error = functionExecutable->prepareForExecution(execCallee, callee->scope(), kind); 1299 if (error) { 1300 vm->throwException(exec, createStackOverflowError(exec)); 1301 return reinterpret_cast<char*>(vm->getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress()); 1302 } 1303 codeBlock = functionExecutable->codeBlockFor(kind); 1304 if (execCallee->argumentCountIncludingThis() < static_cast<size_t>(codeBlock->numParameters())) 1305 codePtr = functionExecutable->generatedJITCodeWithArityCheckFor(kind); 1306 else 1307 codePtr = functionExecutable->generatedJITCodeFor(kind)->addressForCall(); 1308 } 1309 CallLinkInfo& callLinkInfo = exec->codeBlock()->getCallLinkInfo(execCallee->returnPC()); 1310 if (!callLinkInfo.seenOnce()) 1311 callLinkInfo.setSeen(); 1312 else 1313 linkFor(execCallee, callLinkInfo, codeBlock, callee, codePtr, kind); 1314 return reinterpret_cast<char*>(codePtr.executableAddress()); 1315 } 1316 1317 char* DFG_OPERATION operationLinkCall(ExecState* execCallee) 1318 { 1319 return linkFor(execCallee, CodeForCall); 1320 } 1321 1322 char* DFG_OPERATION operationLinkConstruct(ExecState* execCallee) 1323 { 1324 return linkFor(execCallee, CodeForConstruct); 1325 } 1326 1327 inline char* virtualForWithFunction(ExecState* execCallee, CodeSpecializationKind kind, JSCell*& calleeAsFunctionCell) 1328 { 1329 ExecState* exec = execCallee->callerFrame(); 1330 VM* vm = &exec->vm(); 1331 NativeCallFrameTracer tracer(vm, exec); 1332 1333 JSValue calleeAsValue = execCallee->calleeAsValue(); 1334 calleeAsFunctionCell = getJSFunction(calleeAsValue); 1335 if (UNLIKELY(!calleeAsFunctionCell)) 1336 return reinterpret_cast<char*>(handleHostCall(execCallee, calleeAsValue, kind)); 1337 1338 JSFunction* function = jsCast<JSFunction*>(calleeAsFunctionCell); 1339 execCallee->setScope(function->scopeUnchecked()); 1340 ExecutableBase* executable = function->executable(); 1341 if (UNLIKELY(!executable->hasJITCodeFor(kind))) { 1342 FunctionExecutable* functionExecutable = static_cast<FunctionExecutable*>(executable); 1343 JSObject* error = functionExecutable->prepareForExecution(execCallee, function->scope(), kind); 1344 if (error) { 1345 exec->vm().throwException(execCallee, error); 1346 return reinterpret_cast<char*>(vm->getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress()); 1347 } 1348 } 1349 return reinterpret_cast<char*>(executable->generatedJITCodeWithArityCheckFor(kind).executableAddress()); 1350 } 1351 1352 inline char* virtualFor(ExecState* execCallee, CodeSpecializationKind kind) 1353 { 1354 JSCell* calleeAsFunctionCellIgnored; 1355 return virtualForWithFunction(execCallee, kind, calleeAsFunctionCellIgnored); 1356 } 1357 1358 static bool attemptToOptimizeClosureCall(ExecState* execCallee, JSCell* calleeAsFunctionCell, CallLinkInfo& callLinkInfo) 1359 { 1360 if (!calleeAsFunctionCell) 1361 return false; 1362 1363 JSFunction* callee = jsCast<JSFunction*>(calleeAsFunctionCell); 1364 JSFunction* oldCallee = callLinkInfo.callee.get(); 1365 1366 if (!oldCallee 1367 || oldCallee->structure() != callee->structure() 1368 || oldCallee->executable() != callee->executable()) 1369 return false; 1370 1371 ASSERT(callee->executable()->hasJITCodeForCall()); 1372 MacroAssemblerCodePtr codePtr = callee->executable()->generatedJITCodeForCall()->addressForCall(); 1373 1374 CodeBlock* codeBlock; 1375 if (callee->executable()->isHostFunction()) 1376 codeBlock = 0; 1377 else { 1378 codeBlock = jsCast<FunctionExecutable*>(callee->executable())->codeBlockForCall(); 1379 if (execCallee->argumentCountIncludingThis() < static_cast<size_t>(codeBlock->numParameters())) 1380 return false; 1381 } 1382 1383 linkClosureCall( 1384 execCallee, callLinkInfo, codeBlock, 1385 callee->structure(), callee->executable(), codePtr); 1386 1387 return true; 1388 } 1389 1390 char* DFG_OPERATION operationLinkClosureCall(ExecState* execCallee) 1391 { 1392 JSCell* calleeAsFunctionCell; 1393 char* result = virtualForWithFunction(execCallee, CodeForCall, calleeAsFunctionCell); 1394 CallLinkInfo& callLinkInfo = execCallee->callerFrame()->codeBlock()->getCallLinkInfo(execCallee->returnPC()); 1395 1396 if (!attemptToOptimizeClosureCall(execCallee, calleeAsFunctionCell, callLinkInfo)) 1397 linkSlowFor(execCallee, callLinkInfo, CodeForCall); 1398 1399 return result; 1400 } 1401 1402 char* DFG_OPERATION operationVirtualCall(ExecState* execCallee) 1403 { 1404 return virtualFor(execCallee, CodeForCall); 1405 } 1406 1407 char* DFG_OPERATION operationVirtualConstruct(ExecState* execCallee) 1408 { 1409 return virtualFor(execCallee, CodeForConstruct); 1410 } 1411 1412 EncodedJSValue DFG_OPERATION operationToPrimitive(ExecState* exec, EncodedJSValue value) 598 EncodedJSValue JIT_OPERATION operationToPrimitive(ExecState* exec, EncodedJSValue value) 1413 599 { 1414 600 VM* vm = &exec->vm(); … … 1418 604 } 1419 605 1420 char* DFG_OPERATION operationNewArray(ExecState* exec, Structure* arrayStructure, void* buffer, size_t size)606 char* JIT_OPERATION operationNewArray(ExecState* exec, Structure* arrayStructure, void* buffer, size_t size) 1421 607 { 1422 608 VM* vm = &exec->vm(); … … 1426 612 } 1427 613 1428 char* DFG_OPERATION operationNewEmptyArray(ExecState* exec, Structure* arrayStructure)614 char* JIT_OPERATION operationNewEmptyArray(ExecState* exec, Structure* arrayStructure) 1429 615 { 1430 616 VM* vm = &exec->vm(); … … 1434 620 } 1435 621 1436 char* DFG_OPERATION operationNewArrayWithSize(ExecState* exec, Structure* arrayStructure, int32_t size)622 char* JIT_OPERATION operationNewArrayWithSize(ExecState* exec, Structure* arrayStructure, int32_t size) 1437 623 { 1438 624 VM* vm = &exec->vm(); … … 1445 631 } 1446 632 1447 char* DFG_OPERATION operationNewArrayBuffer(ExecState* exec, Structure* arrayStructure, size_t start, size_t size)633 char* JIT_OPERATION operationNewArrayBuffer(ExecState* exec, Structure* arrayStructure, size_t start, size_t size) 1448 634 { 1449 635 VM& vm = exec->vm(); … … 1452 638 } 1453 639 1454 char* DFG_OPERATION operationNewInt8ArrayWithSize(640 char* JIT_OPERATION operationNewInt8ArrayWithSize( 1455 641 ExecState* exec, Structure* structure, int32_t length) 1456 642 { … … 1458 644 } 1459 645 1460 char* DFG_OPERATION operationNewInt8ArrayWithOneArgument(646 char* JIT_OPERATION operationNewInt8ArrayWithOneArgument( 1461 647 ExecState* exec, Structure* structure, EncodedJSValue encodedValue) 1462 648 { … … 1464 650 } 1465 651 1466 char* DFG_OPERATION operationNewInt16ArrayWithSize(652 char* JIT_OPERATION operationNewInt16ArrayWithSize( 1467 653 ExecState* exec, Structure* structure, int32_t length) 1468 654 { … … 1470 656 } 1471 657 1472 char* DFG_OPERATION operationNewInt16ArrayWithOneArgument(658 char* JIT_OPERATION operationNewInt16ArrayWithOneArgument( 1473 659 ExecState* exec, Structure* structure, EncodedJSValue encodedValue) 1474 660 { … … 1476 662 } 1477 663 1478 char* DFG_OPERATION operationNewInt32ArrayWithSize(664 char* JIT_OPERATION operationNewInt32ArrayWithSize( 1479 665 ExecState* exec, Structure* structure, int32_t length) 1480 666 { … … 1482 668 } 1483 669 1484 char* DFG_OPERATION operationNewInt32ArrayWithOneArgument(670 char* JIT_OPERATION operationNewInt32ArrayWithOneArgument( 1485 671 ExecState* exec, Structure* structure, EncodedJSValue encodedValue) 1486 672 { … … 1488 674 } 1489 675 1490 char* DFG_OPERATION operationNewUint8ArrayWithSize(676 char* JIT_OPERATION operationNewUint8ArrayWithSize( 1491 677 ExecState* exec, Structure* structure, int32_t length) 1492 678 { … … 1494 680 } 1495 681 1496 char* DFG_OPERATION operationNewUint8ArrayWithOneArgument(682 char* JIT_OPERATION operationNewUint8ArrayWithOneArgument( 1497 683 ExecState* exec, Structure* structure, EncodedJSValue encodedValue) 1498 684 { … … 1500 686 } 1501 687 1502 char* DFG_OPERATION operationNewUint8ClampedArrayWithSize(688 char* JIT_OPERATION operationNewUint8ClampedArrayWithSize( 1503 689 ExecState* exec, Structure* structure, int32_t length) 1504 690 { … … 1506 692 } 1507 693 1508 char* DFG_OPERATION operationNewUint8ClampedArrayWithOneArgument(694 char* JIT_OPERATION operationNewUint8ClampedArrayWithOneArgument( 1509 695 ExecState* exec, Structure* structure, EncodedJSValue encodedValue) 1510 696 { … … 1512 698 } 1513 699 1514 char* DFG_OPERATION operationNewUint16ArrayWithSize(700 char* JIT_OPERATION operationNewUint16ArrayWithSize( 1515 701 ExecState* exec, Structure* structure, int32_t length) 1516 702 { … … 1518 704 } 1519 705 1520 char* DFG_OPERATION operationNewUint16ArrayWithOneArgument(706 char* JIT_OPERATION operationNewUint16ArrayWithOneArgument( 1521 707 ExecState* exec, Structure* structure, EncodedJSValue encodedValue) 1522 708 { … … 1524 710 } 1525 711 1526 char* DFG_OPERATION operationNewUint32ArrayWithSize(712 char* JIT_OPERATION operationNewUint32ArrayWithSize( 1527 713 ExecState* exec, Structure* structure, int32_t length) 1528 714 { … … 1530 716 } 1531 717 1532 char* DFG_OPERATION operationNewUint32ArrayWithOneArgument(718 char* JIT_OPERATION operationNewUint32ArrayWithOneArgument( 1533 719 ExecState* exec, Structure* structure, EncodedJSValue encodedValue) 1534 720 { … … 1536 722 } 1537 723 1538 char* DFG_OPERATION operationNewFloat32ArrayWithSize(724 char* JIT_OPERATION operationNewFloat32ArrayWithSize( 1539 725 ExecState* exec, Structure* structure, int32_t length) 1540 726 { … … 1542 728 } 1543 729 1544 char* DFG_OPERATION operationNewFloat32ArrayWithOneArgument(730 char* JIT_OPERATION operationNewFloat32ArrayWithOneArgument( 1545 731 ExecState* exec, Structure* structure, EncodedJSValue encodedValue) 1546 732 { … … 1548 734 } 1549 735 1550 char* DFG_OPERATION operationNewFloat64ArrayWithSize(736 char* JIT_OPERATION operationNewFloat64ArrayWithSize( 1551 737 ExecState* exec, Structure* structure, int32_t length) 1552 738 { … … 1554 740 } 1555 741 1556 char* DFG_OPERATION operationNewFloat64ArrayWithOneArgument(742 char* JIT_OPERATION operationNewFloat64ArrayWithOneArgument( 1557 743 ExecState* exec, Structure* structure, EncodedJSValue encodedValue) 1558 744 { … … 1560 746 } 1561 747 1562 EncodedJSValue DFG_OPERATION operationNewRegexp(ExecState* exec, void* regexpPtr)748 EncodedJSValue JIT_OPERATION operationNewRegexp(ExecState* exec, void* regexpPtr) 1563 749 { 1564 750 VM& vm = exec->vm(); … … 1573 759 } 1574 760 1575 JSCell* DFG_OPERATION operationCreateActivation(ExecState* exec)761 JSCell* JIT_OPERATION operationCreateActivation(ExecState* exec) 1576 762 { 1577 763 VM& vm = exec->vm(); … … 1582 768 } 1583 769 1584 JSCell* DFG_OPERATION operationCreateArguments(ExecState* exec)770 JSCell* JIT_OPERATION operationCreateArguments(ExecState* exec) 1585 771 { 1586 772 VM& vm = exec->vm(); … … 1593 779 } 1594 780 1595 JSCell* DFG_OPERATION operationCreateInlinedArguments(781 JSCell* JIT_OPERATION operationCreateInlinedArguments( 1596 782 ExecState* exec, InlineCallFrame* inlineCallFrame) 1597 783 { … … 1605 791 } 1606 792 1607 void DFG_OPERATION operationTearOffArguments(ExecState* exec, JSCell* argumentsCell, JSCell* activationCell)793 void JIT_OPERATION operationTearOffArguments(ExecState* exec, JSCell* argumentsCell, JSCell* activationCell) 1608 794 { 1609 795 ASSERT(exec->codeBlock()->usesArguments()); … … 1615 801 } 1616 802 1617 void DFG_OPERATION operationTearOffInlinedArguments(803 void JIT_OPERATION operationTearOffInlinedArguments( 1618 804 ExecState* exec, JSCell* argumentsCell, JSCell* activationCell, InlineCallFrame* inlineCallFrame) 1619 805 { … … 1622 808 } 1623 809 1624 EncodedJSValue DFG_OPERATION operationGetArgumentsLength(ExecState* exec, int32_t argumentsRegister)810 EncodedJSValue JIT_OPERATION operationGetArgumentsLength(ExecState* exec, int32_t argumentsRegister) 1625 811 { 1626 812 VM& vm = exec->vm(); … … 1634 820 } 1635 821 1636 EncodedJSValue DFG_OPERATION operationGetArgumentByVal(ExecState* exec, int32_t argumentsRegister, int32_t index)822 EncodedJSValue JIT_OPERATION operationGetArgumentByVal(ExecState* exec, int32_t argumentsRegister, int32_t index) 1637 823 { 1638 824 VM& vm = exec->vm(); … … 1649 835 } 1650 836 1651 EncodedJSValue DFG_OPERATION operationGetInlinedArgumentByVal(837 EncodedJSValue JIT_OPERATION operationGetInlinedArgumentByVal( 1652 838 ExecState* exec, int32_t argumentsRegister, InlineCallFrame* inlineCallFrame, int32_t index) 1653 839 { … … 1667 853 } 1668 854 1669 JSCell* DFG_OPERATION operationNewFunctionNoCheck(ExecState* exec, JSCell* functionExecutable)855 JSCell* JIT_OPERATION operationNewFunctionNoCheck(ExecState* exec, JSCell* functionExecutable) 1670 856 { 1671 857 ASSERT(functionExecutable->inherits(FunctionExecutable::info())); … … 1675 861 } 1676 862 1677 EncodedJSValue DFG_OPERATION operationNewFunction(ExecState* exec, JSCell* functionExecutable)863 EncodedJSValue JIT_OPERATION operationNewFunction(ExecState* exec, JSCell* functionExecutable) 1678 864 { 1679 865 ASSERT(functionExecutable->inherits(FunctionExecutable::info())); … … 1683 869 } 1684 870 1685 JSCell* DFG_OPERATION operationNewFunctionExpression(ExecState* exec, JSCell* functionExecutableAsCell)871 JSCell* JIT_OPERATION operationNewFunctionExpression(ExecState* exec, JSCell* functionExecutableAsCell) 1686 872 { 1687 873 ASSERT(functionExecutableAsCell->inherits(FunctionExecutable::info())); … … 1695 881 } 1696 882 1697 size_t DFG_OPERATION operationIsObject(ExecState* exec, EncodedJSValue value)883 size_t JIT_OPERATION operationIsObject(ExecState* exec, EncodedJSValue value) 1698 884 { 1699 885 return jsIsObjectType(exec, JSValue::decode(value)); 1700 886 } 1701 887 1702 size_t DFG_OPERATION operationIsFunction(EncodedJSValue value)888 size_t JIT_OPERATION operationIsFunction(EncodedJSValue value) 1703 889 { 1704 890 return jsIsFunctionType(JSValue::decode(value)); 1705 891 } 1706 892 1707 JSCell* DFG_OPERATION operationTypeOf(ExecState* exec, JSCell* value)893 JSCell* JIT_OPERATION operationTypeOf(ExecState* exec, JSCell* value) 1708 894 { 1709 895 return jsTypeStringForValue(exec, JSValue(value)).asCell(); 1710 896 } 1711 897 1712 void DFG_OPERATION operationReallocateStorageAndFinishPut(ExecState* exec, JSObject* base, Structure* structure, PropertyOffset offset, EncodedJSValue value) 1713 { 1714 VM& vm = exec->vm(); 1715 NativeCallFrameTracer tracer(&vm, exec); 1716 1717 ASSERT(structure->outOfLineCapacity() > base->structure()->outOfLineCapacity()); 1718 ASSERT(!vm.heap.storageAllocator().fastPathShouldSucceed(structure->outOfLineCapacity() * sizeof(JSValue))); 1719 base->setStructureAndReallocateStorageIfNecessary(vm, structure); 1720 base->putDirect(vm, offset, JSValue::decode(value)); 1721 } 1722 1723 char* DFG_OPERATION operationAllocatePropertyStorageWithInitialCapacity(ExecState* exec) 898 char* JIT_OPERATION operationAllocatePropertyStorageWithInitialCapacity(ExecState* exec) 1724 899 { 1725 900 VM& vm = exec->vm(); … … 1730 905 } 1731 906 1732 char* DFG_OPERATION operationAllocatePropertyStorage(ExecState* exec, size_t newSize)907 char* JIT_OPERATION operationAllocatePropertyStorage(ExecState* exec, size_t newSize) 1733 908 { 1734 909 VM& vm = exec->vm(); … … 1739 914 } 1740 915 1741 char* DFG_OPERATION operationReallocateButterflyToHavePropertyStorageWithInitialCapacity(ExecState* exec, JSObject* object)916 char* JIT_OPERATION operationReallocateButterflyToHavePropertyStorageWithInitialCapacity(ExecState* exec, JSObject* object) 1742 917 { 1743 918 VM& vm = exec->vm(); … … 1750 925 } 1751 926 1752 char* DFG_OPERATION operationReallocateButterflyToGrowPropertyStorage(ExecState* exec, JSObject* object, size_t newSize)927 char* JIT_OPERATION operationReallocateButterflyToGrowPropertyStorage(ExecState* exec, JSObject* object, size_t newSize) 1753 928 { 1754 929 VM& vm = exec->vm(); … … 1760 935 } 1761 936 1762 char* DFG_OPERATION operationEnsureInt32(ExecState* exec, JSCell* cell)937 char* JIT_OPERATION operationEnsureInt32(ExecState* exec, JSCell* cell) 1763 938 { 1764 939 VM& vm = exec->vm(); … … 1771 946 } 1772 947 1773 char* DFG_OPERATION operationEnsureDouble(ExecState* exec, JSCell* cell)948 char* JIT_OPERATION operationEnsureDouble(ExecState* exec, JSCell* cell) 1774 949 { 1775 950 VM& vm = exec->vm(); … … 1782 957 } 1783 958 1784 char* DFG_OPERATION operationEnsureContiguous(ExecState* exec, JSCell* cell)959 char* JIT_OPERATION operationEnsureContiguous(ExecState* exec, JSCell* cell) 1785 960 { 1786 961 VM& vm = exec->vm(); … … 1793 968 } 1794 969 1795 char* DFG_OPERATION operationRageEnsureContiguous(ExecState* exec, JSCell* cell)970 char* JIT_OPERATION operationRageEnsureContiguous(ExecState* exec, JSCell* cell) 1796 971 { 1797 972 VM& vm = exec->vm(); … … 1804 979 } 1805 980 1806 char* DFG_OPERATION operationEnsureArrayStorage(ExecState* exec, JSCell* cell)981 char* JIT_OPERATION operationEnsureArrayStorage(ExecState* exec, JSCell* cell) 1807 982 { 1808 983 VM& vm = exec->vm(); … … 1815 990 } 1816 991 1817 StringImpl* DFG_OPERATION operationResolveRope(ExecState* exec, JSString* string)992 StringImpl* JIT_OPERATION operationResolveRope(ExecState* exec, JSString* string) 1818 993 { 1819 994 VM& vm = exec->vm(); … … 1823 998 } 1824 999 1825 JSString* DFG_OPERATION operationSingleCharacterString(ExecState* exec, int32_t character)1000 JSString* JIT_OPERATION operationSingleCharacterString(ExecState* exec, int32_t character) 1826 1001 { 1827 1002 VM& vm = exec->vm(); … … 1831 1006 } 1832 1007 1833 JSCell* DFG_OPERATION operationNewStringObject(ExecState* exec, JSString* string, Structure* structure)1008 JSCell* JIT_OPERATION operationNewStringObject(ExecState* exec, JSString* string, Structure* structure) 1834 1009 { 1835 1010 VM& vm = exec->vm(); … … 1839 1014 } 1840 1015 1841 JSCell* DFG_OPERATION operationToStringOnCell(ExecState* exec, JSCell* cell)1016 JSCell* JIT_OPERATION operationToStringOnCell(ExecState* exec, JSCell* cell) 1842 1017 { 1843 1018 VM& vm = exec->vm(); … … 1847 1022 } 1848 1023 1849 JSCell* DFG_OPERATION operationToString(ExecState* exec, EncodedJSValue value)1024 JSCell* JIT_OPERATION operationToString(ExecState* exec, EncodedJSValue value) 1850 1025 { 1851 1026 VM& vm = exec->vm(); … … 1855 1030 } 1856 1031 1857 JSCell* DFG_OPERATION operationMakeRope2(ExecState* exec, JSString* left, JSString* right)1032 JSCell* JIT_OPERATION operationMakeRope2(ExecState* exec, JSString* left, JSString* right) 1858 1033 { 1859 1034 VM& vm = exec->vm(); … … 1863 1038 } 1864 1039 1865 JSCell* DFG_OPERATION operationMakeRope3(ExecState* exec, JSString* a, JSString* b, JSString* c)1040 JSCell* JIT_OPERATION operationMakeRope3(ExecState* exec, JSString* a, JSString* b, JSString* c) 1866 1041 { 1867 1042 VM& vm = exec->vm(); … … 1871 1046 } 1872 1047 1873 char* DFG_OPERATION operationFindSwitchImmTargetForDouble(1048 char* JIT_OPERATION operationFindSwitchImmTargetForDouble( 1874 1049 ExecState* exec, EncodedJSValue encodedValue, size_t tableIndex) 1875 1050 { … … 1885 1060 } 1886 1061 1887 char* DFG_OPERATION operationSwitchString(ExecState* exec, size_t tableIndex, JSString* string)1062 char* JIT_OPERATION operationSwitchString(ExecState* exec, size_t tableIndex, JSString* string) 1888 1063 { 1889 1064 VM& vm = exec->vm(); … … 1893 1068 } 1894 1069 1895 double DFG_OPERATION operationFModOnInts(int32_t a, int32_t b)1070 double JIT_OPERATION operationFModOnInts(int32_t a, int32_t b) 1896 1071 { 1897 1072 return fmod(a, b); 1898 1073 } 1899 1074 1900 JSCell* DFG_OPERATION operationStringFromCharCode(ExecState* exec, int32_t op1)1075 JSCell* JIT_OPERATION operationStringFromCharCode(ExecState* exec, int32_t op1) 1901 1076 { 1902 1077 VM* vm = &exec->vm(); … … 1905 1080 } 1906 1081 1907 DFGHandlerEncoded DFG_OPERATION lookupExceptionHandler(ExecState* exec, uint32_t callIndex) 1908 { 1909 VM* vm = &exec->vm(); 1910 NativeCallFrameTracer tracer(vm, exec); 1911 1912 JSValue exceptionValue = exec->exception(); 1913 ASSERT(exceptionValue); 1914 1915 unsigned vPCIndex = exec->codeBlock()->bytecodeOffsetForCallAtIndex(callIndex); 1916 ExceptionHandler handler = genericUnwind(vm, exec, exceptionValue, vPCIndex); 1917 ASSERT(handler.catchRoutine); 1918 return dfgHandlerEncoded(handler.callFrame, handler.catchRoutine); 1919 } 1920 1921 DFGHandlerEncoded DFG_OPERATION lookupExceptionHandlerInStub(ExecState* exec, StructureStubInfo* stubInfo) 1922 { 1923 VM* vm = &exec->vm(); 1924 NativeCallFrameTracer tracer(vm, exec); 1925 1926 JSValue exceptionValue = exec->exception(); 1927 ASSERT(exceptionValue); 1928 1929 CodeOrigin codeOrigin = stubInfo->codeOrigin; 1930 while (codeOrigin.inlineCallFrame) 1931 codeOrigin = codeOrigin.inlineCallFrame->caller; 1932 1933 ExceptionHandler handler = genericUnwind(vm, exec, exceptionValue, codeOrigin.bytecodeIndex); 1934 ASSERT(handler.catchRoutine); 1935 return dfgHandlerEncoded(handler.callFrame, handler.catchRoutine); 1936 } 1937 1938 size_t DFG_OPERATION dfgConvertJSValueToInt32(ExecState* exec, EncodedJSValue value) 1082 size_t JIT_OPERATION dfgConvertJSValueToInt32(ExecState* exec, EncodedJSValue value) 1939 1083 { 1940 1084 VM* vm = &exec->vm(); … … 1945 1089 } 1946 1090 1947 size_t DFG_OPERATION dfgConvertJSValueToBoolean(ExecState* exec, EncodedJSValue encodedOp)1091 size_t JIT_OPERATION dfgConvertJSValueToBoolean(ExecState* exec, EncodedJSValue encodedOp) 1948 1092 { 1949 1093 VM* vm = &exec->vm(); … … 1953 1097 } 1954 1098 1955 void DFG_OPERATION debugOperationPrintSpeculationFailure(ExecState* exec, void* debugInfoRaw, void* scratch)1099 void JIT_OPERATION debugOperationPrintSpeculationFailure(ExecState* exec, void* debugInfoRaw, void* scratch) 1956 1100 { 1957 1101 VM* vm = &exec->vm(); … … 1991 1135 } 1992 1136 1993 extern "C" void DFG_OPERATION triggerReoptimizationNow(CodeBlock* codeBlock)1137 extern "C" void JIT_OPERATION triggerReoptimizationNow(CodeBlock* codeBlock) 1994 1138 { 1995 1139 // It's sort of preferable that we don't GC while in here. Anyways, doing so wouldn't … … 2035 1179 2036 1180 #if ENABLE(FTL_JIT) 2037 void DFG_OPERATION triggerTierUpNow(ExecState* exec)1181 void JIT_OPERATION triggerTierUpNow(ExecState* exec) 2038 1182 { 2039 1183 VM* vm = &exec->vm(); … … 2097 1241 } 2098 1242 2099 char* DFG_OPERATION triggerOSREntryNow(1243 char* JIT_OPERATION triggerOSREntryNow( 2100 1244 ExecState* exec, int32_t bytecodeIndex, int32_t streamIndex) 2101 1245 { … … 2216 1360 // FIXME: Make calls work well. Currently they're a pure regression. 2217 1361 // https://bugs.webkit.org/show_bug.cgi?id=113621 2218 EncodedJSValue DFG_OPERATION operationFTLCall(ExecState* exec)1362 EncodedJSValue JIT_OPERATION operationFTLCall(ExecState* exec) 2219 1363 { 2220 1364 ExecState* callerExec = exec->callerFrame(); … … 2236 1380 // FIXME: Make calls work well. Currently they're a pure regression. 2237 1381 // https://bugs.webkit.org/show_bug.cgi?id=113621 2238 EncodedJSValue DFG_OPERATION operationFTLConstruct(ExecState* exec)1382 EncodedJSValue JIT_OPERATION operationFTLConstruct(ExecState* exec) 2239 1383 { 2240 1384 ExecState* callerExec = exec->callerFrame();
Note:
See TracChangeset
for help on using the changeset viewer.