Changeset 156237 in webkit for trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp
- Timestamp:
- Sep 21, 2013, 5:24:36 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp
r156235 r156237 34 34 #include "DFGDriver.h" 35 35 #include "DFGOSRExit.h" 36 #include "DFGRepatch.h" 36 37 #include "DFGThunks.h" 37 38 #include "DFGToFTLDeferredCompilationCallback.h" … … 45 46 #include "JIT.h" 46 47 #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"55 54 #include "StringConstructor.h" 56 55 #include "TypedArrayInlines.h" … … 58 57 59 58 #if ENABLE(JIT) 59 60 #if CPU(MIPS) 61 #if WTF_MIPS_PIC 62 #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 #else 68 #define LOAD_FUNCTION_TO_T9(function) "" "\n" 69 #endif 70 #endif 71 60 72 #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 #else 140 #define INSTRUCTION_STORE_RETURN_ADDRESS_EJI "str lr, [sp, #0]" 141 #define INSTRUCTION_STORE_RETURN_ADDRESS_EJCI "str lr, [sp, #4]" 142 #endif 143 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 #else 200 #define INSTRUCTION_STORE_RETURN_ADDRESS_EJI "str lr, [sp, #0]" 201 #define INSTRUCTION_STORE_RETURN_ADDRESS_EJCI "str lr, [sp, #4]" 202 #endif 203 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 #endif 320 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) 61 336 62 337 namespace JSC { namespace DFG { … … 83 358 84 359 template<bool strict> 85 ALWAYS_INLINE static void JIT_OPERATION operationPutByValInternal(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedProperty, EncodedJSValue encodedValue)360 ALWAYS_INLINE static void DFG_OPERATION operationPutByValInternal(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedProperty, EncodedJSValue encodedValue) 86 361 { 87 362 VM* vm = &exec->vm(); … … 192 467 extern "C" { 193 468 194 EncodedJSValue JIT_OPERATION operationToThis(ExecState* exec, EncodedJSValue encodedOp)469 EncodedJSValue DFG_OPERATION operationToThis(ExecState* exec, EncodedJSValue encodedOp) 195 470 { 196 471 VM* vm = &exec->vm(); … … 200 475 } 201 476 202 EncodedJSValue JIT_OPERATION operationToThisStrict(ExecState* exec, EncodedJSValue encodedOp)477 EncodedJSValue DFG_OPERATION operationToThisStrict(ExecState* exec, EncodedJSValue encodedOp) 203 478 { 204 479 VM* vm = &exec->vm(); … … 208 483 } 209 484 210 JSCell* JIT_OPERATION operationCreateThis(ExecState* exec, JSObject* constructor, int32_t inlineCapacity)485 JSCell* DFG_OPERATION operationCreateThis(ExecState* exec, JSObject* constructor, int32_t inlineCapacity) 211 486 { 212 487 VM* vm = &exec->vm(); … … 221 496 } 222 497 223 JSCell* JIT_OPERATION operationNewObject(ExecState* exec, Structure* structure)498 JSCell* DFG_OPERATION operationNewObject(ExecState* exec, Structure* structure) 224 499 { 225 500 VM* vm = &exec->vm(); … … 229 504 } 230 505 231 EncodedJSValue JIT_OPERATION operationValueAdd(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)506 EncodedJSValue DFG_OPERATION operationValueAdd(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) 232 507 { 233 508 VM* vm = &exec->vm(); … … 240 515 } 241 516 242 EncodedJSValue JIT_OPERATION operationValueAddNotNumber(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)517 EncodedJSValue DFG_OPERATION operationValueAddNotNumber(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) 243 518 { 244 519 VM* vm = &exec->vm(); … … 273 548 } 274 549 275 EncodedJSValue JIT_OPERATION operationGetByVal(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedProperty)550 EncodedJSValue DFG_OPERATION operationGetByVal(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedProperty) 276 551 { 277 552 VM* vm = &exec->vm(); … … 304 579 } 305 580 306 EncodedJSValue JIT_OPERATION operationGetByValCell(ExecState* exec, JSCell* base, EncodedJSValue encodedProperty)581 EncodedJSValue DFG_OPERATION operationGetByValCell(ExecState* exec, JSCell* base, EncodedJSValue encodedProperty) 307 582 { 308 583 VM* vm = &exec->vm(); … … 344 619 } 345 620 346 EncodedJSValue JIT_OPERATION operationGetByValArrayInt(ExecState* exec, JSArray* base, int32_t index)621 EncodedJSValue DFG_OPERATION operationGetByValArrayInt(ExecState* exec, JSArray* base, int32_t index) 347 622 { 348 623 return getByValCellInt(exec, base, index); 349 624 } 350 625 351 EncodedJSValue JIT_OPERATION operationGetByValStringInt(ExecState* exec, JSString* base, int32_t index)626 EncodedJSValue DFG_OPERATION operationGetByValStringInt(ExecState* exec, JSString* base, int32_t index) 352 627 { 353 628 return getByValCellInt(exec, base, index); 354 629 } 355 630 356 void JIT_OPERATION operationPutByValStrict(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedProperty, EncodedJSValue encodedValue) 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) 357 755 { 358 756 VM* vm = &exec->vm(); … … 362 760 } 363 761 364 void JIT_OPERATION operationPutByValNonStrict(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedProperty, EncodedJSValue encodedValue)762 void DFG_OPERATION operationPutByValNonStrict(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedProperty, EncodedJSValue encodedValue) 365 763 { 366 764 VM* vm = &exec->vm(); … … 370 768 } 371 769 372 void JIT_OPERATION operationPutByValCellStrict(ExecState* exec, JSCell* cell, EncodedJSValue encodedProperty, EncodedJSValue encodedValue)770 void DFG_OPERATION operationPutByValCellStrict(ExecState* exec, JSCell* cell, EncodedJSValue encodedProperty, EncodedJSValue encodedValue) 373 771 { 374 772 VM* vm = &exec->vm(); … … 378 776 } 379 777 380 void JIT_OPERATION operationPutByValCellNonStrict(ExecState* exec, JSCell* cell, EncodedJSValue encodedProperty, EncodedJSValue encodedValue)778 void DFG_OPERATION operationPutByValCellNonStrict(ExecState* exec, JSCell* cell, EncodedJSValue encodedProperty, EncodedJSValue encodedValue) 381 779 { 382 780 VM* vm = &exec->vm(); … … 386 784 } 387 785 388 void JIT_OPERATION operationPutByValBeyondArrayBoundsStrict(ExecState* exec, JSObject* array, int32_t index, EncodedJSValue encodedValue)786 void DFG_OPERATION operationPutByValBeyondArrayBoundsStrict(ExecState* exec, JSObject* array, int32_t index, EncodedJSValue encodedValue) 389 787 { 390 788 VM* vm = &exec->vm(); … … 401 799 } 402 800 403 void JIT_OPERATION operationPutByValBeyondArrayBoundsNonStrict(ExecState* exec, JSObject* array, int32_t index, EncodedJSValue encodedValue)801 void DFG_OPERATION operationPutByValBeyondArrayBoundsNonStrict(ExecState* exec, JSObject* array, int32_t index, EncodedJSValue encodedValue) 404 802 { 405 803 VM* vm = &exec->vm(); … … 416 814 } 417 815 418 void JIT_OPERATION operationPutDoubleByValBeyondArrayBoundsStrict(ExecState* exec, JSObject* array, int32_t index, double value)816 void DFG_OPERATION operationPutDoubleByValBeyondArrayBoundsStrict(ExecState* exec, JSObject* array, int32_t index, double value) 419 817 { 420 818 VM* vm = &exec->vm(); … … 433 831 } 434 832 435 void JIT_OPERATION operationPutDoubleByValBeyondArrayBoundsNonStrict(ExecState* exec, JSObject* array, int32_t index, double value)833 void DFG_OPERATION operationPutDoubleByValBeyondArrayBoundsNonStrict(ExecState* exec, JSObject* array, int32_t index, double value) 436 834 { 437 835 VM* vm = &exec->vm(); … … 450 848 } 451 849 452 EncodedJSValue JIT_OPERATION operationArrayPush(ExecState* exec, EncodedJSValue encodedValue, JSArray* array)850 EncodedJSValue DFG_OPERATION operationArrayPush(ExecState* exec, EncodedJSValue encodedValue, JSArray* array) 453 851 { 454 852 VM* vm = &exec->vm(); … … 459 857 } 460 858 461 EncodedJSValue JIT_OPERATION operationArrayPushDouble(ExecState* exec, double value, JSArray* array)859 EncodedJSValue DFG_OPERATION operationArrayPushDouble(ExecState* exec, double value, JSArray* array) 462 860 { 463 861 VM* vm = &exec->vm(); … … 468 866 } 469 867 470 EncodedJSValue JIT_OPERATION operationArrayPop(ExecState* exec, JSArray* array)868 EncodedJSValue DFG_OPERATION operationArrayPop(ExecState* exec, JSArray* array) 471 869 { 472 870 VM* vm = &exec->vm(); … … 476 874 } 477 875 478 EncodedJSValue JIT_OPERATION operationArrayPopAndRecoverLength(ExecState* exec, JSArray* array)876 EncodedJSValue DFG_OPERATION operationArrayPopAndRecoverLength(ExecState* exec, JSArray* array) 479 877 { 480 878 VM* vm = &exec->vm(); … … 486 884 } 487 885 488 EncodedJSValue JIT_OPERATION operationRegExpExec(ExecState* exec, JSCell* base, JSCell* argument)886 EncodedJSValue DFG_OPERATION operationRegExpExec(ExecState* exec, JSCell* base, JSCell* argument) 489 887 { 490 888 VM& vm = exec->vm(); … … 499 897 } 500 898 501 size_t JIT_OPERATION operationRegExpTest(ExecState* exec, JSCell* base, JSCell* argument)899 size_t DFG_OPERATION operationRegExpTest(ExecState* exec, JSCell* base, JSCell* argument) 502 900 { 503 901 VM& vm = exec->vm(); … … 514 912 } 515 913 516 size_t JIT_OPERATION operationCompareLess(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) 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) 517 1145 { 518 1146 VM* vm = &exec->vm(); … … 522 1150 } 523 1151 524 size_t JIT_OPERATION operationCompareLessEq(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)1152 size_t DFG_OPERATION operationCompareLessEq(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) 525 1153 { 526 1154 VM* vm = &exec->vm(); … … 530 1158 } 531 1159 532 size_t JIT_OPERATION operationCompareGreater(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)1160 size_t DFG_OPERATION operationCompareGreater(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) 533 1161 { 534 1162 VM* vm = &exec->vm(); … … 538 1166 } 539 1167 540 size_t JIT_OPERATION operationCompareGreaterEq(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)1168 size_t DFG_OPERATION operationCompareGreaterEq(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) 541 1169 { 542 1170 VM* vm = &exec->vm(); … … 546 1174 } 547 1175 548 size_t JIT_OPERATION operationCompareEq(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)1176 size_t DFG_OPERATION operationCompareEq(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) 549 1177 { 550 1178 VM* vm = &exec->vm(); … … 555 1183 556 1184 #if USE(JSVALUE64) 557 EncodedJSValue JIT_OPERATION operationCompareStringEq(ExecState* exec, JSCell* left, JSCell* right)1185 EncodedJSValue DFG_OPERATION operationCompareStringEq(ExecState* exec, JSCell* left, JSCell* right) 558 1186 #else 559 size_t JIT_OPERATION operationCompareStringEq(ExecState* exec, JSCell* left, JSCell* right)1187 size_t DFG_OPERATION operationCompareStringEq(ExecState* exec, JSCell* left, JSCell* right) 560 1188 #endif 561 1189 { … … 571 1199 } 572 1200 573 size_t JIT_OPERATION operationCompareStrictEqCell(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)1201 size_t DFG_OPERATION operationCompareStrictEqCell(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) 574 1202 { 575 1203 VM* vm = &exec->vm(); … … 585 1213 } 586 1214 587 size_t JIT_OPERATION operationCompareStrictEq(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)1215 size_t DFG_OPERATION operationCompareStrictEq(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) 588 1216 { 589 1217 VM* vm = &exec->vm(); … … 596 1224 } 597 1225 598 EncodedJSValue JIT_OPERATION operationToPrimitive(ExecState* exec, EncodedJSValue value) 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) 599 1413 { 600 1414 VM* vm = &exec->vm(); … … 604 1418 } 605 1419 606 char* JIT_OPERATION operationNewArray(ExecState* exec, Structure* arrayStructure, void* buffer, size_t size)1420 char* DFG_OPERATION operationNewArray(ExecState* exec, Structure* arrayStructure, void* buffer, size_t size) 607 1421 { 608 1422 VM* vm = &exec->vm(); … … 612 1426 } 613 1427 614 char* JIT_OPERATION operationNewEmptyArray(ExecState* exec, Structure* arrayStructure)1428 char* DFG_OPERATION operationNewEmptyArray(ExecState* exec, Structure* arrayStructure) 615 1429 { 616 1430 VM* vm = &exec->vm(); … … 620 1434 } 621 1435 622 char* JIT_OPERATION operationNewArrayWithSize(ExecState* exec, Structure* arrayStructure, int32_t size)1436 char* DFG_OPERATION operationNewArrayWithSize(ExecState* exec, Structure* arrayStructure, int32_t size) 623 1437 { 624 1438 VM* vm = &exec->vm(); … … 631 1445 } 632 1446 633 char* JIT_OPERATION operationNewArrayBuffer(ExecState* exec, Structure* arrayStructure, size_t start, size_t size)1447 char* DFG_OPERATION operationNewArrayBuffer(ExecState* exec, Structure* arrayStructure, size_t start, size_t size) 634 1448 { 635 1449 VM& vm = exec->vm(); … … 638 1452 } 639 1453 640 char* JIT_OPERATION operationNewInt8ArrayWithSize(1454 char* DFG_OPERATION operationNewInt8ArrayWithSize( 641 1455 ExecState* exec, Structure* structure, int32_t length) 642 1456 { … … 644 1458 } 645 1459 646 char* JIT_OPERATION operationNewInt8ArrayWithOneArgument(1460 char* DFG_OPERATION operationNewInt8ArrayWithOneArgument( 647 1461 ExecState* exec, Structure* structure, EncodedJSValue encodedValue) 648 1462 { … … 650 1464 } 651 1465 652 char* JIT_OPERATION operationNewInt16ArrayWithSize(1466 char* DFG_OPERATION operationNewInt16ArrayWithSize( 653 1467 ExecState* exec, Structure* structure, int32_t length) 654 1468 { … … 656 1470 } 657 1471 658 char* JIT_OPERATION operationNewInt16ArrayWithOneArgument(1472 char* DFG_OPERATION operationNewInt16ArrayWithOneArgument( 659 1473 ExecState* exec, Structure* structure, EncodedJSValue encodedValue) 660 1474 { … … 662 1476 } 663 1477 664 char* JIT_OPERATION operationNewInt32ArrayWithSize(1478 char* DFG_OPERATION operationNewInt32ArrayWithSize( 665 1479 ExecState* exec, Structure* structure, int32_t length) 666 1480 { … … 668 1482 } 669 1483 670 char* JIT_OPERATION operationNewInt32ArrayWithOneArgument(1484 char* DFG_OPERATION operationNewInt32ArrayWithOneArgument( 671 1485 ExecState* exec, Structure* structure, EncodedJSValue encodedValue) 672 1486 { … … 674 1488 } 675 1489 676 char* JIT_OPERATION operationNewUint8ArrayWithSize(1490 char* DFG_OPERATION operationNewUint8ArrayWithSize( 677 1491 ExecState* exec, Structure* structure, int32_t length) 678 1492 { … … 680 1494 } 681 1495 682 char* JIT_OPERATION operationNewUint8ArrayWithOneArgument(1496 char* DFG_OPERATION operationNewUint8ArrayWithOneArgument( 683 1497 ExecState* exec, Structure* structure, EncodedJSValue encodedValue) 684 1498 { … … 686 1500 } 687 1501 688 char* JIT_OPERATION operationNewUint8ClampedArrayWithSize(1502 char* DFG_OPERATION operationNewUint8ClampedArrayWithSize( 689 1503 ExecState* exec, Structure* structure, int32_t length) 690 1504 { … … 692 1506 } 693 1507 694 char* JIT_OPERATION operationNewUint8ClampedArrayWithOneArgument(1508 char* DFG_OPERATION operationNewUint8ClampedArrayWithOneArgument( 695 1509 ExecState* exec, Structure* structure, EncodedJSValue encodedValue) 696 1510 { … … 698 1512 } 699 1513 700 char* JIT_OPERATION operationNewUint16ArrayWithSize(1514 char* DFG_OPERATION operationNewUint16ArrayWithSize( 701 1515 ExecState* exec, Structure* structure, int32_t length) 702 1516 { … … 704 1518 } 705 1519 706 char* JIT_OPERATION operationNewUint16ArrayWithOneArgument(1520 char* DFG_OPERATION operationNewUint16ArrayWithOneArgument( 707 1521 ExecState* exec, Structure* structure, EncodedJSValue encodedValue) 708 1522 { … … 710 1524 } 711 1525 712 char* JIT_OPERATION operationNewUint32ArrayWithSize(1526 char* DFG_OPERATION operationNewUint32ArrayWithSize( 713 1527 ExecState* exec, Structure* structure, int32_t length) 714 1528 { … … 716 1530 } 717 1531 718 char* JIT_OPERATION operationNewUint32ArrayWithOneArgument(1532 char* DFG_OPERATION operationNewUint32ArrayWithOneArgument( 719 1533 ExecState* exec, Structure* structure, EncodedJSValue encodedValue) 720 1534 { … … 722 1536 } 723 1537 724 char* JIT_OPERATION operationNewFloat32ArrayWithSize(1538 char* DFG_OPERATION operationNewFloat32ArrayWithSize( 725 1539 ExecState* exec, Structure* structure, int32_t length) 726 1540 { … … 728 1542 } 729 1543 730 char* JIT_OPERATION operationNewFloat32ArrayWithOneArgument(1544 char* DFG_OPERATION operationNewFloat32ArrayWithOneArgument( 731 1545 ExecState* exec, Structure* structure, EncodedJSValue encodedValue) 732 1546 { … … 734 1548 } 735 1549 736 char* JIT_OPERATION operationNewFloat64ArrayWithSize(1550 char* DFG_OPERATION operationNewFloat64ArrayWithSize( 737 1551 ExecState* exec, Structure* structure, int32_t length) 738 1552 { … … 740 1554 } 741 1555 742 char* JIT_OPERATION operationNewFloat64ArrayWithOneArgument(1556 char* DFG_OPERATION operationNewFloat64ArrayWithOneArgument( 743 1557 ExecState* exec, Structure* structure, EncodedJSValue encodedValue) 744 1558 { … … 746 1560 } 747 1561 748 EncodedJSValue JIT_OPERATION operationNewRegexp(ExecState* exec, void* regexpPtr)1562 EncodedJSValue DFG_OPERATION operationNewRegexp(ExecState* exec, void* regexpPtr) 749 1563 { 750 1564 VM& vm = exec->vm(); … … 759 1573 } 760 1574 761 JSCell* JIT_OPERATION operationCreateActivation(ExecState* exec)1575 JSCell* DFG_OPERATION operationCreateActivation(ExecState* exec) 762 1576 { 763 1577 VM& vm = exec->vm(); … … 768 1582 } 769 1583 770 JSCell* JIT_OPERATION operationCreateArguments(ExecState* exec)1584 JSCell* DFG_OPERATION operationCreateArguments(ExecState* exec) 771 1585 { 772 1586 VM& vm = exec->vm(); … … 779 1593 } 780 1594 781 JSCell* JIT_OPERATION operationCreateInlinedArguments(1595 JSCell* DFG_OPERATION operationCreateInlinedArguments( 782 1596 ExecState* exec, InlineCallFrame* inlineCallFrame) 783 1597 { … … 791 1605 } 792 1606 793 void JIT_OPERATION operationTearOffArguments(ExecState* exec, JSCell* argumentsCell, JSCell* activationCell)1607 void DFG_OPERATION operationTearOffArguments(ExecState* exec, JSCell* argumentsCell, JSCell* activationCell) 794 1608 { 795 1609 ASSERT(exec->codeBlock()->usesArguments()); … … 801 1615 } 802 1616 803 void JIT_OPERATION operationTearOffInlinedArguments(1617 void DFG_OPERATION operationTearOffInlinedArguments( 804 1618 ExecState* exec, JSCell* argumentsCell, JSCell* activationCell, InlineCallFrame* inlineCallFrame) 805 1619 { … … 808 1622 } 809 1623 810 EncodedJSValue JIT_OPERATION operationGetArgumentsLength(ExecState* exec, int32_t argumentsRegister)1624 EncodedJSValue DFG_OPERATION operationGetArgumentsLength(ExecState* exec, int32_t argumentsRegister) 811 1625 { 812 1626 VM& vm = exec->vm(); … … 820 1634 } 821 1635 822 EncodedJSValue JIT_OPERATION operationGetArgumentByVal(ExecState* exec, int32_t argumentsRegister, int32_t index)1636 EncodedJSValue DFG_OPERATION operationGetArgumentByVal(ExecState* exec, int32_t argumentsRegister, int32_t index) 823 1637 { 824 1638 VM& vm = exec->vm(); … … 835 1649 } 836 1650 837 EncodedJSValue JIT_OPERATION operationGetInlinedArgumentByVal(1651 EncodedJSValue DFG_OPERATION operationGetInlinedArgumentByVal( 838 1652 ExecState* exec, int32_t argumentsRegister, InlineCallFrame* inlineCallFrame, int32_t index) 839 1653 { … … 853 1667 } 854 1668 855 JSCell* JIT_OPERATION operationNewFunctionNoCheck(ExecState* exec, JSCell* functionExecutable)1669 JSCell* DFG_OPERATION operationNewFunctionNoCheck(ExecState* exec, JSCell* functionExecutable) 856 1670 { 857 1671 ASSERT(functionExecutable->inherits(FunctionExecutable::info())); … … 861 1675 } 862 1676 863 EncodedJSValue JIT_OPERATION operationNewFunction(ExecState* exec, JSCell* functionExecutable)1677 EncodedJSValue DFG_OPERATION operationNewFunction(ExecState* exec, JSCell* functionExecutable) 864 1678 { 865 1679 ASSERT(functionExecutable->inherits(FunctionExecutable::info())); … … 869 1683 } 870 1684 871 JSCell* JIT_OPERATION operationNewFunctionExpression(ExecState* exec, JSCell* functionExecutableAsCell)1685 JSCell* DFG_OPERATION operationNewFunctionExpression(ExecState* exec, JSCell* functionExecutableAsCell) 872 1686 { 873 1687 ASSERT(functionExecutableAsCell->inherits(FunctionExecutable::info())); … … 881 1695 } 882 1696 883 size_t JIT_OPERATION operationIsObject(ExecState* exec, EncodedJSValue value)1697 size_t DFG_OPERATION operationIsObject(ExecState* exec, EncodedJSValue value) 884 1698 { 885 1699 return jsIsObjectType(exec, JSValue::decode(value)); 886 1700 } 887 1701 888 size_t JIT_OPERATION operationIsFunction(EncodedJSValue value)1702 size_t DFG_OPERATION operationIsFunction(EncodedJSValue value) 889 1703 { 890 1704 return jsIsFunctionType(JSValue::decode(value)); 891 1705 } 892 1706 893 JSCell* JIT_OPERATION operationTypeOf(ExecState* exec, JSCell* value)1707 JSCell* DFG_OPERATION operationTypeOf(ExecState* exec, JSCell* value) 894 1708 { 895 1709 return jsTypeStringForValue(exec, JSValue(value)).asCell(); 896 1710 } 897 1711 898 char* JIT_OPERATION operationAllocatePropertyStorageWithInitialCapacity(ExecState* exec) 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) 899 1724 { 900 1725 VM& vm = exec->vm(); … … 905 1730 } 906 1731 907 char* JIT_OPERATION operationAllocatePropertyStorage(ExecState* exec, size_t newSize)1732 char* DFG_OPERATION operationAllocatePropertyStorage(ExecState* exec, size_t newSize) 908 1733 { 909 1734 VM& vm = exec->vm(); … … 914 1739 } 915 1740 916 char* JIT_OPERATION operationReallocateButterflyToHavePropertyStorageWithInitialCapacity(ExecState* exec, JSObject* object)1741 char* DFG_OPERATION operationReallocateButterflyToHavePropertyStorageWithInitialCapacity(ExecState* exec, JSObject* object) 917 1742 { 918 1743 VM& vm = exec->vm(); … … 925 1750 } 926 1751 927 char* JIT_OPERATION operationReallocateButterflyToGrowPropertyStorage(ExecState* exec, JSObject* object, size_t newSize)1752 char* DFG_OPERATION operationReallocateButterflyToGrowPropertyStorage(ExecState* exec, JSObject* object, size_t newSize) 928 1753 { 929 1754 VM& vm = exec->vm(); … … 935 1760 } 936 1761 937 char* JIT_OPERATION operationEnsureInt32(ExecState* exec, JSCell* cell)1762 char* DFG_OPERATION operationEnsureInt32(ExecState* exec, JSCell* cell) 938 1763 { 939 1764 VM& vm = exec->vm(); … … 946 1771 } 947 1772 948 char* JIT_OPERATION operationEnsureDouble(ExecState* exec, JSCell* cell)1773 char* DFG_OPERATION operationEnsureDouble(ExecState* exec, JSCell* cell) 949 1774 { 950 1775 VM& vm = exec->vm(); … … 957 1782 } 958 1783 959 char* JIT_OPERATION operationEnsureContiguous(ExecState* exec, JSCell* cell)1784 char* DFG_OPERATION operationEnsureContiguous(ExecState* exec, JSCell* cell) 960 1785 { 961 1786 VM& vm = exec->vm(); … … 968 1793 } 969 1794 970 char* JIT_OPERATION operationRageEnsureContiguous(ExecState* exec, JSCell* cell)1795 char* DFG_OPERATION operationRageEnsureContiguous(ExecState* exec, JSCell* cell) 971 1796 { 972 1797 VM& vm = exec->vm(); … … 979 1804 } 980 1805 981 char* JIT_OPERATION operationEnsureArrayStorage(ExecState* exec, JSCell* cell)1806 char* DFG_OPERATION operationEnsureArrayStorage(ExecState* exec, JSCell* cell) 982 1807 { 983 1808 VM& vm = exec->vm(); … … 990 1815 } 991 1816 992 StringImpl* JIT_OPERATION operationResolveRope(ExecState* exec, JSString* string)1817 StringImpl* DFG_OPERATION operationResolveRope(ExecState* exec, JSString* string) 993 1818 { 994 1819 VM& vm = exec->vm(); … … 998 1823 } 999 1824 1000 JSString* JIT_OPERATION operationSingleCharacterString(ExecState* exec, int32_t character)1825 JSString* DFG_OPERATION operationSingleCharacterString(ExecState* exec, int32_t character) 1001 1826 { 1002 1827 VM& vm = exec->vm(); … … 1006 1831 } 1007 1832 1008 JSCell* JIT_OPERATION operationNewStringObject(ExecState* exec, JSString* string, Structure* structure)1833 JSCell* DFG_OPERATION operationNewStringObject(ExecState* exec, JSString* string, Structure* structure) 1009 1834 { 1010 1835 VM& vm = exec->vm(); … … 1014 1839 } 1015 1840 1016 JSCell* JIT_OPERATION operationToStringOnCell(ExecState* exec, JSCell* cell)1841 JSCell* DFG_OPERATION operationToStringOnCell(ExecState* exec, JSCell* cell) 1017 1842 { 1018 1843 VM& vm = exec->vm(); … … 1022 1847 } 1023 1848 1024 JSCell* JIT_OPERATION operationToString(ExecState* exec, EncodedJSValue value)1849 JSCell* DFG_OPERATION operationToString(ExecState* exec, EncodedJSValue value) 1025 1850 { 1026 1851 VM& vm = exec->vm(); … … 1030 1855 } 1031 1856 1032 JSCell* JIT_OPERATION operationMakeRope2(ExecState* exec, JSString* left, JSString* right)1857 JSCell* DFG_OPERATION operationMakeRope2(ExecState* exec, JSString* left, JSString* right) 1033 1858 { 1034 1859 VM& vm = exec->vm(); … … 1038 1863 } 1039 1864 1040 JSCell* JIT_OPERATION operationMakeRope3(ExecState* exec, JSString* a, JSString* b, JSString* c)1865 JSCell* DFG_OPERATION operationMakeRope3(ExecState* exec, JSString* a, JSString* b, JSString* c) 1041 1866 { 1042 1867 VM& vm = exec->vm(); … … 1046 1871 } 1047 1872 1048 char* JIT_OPERATION operationFindSwitchImmTargetForDouble(1873 char* DFG_OPERATION operationFindSwitchImmTargetForDouble( 1049 1874 ExecState* exec, EncodedJSValue encodedValue, size_t tableIndex) 1050 1875 { … … 1060 1885 } 1061 1886 1062 char* JIT_OPERATION operationSwitchString(ExecState* exec, size_t tableIndex, JSString* string)1887 char* DFG_OPERATION operationSwitchString(ExecState* exec, size_t tableIndex, JSString* string) 1063 1888 { 1064 1889 VM& vm = exec->vm(); … … 1068 1893 } 1069 1894 1070 double JIT_OPERATION operationFModOnInts(int32_t a, int32_t b)1895 double DFG_OPERATION operationFModOnInts(int32_t a, int32_t b) 1071 1896 { 1072 1897 return fmod(a, b); 1073 1898 } 1074 1899 1075 JSCell* JIT_OPERATION operationStringFromCharCode(ExecState* exec, int32_t op1)1900 JSCell* DFG_OPERATION operationStringFromCharCode(ExecState* exec, int32_t op1) 1076 1901 { 1077 1902 VM* vm = &exec->vm(); … … 1080 1905 } 1081 1906 1082 size_t JIT_OPERATION dfgConvertJSValueToInt32(ExecState* exec, EncodedJSValue value) 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) 1083 1939 { 1084 1940 VM* vm = &exec->vm(); … … 1089 1945 } 1090 1946 1091 size_t JIT_OPERATION dfgConvertJSValueToBoolean(ExecState* exec, EncodedJSValue encodedOp)1947 size_t DFG_OPERATION dfgConvertJSValueToBoolean(ExecState* exec, EncodedJSValue encodedOp) 1092 1948 { 1093 1949 VM* vm = &exec->vm(); … … 1097 1953 } 1098 1954 1099 void JIT_OPERATION debugOperationPrintSpeculationFailure(ExecState* exec, void* debugInfoRaw, void* scratch)1955 void DFG_OPERATION debugOperationPrintSpeculationFailure(ExecState* exec, void* debugInfoRaw, void* scratch) 1100 1956 { 1101 1957 VM* vm = &exec->vm(); … … 1135 1991 } 1136 1992 1137 extern "C" void JIT_OPERATION triggerReoptimizationNow(CodeBlock* codeBlock)1993 extern "C" void DFG_OPERATION triggerReoptimizationNow(CodeBlock* codeBlock) 1138 1994 { 1139 1995 // It's sort of preferable that we don't GC while in here. Anyways, doing so wouldn't … … 1179 2035 1180 2036 #if ENABLE(FTL_JIT) 1181 void JIT_OPERATION triggerTierUpNow(ExecState* exec)2037 void DFG_OPERATION triggerTierUpNow(ExecState* exec) 1182 2038 { 1183 2039 VM* vm = &exec->vm(); … … 1241 2097 } 1242 2098 1243 char* JIT_OPERATION triggerOSREntryNow(2099 char* DFG_OPERATION triggerOSREntryNow( 1244 2100 ExecState* exec, int32_t bytecodeIndex, int32_t streamIndex) 1245 2101 { … … 1360 2216 // FIXME: Make calls work well. Currently they're a pure regression. 1361 2217 // https://bugs.webkit.org/show_bug.cgi?id=113621 1362 EncodedJSValue JIT_OPERATION operationFTLCall(ExecState* exec)2218 EncodedJSValue DFG_OPERATION operationFTLCall(ExecState* exec) 1363 2219 { 1364 2220 ExecState* callerExec = exec->callerFrame(); … … 1380 2236 // FIXME: Make calls work well. Currently they're a pure regression. 1381 2237 // https://bugs.webkit.org/show_bug.cgi?id=113621 1382 EncodedJSValue JIT_OPERATION operationFTLConstruct(ExecState* exec)2238 EncodedJSValue DFG_OPERATION operationFTLConstruct(ExecState* exec) 1383 2239 { 1384 2240 ExecState* callerExec = exec->callerFrame();
Note:
See TracChangeset
for help on using the changeset viewer.