Ignore:
Timestamp:
Sep 21, 2013, 5:24:36 PM (12 years ago)
Author:
[email protected]
Message:

Unreviewed, revert http://trac.webkit.org/changeset/156235. It won't work on Windows.

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • Target.pri:
  • bytecode/CallLinkInfo.cpp:

(JSC::CallLinkInfo::unlink):

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::resetStubInternal):

  • bytecode/StructureStubInfo.h:
  • dfg/DFGCallArrayAllocatorSlowPathGenerator.h:

(JSC::DFG::CallArrayAllocatorSlowPathGenerator::CallArrayAllocatorSlowPathGenerator):
(JSC::DFG::CallArrayAllocatorWithVariableSizeSlowPathGenerator::CallArrayAllocatorWithVariableSizeSlowPathGenerator):

  • dfg/DFGJITCompiler.h:
  • dfg/DFGOSRExitCompiler.h:
  • dfg/DFGOperations.cpp:

(JSC::DFG::operationPutByValInternal):

  • dfg/DFGOperations.h:

(JSC::DFG::operationNewTypedArrayWithSizeForType):
(JSC::DFG::operationNewTypedArrayWithOneArgumentForType):

  • dfg/DFGRegisterSet.h: Added.

(JSC::DFG::RegisterSet::RegisterSet):
(JSC::DFG::RegisterSet::asPOD):
(JSC::DFG::RegisterSet::copyInfo):
(JSC::DFG::RegisterSet::set):
(JSC::DFG::RegisterSet::setGPRByIndex):
(JSC::DFG::RegisterSet::clear):
(JSC::DFG::RegisterSet::get):
(JSC::DFG::RegisterSet::getGPRByIndex):
(JSC::DFG::RegisterSet::getFreeGPR):
(JSC::DFG::RegisterSet::setFPRByIndex):
(JSC::DFG::RegisterSet::getFPRByIndex):
(JSC::DFG::RegisterSet::setByIndex):
(JSC::DFG::RegisterSet::getByIndex):
(JSC::DFG::RegisterSet::numberOfSetGPRs):
(JSC::DFG::RegisterSet::numberOfSetFPRs):
(JSC::DFG::RegisterSet::numberOfSetRegisters):
(JSC::DFG::RegisterSet::setBit):
(JSC::DFG::RegisterSet::clearBit):
(JSC::DFG::RegisterSet::getBit):

  • dfg/DFGRepatch.cpp: Added.

(JSC::DFG::repatchCall):
(JSC::DFG::repatchByIdSelfAccess):
(JSC::DFG::addStructureTransitionCheck):
(JSC::DFG::replaceWithJump):
(JSC::DFG::emitRestoreScratch):
(JSC::DFG::linkRestoreScratch):
(JSC::DFG::generateProtoChainAccessStub):
(JSC::DFG::tryCacheGetByID):
(JSC::DFG::repatchGetByID):
(JSC::DFG::getPolymorphicStructureList):
(JSC::DFG::patchJumpToGetByIdStub):
(JSC::DFG::tryBuildGetByIDList):
(JSC::DFG::buildGetByIDList):
(JSC::DFG::appropriateGenericPutByIdFunction):
(JSC::DFG::appropriateListBuildingPutByIdFunction):
(JSC::DFG::emitPutReplaceStub):
(JSC::DFG::emitPutTransitionStub):
(JSC::DFG::tryCachePutByID):
(JSC::DFG::repatchPutByID):
(JSC::DFG::tryBuildPutByIdList):
(JSC::DFG::buildPutByIdList):
(JSC::DFG::tryRepatchIn):
(JSC::DFG::repatchIn):
(JSC::DFG::linkSlowFor):
(JSC::DFG::linkFor):
(JSC::DFG::linkClosureCall):
(JSC::DFG::resetGetByID):
(JSC::DFG::resetPutByID):
(JSC::DFG::resetIn):

  • dfg/DFGRepatch.h: Added.

(JSC::DFG::resetGetByID):
(JSC::DFG::resetPutByID):
(JSC::DFG::resetIn):

  • dfg/DFGScratchRegisterAllocator.h: Added.

(JSC::DFG::ScratchRegisterAllocator::ScratchRegisterAllocator):
(JSC::DFG::ScratchRegisterAllocator::lock):
(JSC::DFG::ScratchRegisterAllocator::allocateScratch):
(JSC::DFG::ScratchRegisterAllocator::allocateScratchGPR):
(JSC::DFG::ScratchRegisterAllocator::allocateScratchFPR):
(JSC::DFG::ScratchRegisterAllocator::didReuseRegisters):
(JSC::DFG::ScratchRegisterAllocator::preserveReusedRegistersByPushing):
(JSC::DFG::ScratchRegisterAllocator::restoreReusedRegistersByPopping):
(JSC::DFG::ScratchRegisterAllocator::desiredScratchBufferSize):
(JSC::DFG::ScratchRegisterAllocator::preserveUsedRegistersToScratchBuffer):
(JSC::DFG::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBuffer):

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::writeBarrier):
(JSC::DFG::SpeculativeJIT::nonSpeculativeCompare):
(JSC::DFG::SpeculativeJIT::compilePeepHoleBranch):
(JSC::DFG::SpeculativeJIT::compare):

  • dfg/DFGSpeculativeJIT.h:

(JSC::DFG::SpeculativeJIT::callOperation):

  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::cachedPutById):
(JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranch):
(JSC::DFG::CompareAndBoxBooleanSlowPathGenerator::CompareAndBoxBooleanSlowPathGenerator):
(JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompare):
(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::cachedPutById):
(JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranch):
(JSC::DFG::CompareAndBoxBooleanSlowPathGenerator::CompareAndBoxBooleanSlowPathGenerator):
(JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompare):
(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGThunks.cpp:

(JSC::DFG::emitPointerValidation):
(JSC::DFG::throwExceptionFromCallSlowPathGenerator):
(JSC::DFG::slowPathFor):
(JSC::DFG::linkForThunkGenerator):
(JSC::DFG::linkCallThunkGenerator):
(JSC::DFG::linkConstructThunkGenerator):
(JSC::DFG::linkClosureCallThunkGenerator):
(JSC::DFG::virtualForThunkGenerator):
(JSC::DFG::virtualCallThunkGenerator):
(JSC::DFG::virtualConstructThunkGenerator):

  • dfg/DFGThunks.h:
  • ftl/FTLIntrinsicRepository.h:
  • ftl/FTLLowerDFGToLLVM.cpp:

(JSC::FTL::LowerDFGToLLVM::compileCallOrConstruct):

  • ftl/FTLOSRExitCompiler.h:
  • jit/AssemblyHelpers.h:
  • jit/JIT.cpp:

(JSC::JIT::linkFor):
(JSC::JIT::linkSlowCall):

  • jit/JITCall.cpp:

(JSC::JIT::compileCallEvalSlowCase):
(JSC::JIT::compileOpCallSlowCase):
(JSC::JIT::privateCompileClosureCall):

  • jit/JITCall32_64.cpp:

(JSC::JIT::compileCallEvalSlowCase):
(JSC::JIT::compileOpCallSlowCase):
(JSC::JIT::privateCompileClosureCall):

  • jit/JITOperationWrappers.h: Removed.
  • jit/JITOperations.cpp: Removed.
  • jit/JITOperations.h: Removed.
  • jit/RegisterSet.h: Removed.
  • jit/Repatch.cpp: Removed.
  • jit/Repatch.h: Removed.
  • jit/ScratchRegisterAllocator.h: Removed.
  • jit/ThunkGenerators.cpp:

(JSC::generateSlowCaseFor):
(JSC::linkForGenerator):
(JSC::linkCallGenerator):
(JSC::linkConstructGenerator):
(JSC::linkClosureCallGenerator):
(JSC::virtualForGenerator):
(JSC::virtualCallGenerator):
(JSC::virtualConstructGenerator):

  • jit/ThunkGenerators.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp

    r156235 r156237  
    3434#include "DFGDriver.h"
    3535#include "DFGOSRExit.h"
     36#include "DFGRepatch.h"
    3637#include "DFGThunks.h"
    3738#include "DFGToFTLDeferredCompilationCallback.h"
     
    4546#include "JIT.h"
    4647#include "JITExceptions.h"
    47 #include "JITOperationWrappers.h"
    4848#include "JSActivation.h"
    4949#include "VM.h"
     
    5252#include "ObjectConstructor.h"
    5353#include "Operations.h"
    54 #include "Repatch.h"
    5554#include "StringConstructor.h"
    5655#include "TypedArrayInlines.h"
     
    5857
    5958#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
    6072#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) \
     322void* DFG_OPERATION function##WithReturnAddress(ExecState*, ReturnAddressPtr) REFERENCED_FROM_ASM WTF_INTERNAL; \
     323FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_E(function)
     324
     325#define J_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_ECI(function) \
     326EncodedJSValue DFG_OPERATION function##WithReturnAddress(ExecState*, JSCell*, StringImpl*, ReturnAddressPtr) REFERENCED_FROM_ASM WTF_INTERNAL; \
     327FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_ECI(function)
     328
     329#define J_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJI(function) \
     330EncodedJSValue DFG_OPERATION function##WithReturnAddress(ExecState*, EncodedJSValue, StringImpl*, ReturnAddressPtr) REFERENCED_FROM_ASM WTF_INTERNAL; \
     331FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJI(function)
     332
     333#define V_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(function) \
     334void DFG_OPERATION function##WithReturnAddress(ExecState*, EncodedJSValue, JSCell*, StringImpl*, ReturnAddressPtr) REFERENCED_FROM_ASM WTF_INTERNAL; \
     335FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(function)
    61336
    62337namespace JSC { namespace DFG {
     
    83358
    84359template<bool strict>
    85 ALWAYS_INLINE static void JIT_OPERATION operationPutByValInternal(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedProperty, EncodedJSValue encodedValue)
     360ALWAYS_INLINE static void DFG_OPERATION operationPutByValInternal(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedProperty, EncodedJSValue encodedValue)
    86361{
    87362    VM* vm = &exec->vm();
     
    192467extern "C" {
    193468
    194 EncodedJSValue JIT_OPERATION operationToThis(ExecState* exec, EncodedJSValue encodedOp)
     469EncodedJSValue DFG_OPERATION operationToThis(ExecState* exec, EncodedJSValue encodedOp)
    195470{
    196471    VM* vm = &exec->vm();
     
    200475}
    201476
    202 EncodedJSValue JIT_OPERATION operationToThisStrict(ExecState* exec, EncodedJSValue encodedOp)
     477EncodedJSValue DFG_OPERATION operationToThisStrict(ExecState* exec, EncodedJSValue encodedOp)
    203478{
    204479    VM* vm = &exec->vm();
     
    208483}
    209484
    210 JSCell* JIT_OPERATION operationCreateThis(ExecState* exec, JSObject* constructor, int32_t inlineCapacity)
     485JSCell* DFG_OPERATION operationCreateThis(ExecState* exec, JSObject* constructor, int32_t inlineCapacity)
    211486{
    212487    VM* vm = &exec->vm();
     
    221496}
    222497
    223 JSCell* JIT_OPERATION operationNewObject(ExecState* exec, Structure* structure)
     498JSCell* DFG_OPERATION operationNewObject(ExecState* exec, Structure* structure)
    224499{
    225500    VM* vm = &exec->vm();
     
    229504}
    230505
    231 EncodedJSValue JIT_OPERATION operationValueAdd(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)
     506EncodedJSValue DFG_OPERATION operationValueAdd(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)
    232507{
    233508    VM* vm = &exec->vm();
     
    240515}
    241516
    242 EncodedJSValue JIT_OPERATION operationValueAddNotNumber(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)
     517EncodedJSValue DFG_OPERATION operationValueAddNotNumber(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)
    243518{
    244519    VM* vm = &exec->vm();
     
    273548}
    274549
    275 EncodedJSValue JIT_OPERATION operationGetByVal(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedProperty)
     550EncodedJSValue DFG_OPERATION operationGetByVal(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedProperty)
    276551{
    277552    VM* vm = &exec->vm();
     
    304579}
    305580
    306 EncodedJSValue JIT_OPERATION operationGetByValCell(ExecState* exec, JSCell* base, EncodedJSValue encodedProperty)
     581EncodedJSValue DFG_OPERATION operationGetByValCell(ExecState* exec, JSCell* base, EncodedJSValue encodedProperty)
    307582{
    308583    VM* vm = &exec->vm();
     
    344619}
    345620
    346 EncodedJSValue JIT_OPERATION operationGetByValArrayInt(ExecState* exec, JSArray* base, int32_t index)
     621EncodedJSValue DFG_OPERATION operationGetByValArrayInt(ExecState* exec, JSArray* base, int32_t index)
    347622{
    348623    return getByValCellInt(exec, base, index);
    349624}
    350625
    351 EncodedJSValue JIT_OPERATION operationGetByValStringInt(ExecState* exec, JSString* base, int32_t index)
     626EncodedJSValue DFG_OPERATION operationGetByValStringInt(ExecState* exec, JSString* base, int32_t index)
    352627{
    353628    return getByValCellInt(exec, base, index);
    354629}
    355630
    356 void JIT_OPERATION operationPutByValStrict(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedProperty, EncodedJSValue encodedValue)
     631EncodedJSValue 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
     642J_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJI(operationGetByIdBuildList);
     643EncodedJSValue 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
     662J_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJI(operationGetByIdOptimize);
     663EncodedJSValue 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
     686J_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_ECI(operationInOptimize);
     687EncodedJSValue 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
     714EncodedJSValue 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
     728EncodedJSValue 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
     736EncodedJSValue 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
     746EncodedJSValue 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
     754void DFG_OPERATION operationPutByValStrict(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedProperty, EncodedJSValue encodedValue)
    357755{
    358756    VM* vm = &exec->vm();
     
    362760}
    363761
    364 void JIT_OPERATION operationPutByValNonStrict(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedProperty, EncodedJSValue encodedValue)
     762void DFG_OPERATION operationPutByValNonStrict(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedProperty, EncodedJSValue encodedValue)
    365763{
    366764    VM* vm = &exec->vm();
     
    370768}
    371769
    372 void JIT_OPERATION operationPutByValCellStrict(ExecState* exec, JSCell* cell, EncodedJSValue encodedProperty, EncodedJSValue encodedValue)
     770void DFG_OPERATION operationPutByValCellStrict(ExecState* exec, JSCell* cell, EncodedJSValue encodedProperty, EncodedJSValue encodedValue)
    373771{
    374772    VM* vm = &exec->vm();
     
    378776}
    379777
    380 void JIT_OPERATION operationPutByValCellNonStrict(ExecState* exec, JSCell* cell, EncodedJSValue encodedProperty, EncodedJSValue encodedValue)
     778void DFG_OPERATION operationPutByValCellNonStrict(ExecState* exec, JSCell* cell, EncodedJSValue encodedProperty, EncodedJSValue encodedValue)
    381779{
    382780    VM* vm = &exec->vm();
     
    386784}
    387785
    388 void JIT_OPERATION operationPutByValBeyondArrayBoundsStrict(ExecState* exec, JSObject* array, int32_t index, EncodedJSValue encodedValue)
     786void DFG_OPERATION operationPutByValBeyondArrayBoundsStrict(ExecState* exec, JSObject* array, int32_t index, EncodedJSValue encodedValue)
    389787{
    390788    VM* vm = &exec->vm();
     
    401799}
    402800
    403 void JIT_OPERATION operationPutByValBeyondArrayBoundsNonStrict(ExecState* exec, JSObject* array, int32_t index, EncodedJSValue encodedValue)
     801void DFG_OPERATION operationPutByValBeyondArrayBoundsNonStrict(ExecState* exec, JSObject* array, int32_t index, EncodedJSValue encodedValue)
    404802{
    405803    VM* vm = &exec->vm();
     
    416814}
    417815
    418 void JIT_OPERATION operationPutDoubleByValBeyondArrayBoundsStrict(ExecState* exec, JSObject* array, int32_t index, double value)
     816void DFG_OPERATION operationPutDoubleByValBeyondArrayBoundsStrict(ExecState* exec, JSObject* array, int32_t index, double value)
    419817{
    420818    VM* vm = &exec->vm();
     
    433831}
    434832
    435 void JIT_OPERATION operationPutDoubleByValBeyondArrayBoundsNonStrict(ExecState* exec, JSObject* array, int32_t index, double value)
     833void DFG_OPERATION operationPutDoubleByValBeyondArrayBoundsNonStrict(ExecState* exec, JSObject* array, int32_t index, double value)
    436834{
    437835    VM* vm = &exec->vm();
     
    450848}
    451849
    452 EncodedJSValue JIT_OPERATION operationArrayPush(ExecState* exec, EncodedJSValue encodedValue, JSArray* array)
     850EncodedJSValue DFG_OPERATION operationArrayPush(ExecState* exec, EncodedJSValue encodedValue, JSArray* array)
    453851{
    454852    VM* vm = &exec->vm();
     
    459857}
    460858
    461 EncodedJSValue JIT_OPERATION operationArrayPushDouble(ExecState* exec, double value, JSArray* array)
     859EncodedJSValue DFG_OPERATION operationArrayPushDouble(ExecState* exec, double value, JSArray* array)
    462860{
    463861    VM* vm = &exec->vm();
     
    468866}
    469867
    470 EncodedJSValue JIT_OPERATION operationArrayPop(ExecState* exec, JSArray* array)
     868EncodedJSValue DFG_OPERATION operationArrayPop(ExecState* exec, JSArray* array)
    471869{
    472870    VM* vm = &exec->vm();
     
    476874}
    477875       
    478 EncodedJSValue JIT_OPERATION operationArrayPopAndRecoverLength(ExecState* exec, JSArray* array)
     876EncodedJSValue DFG_OPERATION operationArrayPopAndRecoverLength(ExecState* exec, JSArray* array)
    479877{
    480878    VM* vm = &exec->vm();
     
    486884}
    487885       
    488 EncodedJSValue JIT_OPERATION operationRegExpExec(ExecState* exec, JSCell* base, JSCell* argument)
     886EncodedJSValue DFG_OPERATION operationRegExpExec(ExecState* exec, JSCell* base, JSCell* argument)
    489887{
    490888    VM& vm = exec->vm();
     
    499897}
    500898       
    501 size_t JIT_OPERATION operationRegExpTest(ExecState* exec, JSCell* base, JSCell* argument)
     899size_t DFG_OPERATION operationRegExpTest(ExecState* exec, JSCell* base, JSCell* argument)
    502900{
    503901    VM& vm = exec->vm();
     
    514912}
    515913       
    516 size_t JIT_OPERATION operationCompareLess(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)
     914void 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
     924void 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
     934void 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
     945void 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
     956V_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(operationPutByIdStrictOptimize);
     957void 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
     981V_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(operationPutByIdNonStrictOptimize);
     982void 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
     1006V_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(operationPutByIdDirectStrictOptimize);
     1007void 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
     1031V_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(operationPutByIdDirectNonStrictOptimize);
     1032void 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
     1056V_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(operationPutByIdStrictBuildList);
     1057void 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
     1078V_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(operationPutByIdNonStrictBuildList);
     1079void 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
     1100V_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(operationPutByIdDirectStrictBuildList);
     1101void 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
     1122V_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(operationPutByIdDirectNonStrictBuildList);
     1123void 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
     1144size_t DFG_OPERATION operationCompareLess(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)
    5171145{
    5181146    VM* vm = &exec->vm();
     
    5221150}
    5231151
    524 size_t JIT_OPERATION operationCompareLessEq(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)
     1152size_t DFG_OPERATION operationCompareLessEq(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)
    5251153{
    5261154    VM* vm = &exec->vm();
     
    5301158}
    5311159
    532 size_t JIT_OPERATION operationCompareGreater(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)
     1160size_t DFG_OPERATION operationCompareGreater(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)
    5331161{
    5341162    VM* vm = &exec->vm();
     
    5381166}
    5391167
    540 size_t JIT_OPERATION operationCompareGreaterEq(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)
     1168size_t DFG_OPERATION operationCompareGreaterEq(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)
    5411169{
    5421170    VM* vm = &exec->vm();
     
    5461174}
    5471175
    548 size_t JIT_OPERATION operationCompareEq(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)
     1176size_t DFG_OPERATION operationCompareEq(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)
    5491177{
    5501178    VM* vm = &exec->vm();
     
    5551183
    5561184#if USE(JSVALUE64)
    557 EncodedJSValue JIT_OPERATION operationCompareStringEq(ExecState* exec, JSCell* left, JSCell* right)
     1185EncodedJSValue DFG_OPERATION operationCompareStringEq(ExecState* exec, JSCell* left, JSCell* right)
    5581186#else
    559 size_t JIT_OPERATION operationCompareStringEq(ExecState* exec, JSCell* left, JSCell* right)
     1187size_t DFG_OPERATION operationCompareStringEq(ExecState* exec, JSCell* left, JSCell* right)
    5601188#endif
    5611189{
     
    5711199}
    5721200
    573 size_t JIT_OPERATION operationCompareStrictEqCell(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)
     1201size_t DFG_OPERATION operationCompareStrictEqCell(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)
    5741202{
    5751203    VM* vm = &exec->vm();
     
    5851213}
    5861214
    587 size_t JIT_OPERATION operationCompareStrictEq(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)
     1215size_t DFG_OPERATION operationCompareStrictEq(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)
    5881216{
    5891217    VM* vm = &exec->vm();
     
    5961224}
    5971225
    598 EncodedJSValue JIT_OPERATION operationToPrimitive(ExecState* exec, EncodedJSValue value)
     1226static 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
     1277inline 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
     1317char* DFG_OPERATION operationLinkCall(ExecState* execCallee)
     1318{
     1319    return linkFor(execCallee, CodeForCall);
     1320}
     1321
     1322char* DFG_OPERATION operationLinkConstruct(ExecState* execCallee)
     1323{
     1324    return linkFor(execCallee, CodeForConstruct);
     1325}
     1326
     1327inline 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
     1352inline char* virtualFor(ExecState* execCallee, CodeSpecializationKind kind)
     1353{
     1354    JSCell* calleeAsFunctionCellIgnored;
     1355    return virtualForWithFunction(execCallee, kind, calleeAsFunctionCellIgnored);
     1356}
     1357
     1358static 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
     1390char* 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
     1402char* DFG_OPERATION operationVirtualCall(ExecState* execCallee)
     1403{   
     1404    return virtualFor(execCallee, CodeForCall);
     1405}
     1406
     1407char* DFG_OPERATION operationVirtualConstruct(ExecState* execCallee)
     1408{
     1409    return virtualFor(execCallee, CodeForConstruct);
     1410}
     1411
     1412EncodedJSValue DFG_OPERATION operationToPrimitive(ExecState* exec, EncodedJSValue value)
    5991413{
    6001414    VM* vm = &exec->vm();
     
    6041418}
    6051419
    606 char* JIT_OPERATION operationNewArray(ExecState* exec, Structure* arrayStructure, void* buffer, size_t size)
     1420char* DFG_OPERATION operationNewArray(ExecState* exec, Structure* arrayStructure, void* buffer, size_t size)
    6071421{
    6081422    VM* vm = &exec->vm();
     
    6121426}
    6131427
    614 char* JIT_OPERATION operationNewEmptyArray(ExecState* exec, Structure* arrayStructure)
     1428char* DFG_OPERATION operationNewEmptyArray(ExecState* exec, Structure* arrayStructure)
    6151429{
    6161430    VM* vm = &exec->vm();
     
    6201434}
    6211435
    622 char* JIT_OPERATION operationNewArrayWithSize(ExecState* exec, Structure* arrayStructure, int32_t size)
     1436char* DFG_OPERATION operationNewArrayWithSize(ExecState* exec, Structure* arrayStructure, int32_t size)
    6231437{
    6241438    VM* vm = &exec->vm();
     
    6311445}
    6321446
    633 char* JIT_OPERATION operationNewArrayBuffer(ExecState* exec, Structure* arrayStructure, size_t start, size_t size)
     1447char* DFG_OPERATION operationNewArrayBuffer(ExecState* exec, Structure* arrayStructure, size_t start, size_t size)
    6341448{
    6351449    VM& vm = exec->vm();
     
    6381452}
    6391453
    640 char* JIT_OPERATION operationNewInt8ArrayWithSize(
     1454char* DFG_OPERATION operationNewInt8ArrayWithSize(
    6411455    ExecState* exec, Structure* structure, int32_t length)
    6421456{
     
    6441458}
    6451459
    646 char* JIT_OPERATION operationNewInt8ArrayWithOneArgument(
     1460char* DFG_OPERATION operationNewInt8ArrayWithOneArgument(
    6471461    ExecState* exec, Structure* structure, EncodedJSValue encodedValue)
    6481462{
     
    6501464}
    6511465
    652 char* JIT_OPERATION operationNewInt16ArrayWithSize(
     1466char* DFG_OPERATION operationNewInt16ArrayWithSize(
    6531467    ExecState* exec, Structure* structure, int32_t length)
    6541468{
     
    6561470}
    6571471
    658 char* JIT_OPERATION operationNewInt16ArrayWithOneArgument(
     1472char* DFG_OPERATION operationNewInt16ArrayWithOneArgument(
    6591473    ExecState* exec, Structure* structure, EncodedJSValue encodedValue)
    6601474{
     
    6621476}
    6631477
    664 char* JIT_OPERATION operationNewInt32ArrayWithSize(
     1478char* DFG_OPERATION operationNewInt32ArrayWithSize(
    6651479    ExecState* exec, Structure* structure, int32_t length)
    6661480{
     
    6681482}
    6691483
    670 char* JIT_OPERATION operationNewInt32ArrayWithOneArgument(
     1484char* DFG_OPERATION operationNewInt32ArrayWithOneArgument(
    6711485    ExecState* exec, Structure* structure, EncodedJSValue encodedValue)
    6721486{
     
    6741488}
    6751489
    676 char* JIT_OPERATION operationNewUint8ArrayWithSize(
     1490char* DFG_OPERATION operationNewUint8ArrayWithSize(
    6771491    ExecState* exec, Structure* structure, int32_t length)
    6781492{
     
    6801494}
    6811495
    682 char* JIT_OPERATION operationNewUint8ArrayWithOneArgument(
     1496char* DFG_OPERATION operationNewUint8ArrayWithOneArgument(
    6831497    ExecState* exec, Structure* structure, EncodedJSValue encodedValue)
    6841498{
     
    6861500}
    6871501
    688 char* JIT_OPERATION operationNewUint8ClampedArrayWithSize(
     1502char* DFG_OPERATION operationNewUint8ClampedArrayWithSize(
    6891503    ExecState* exec, Structure* structure, int32_t length)
    6901504{
     
    6921506}
    6931507
    694 char* JIT_OPERATION operationNewUint8ClampedArrayWithOneArgument(
     1508char* DFG_OPERATION operationNewUint8ClampedArrayWithOneArgument(
    6951509    ExecState* exec, Structure* structure, EncodedJSValue encodedValue)
    6961510{
     
    6981512}
    6991513
    700 char* JIT_OPERATION operationNewUint16ArrayWithSize(
     1514char* DFG_OPERATION operationNewUint16ArrayWithSize(
    7011515    ExecState* exec, Structure* structure, int32_t length)
    7021516{
     
    7041518}
    7051519
    706 char* JIT_OPERATION operationNewUint16ArrayWithOneArgument(
     1520char* DFG_OPERATION operationNewUint16ArrayWithOneArgument(
    7071521    ExecState* exec, Structure* structure, EncodedJSValue encodedValue)
    7081522{
     
    7101524}
    7111525
    712 char* JIT_OPERATION operationNewUint32ArrayWithSize(
     1526char* DFG_OPERATION operationNewUint32ArrayWithSize(
    7131527    ExecState* exec, Structure* structure, int32_t length)
    7141528{
     
    7161530}
    7171531
    718 char* JIT_OPERATION operationNewUint32ArrayWithOneArgument(
     1532char* DFG_OPERATION operationNewUint32ArrayWithOneArgument(
    7191533    ExecState* exec, Structure* structure, EncodedJSValue encodedValue)
    7201534{
     
    7221536}
    7231537
    724 char* JIT_OPERATION operationNewFloat32ArrayWithSize(
     1538char* DFG_OPERATION operationNewFloat32ArrayWithSize(
    7251539    ExecState* exec, Structure* structure, int32_t length)
    7261540{
     
    7281542}
    7291543
    730 char* JIT_OPERATION operationNewFloat32ArrayWithOneArgument(
     1544char* DFG_OPERATION operationNewFloat32ArrayWithOneArgument(
    7311545    ExecState* exec, Structure* structure, EncodedJSValue encodedValue)
    7321546{
     
    7341548}
    7351549
    736 char* JIT_OPERATION operationNewFloat64ArrayWithSize(
     1550char* DFG_OPERATION operationNewFloat64ArrayWithSize(
    7371551    ExecState* exec, Structure* structure, int32_t length)
    7381552{
     
    7401554}
    7411555
    742 char* JIT_OPERATION operationNewFloat64ArrayWithOneArgument(
     1556char* DFG_OPERATION operationNewFloat64ArrayWithOneArgument(
    7431557    ExecState* exec, Structure* structure, EncodedJSValue encodedValue)
    7441558{
     
    7461560}
    7471561
    748 EncodedJSValue JIT_OPERATION operationNewRegexp(ExecState* exec, void* regexpPtr)
     1562EncodedJSValue DFG_OPERATION operationNewRegexp(ExecState* exec, void* regexpPtr)
    7491563{
    7501564    VM& vm = exec->vm();
     
    7591573}
    7601574
    761 JSCell* JIT_OPERATION operationCreateActivation(ExecState* exec)
     1575JSCell* DFG_OPERATION operationCreateActivation(ExecState* exec)
    7621576{
    7631577    VM& vm = exec->vm();
     
    7681582}
    7691583
    770 JSCell* JIT_OPERATION operationCreateArguments(ExecState* exec)
     1584JSCell* DFG_OPERATION operationCreateArguments(ExecState* exec)
    7711585{
    7721586    VM& vm = exec->vm();
     
    7791593}
    7801594
    781 JSCell* JIT_OPERATION operationCreateInlinedArguments(
     1595JSCell* DFG_OPERATION operationCreateInlinedArguments(
    7821596    ExecState* exec, InlineCallFrame* inlineCallFrame)
    7831597{
     
    7911605}
    7921606
    793 void JIT_OPERATION operationTearOffArguments(ExecState* exec, JSCell* argumentsCell, JSCell* activationCell)
     1607void DFG_OPERATION operationTearOffArguments(ExecState* exec, JSCell* argumentsCell, JSCell* activationCell)
    7941608{
    7951609    ASSERT(exec->codeBlock()->usesArguments());
     
    8011615}
    8021616
    803 void JIT_OPERATION operationTearOffInlinedArguments(
     1617void DFG_OPERATION operationTearOffInlinedArguments(
    8041618    ExecState* exec, JSCell* argumentsCell, JSCell* activationCell, InlineCallFrame* inlineCallFrame)
    8051619{
     
    8081622}
    8091623
    810 EncodedJSValue JIT_OPERATION operationGetArgumentsLength(ExecState* exec, int32_t argumentsRegister)
     1624EncodedJSValue DFG_OPERATION operationGetArgumentsLength(ExecState* exec, int32_t argumentsRegister)
    8111625{
    8121626    VM& vm = exec->vm();
     
    8201634}
    8211635
    822 EncodedJSValue JIT_OPERATION operationGetArgumentByVal(ExecState* exec, int32_t argumentsRegister, int32_t index)
     1636EncodedJSValue DFG_OPERATION operationGetArgumentByVal(ExecState* exec, int32_t argumentsRegister, int32_t index)
    8231637{
    8241638    VM& vm = exec->vm();
     
    8351649}
    8361650
    837 EncodedJSValue JIT_OPERATION operationGetInlinedArgumentByVal(
     1651EncodedJSValue DFG_OPERATION operationGetInlinedArgumentByVal(
    8381652    ExecState* exec, int32_t argumentsRegister, InlineCallFrame* inlineCallFrame, int32_t index)
    8391653{
     
    8531667}
    8541668
    855 JSCell* JIT_OPERATION operationNewFunctionNoCheck(ExecState* exec, JSCell* functionExecutable)
     1669JSCell* DFG_OPERATION operationNewFunctionNoCheck(ExecState* exec, JSCell* functionExecutable)
    8561670{
    8571671    ASSERT(functionExecutable->inherits(FunctionExecutable::info()));
     
    8611675}
    8621676
    863 EncodedJSValue JIT_OPERATION operationNewFunction(ExecState* exec, JSCell* functionExecutable)
     1677EncodedJSValue DFG_OPERATION operationNewFunction(ExecState* exec, JSCell* functionExecutable)
    8641678{
    8651679    ASSERT(functionExecutable->inherits(FunctionExecutable::info()));
     
    8691683}
    8701684
    871 JSCell* JIT_OPERATION operationNewFunctionExpression(ExecState* exec, JSCell* functionExecutableAsCell)
     1685JSCell* DFG_OPERATION operationNewFunctionExpression(ExecState* exec, JSCell* functionExecutableAsCell)
    8721686{
    8731687    ASSERT(functionExecutableAsCell->inherits(FunctionExecutable::info()));
     
    8811695}
    8821696
    883 size_t JIT_OPERATION operationIsObject(ExecState* exec, EncodedJSValue value)
     1697size_t DFG_OPERATION operationIsObject(ExecState* exec, EncodedJSValue value)
    8841698{
    8851699    return jsIsObjectType(exec, JSValue::decode(value));
    8861700}
    8871701
    888 size_t JIT_OPERATION operationIsFunction(EncodedJSValue value)
     1702size_t DFG_OPERATION operationIsFunction(EncodedJSValue value)
    8891703{
    8901704    return jsIsFunctionType(JSValue::decode(value));
    8911705}
    8921706
    893 JSCell* JIT_OPERATION operationTypeOf(ExecState* exec, JSCell* value)
     1707JSCell* DFG_OPERATION operationTypeOf(ExecState* exec, JSCell* value)
    8941708{
    8951709    return jsTypeStringForValue(exec, JSValue(value)).asCell();
    8961710}
    8971711
    898 char* JIT_OPERATION operationAllocatePropertyStorageWithInitialCapacity(ExecState* exec)
     1712void 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
     1723char* DFG_OPERATION operationAllocatePropertyStorageWithInitialCapacity(ExecState* exec)
    8991724{
    9001725    VM& vm = exec->vm();
     
    9051730}
    9061731
    907 char* JIT_OPERATION operationAllocatePropertyStorage(ExecState* exec, size_t newSize)
     1732char* DFG_OPERATION operationAllocatePropertyStorage(ExecState* exec, size_t newSize)
    9081733{
    9091734    VM& vm = exec->vm();
     
    9141739}
    9151740
    916 char* JIT_OPERATION operationReallocateButterflyToHavePropertyStorageWithInitialCapacity(ExecState* exec, JSObject* object)
     1741char* DFG_OPERATION operationReallocateButterflyToHavePropertyStorageWithInitialCapacity(ExecState* exec, JSObject* object)
    9171742{
    9181743    VM& vm = exec->vm();
     
    9251750}
    9261751
    927 char* JIT_OPERATION operationReallocateButterflyToGrowPropertyStorage(ExecState* exec, JSObject* object, size_t newSize)
     1752char* DFG_OPERATION operationReallocateButterflyToGrowPropertyStorage(ExecState* exec, JSObject* object, size_t newSize)
    9281753{
    9291754    VM& vm = exec->vm();
     
    9351760}
    9361761
    937 char* JIT_OPERATION operationEnsureInt32(ExecState* exec, JSCell* cell)
     1762char* DFG_OPERATION operationEnsureInt32(ExecState* exec, JSCell* cell)
    9381763{
    9391764    VM& vm = exec->vm();
     
    9461771}
    9471772
    948 char* JIT_OPERATION operationEnsureDouble(ExecState* exec, JSCell* cell)
     1773char* DFG_OPERATION operationEnsureDouble(ExecState* exec, JSCell* cell)
    9491774{
    9501775    VM& vm = exec->vm();
     
    9571782}
    9581783
    959 char* JIT_OPERATION operationEnsureContiguous(ExecState* exec, JSCell* cell)
     1784char* DFG_OPERATION operationEnsureContiguous(ExecState* exec, JSCell* cell)
    9601785{
    9611786    VM& vm = exec->vm();
     
    9681793}
    9691794
    970 char* JIT_OPERATION operationRageEnsureContiguous(ExecState* exec, JSCell* cell)
     1795char* DFG_OPERATION operationRageEnsureContiguous(ExecState* exec, JSCell* cell)
    9711796{
    9721797    VM& vm = exec->vm();
     
    9791804}
    9801805
    981 char* JIT_OPERATION operationEnsureArrayStorage(ExecState* exec, JSCell* cell)
     1806char* DFG_OPERATION operationEnsureArrayStorage(ExecState* exec, JSCell* cell)
    9821807{
    9831808    VM& vm = exec->vm();
     
    9901815}
    9911816
    992 StringImpl* JIT_OPERATION operationResolveRope(ExecState* exec, JSString* string)
     1817StringImpl* DFG_OPERATION operationResolveRope(ExecState* exec, JSString* string)
    9931818{
    9941819    VM& vm = exec->vm();
     
    9981823}
    9991824
    1000 JSString* JIT_OPERATION operationSingleCharacterString(ExecState* exec, int32_t character)
     1825JSString* DFG_OPERATION operationSingleCharacterString(ExecState* exec, int32_t character)
    10011826{
    10021827    VM& vm = exec->vm();
     
    10061831}
    10071832
    1008 JSCell* JIT_OPERATION operationNewStringObject(ExecState* exec, JSString* string, Structure* structure)
     1833JSCell* DFG_OPERATION operationNewStringObject(ExecState* exec, JSString* string, Structure* structure)
    10091834{
    10101835    VM& vm = exec->vm();
     
    10141839}
    10151840
    1016 JSCell* JIT_OPERATION operationToStringOnCell(ExecState* exec, JSCell* cell)
     1841JSCell* DFG_OPERATION operationToStringOnCell(ExecState* exec, JSCell* cell)
    10171842{
    10181843    VM& vm = exec->vm();
     
    10221847}
    10231848
    1024 JSCell* JIT_OPERATION operationToString(ExecState* exec, EncodedJSValue value)
     1849JSCell* DFG_OPERATION operationToString(ExecState* exec, EncodedJSValue value)
    10251850{
    10261851    VM& vm = exec->vm();
     
    10301855}
    10311856
    1032 JSCell* JIT_OPERATION operationMakeRope2(ExecState* exec, JSString* left, JSString* right)
     1857JSCell* DFG_OPERATION operationMakeRope2(ExecState* exec, JSString* left, JSString* right)
    10331858{
    10341859    VM& vm = exec->vm();
     
    10381863}
    10391864
    1040 JSCell* JIT_OPERATION operationMakeRope3(ExecState* exec, JSString* a, JSString* b, JSString* c)
     1865JSCell* DFG_OPERATION operationMakeRope3(ExecState* exec, JSString* a, JSString* b, JSString* c)
    10411866{
    10421867    VM& vm = exec->vm();
     
    10461871}
    10471872
    1048 char* JIT_OPERATION operationFindSwitchImmTargetForDouble(
     1873char* DFG_OPERATION operationFindSwitchImmTargetForDouble(
    10491874    ExecState* exec, EncodedJSValue encodedValue, size_t tableIndex)
    10501875{
     
    10601885}
    10611886
    1062 char* JIT_OPERATION operationSwitchString(ExecState* exec, size_t tableIndex, JSString* string)
     1887char* DFG_OPERATION operationSwitchString(ExecState* exec, size_t tableIndex, JSString* string)
    10631888{
    10641889    VM& vm = exec->vm();
     
    10681893}
    10691894
    1070 double JIT_OPERATION operationFModOnInts(int32_t a, int32_t b)
     1895double DFG_OPERATION operationFModOnInts(int32_t a, int32_t b)
    10711896{
    10721897    return fmod(a, b);
    10731898}
    10741899
    1075 JSCell* JIT_OPERATION operationStringFromCharCode(ExecState* exec, int32_t op1)
     1900JSCell* DFG_OPERATION operationStringFromCharCode(ExecState* exec, int32_t op1)
    10761901{
    10771902    VM* vm = &exec->vm();
     
    10801905}
    10811906
    1082 size_t JIT_OPERATION dfgConvertJSValueToInt32(ExecState* exec, EncodedJSValue value)
     1907DFGHandlerEncoded 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
     1921DFGHandlerEncoded 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
     1938size_t DFG_OPERATION dfgConvertJSValueToInt32(ExecState* exec, EncodedJSValue value)
    10831939{
    10841940    VM* vm = &exec->vm();
     
    10891945}
    10901946
    1091 size_t JIT_OPERATION dfgConvertJSValueToBoolean(ExecState* exec, EncodedJSValue encodedOp)
     1947size_t DFG_OPERATION dfgConvertJSValueToBoolean(ExecState* exec, EncodedJSValue encodedOp)
    10921948{
    10931949    VM* vm = &exec->vm();
     
    10971953}
    10981954
    1099 void JIT_OPERATION debugOperationPrintSpeculationFailure(ExecState* exec, void* debugInfoRaw, void* scratch)
     1955void DFG_OPERATION debugOperationPrintSpeculationFailure(ExecState* exec, void* debugInfoRaw, void* scratch)
    11001956{
    11011957    VM* vm = &exec->vm();
     
    11351991}
    11361992
    1137 extern "C" void JIT_OPERATION triggerReoptimizationNow(CodeBlock* codeBlock)
     1993extern "C" void DFG_OPERATION triggerReoptimizationNow(CodeBlock* codeBlock)
    11381994{
    11391995    // It's sort of preferable that we don't GC while in here. Anyways, doing so wouldn't
     
    11792035
    11802036#if ENABLE(FTL_JIT)
    1181 void JIT_OPERATION triggerTierUpNow(ExecState* exec)
     2037void DFG_OPERATION triggerTierUpNow(ExecState* exec)
    11822038{
    11832039    VM* vm = &exec->vm();
     
    12412097}
    12422098
    1243 char* JIT_OPERATION triggerOSREntryNow(
     2099char* DFG_OPERATION triggerOSREntryNow(
    12442100    ExecState* exec, int32_t bytecodeIndex, int32_t streamIndex)
    12452101{
     
    13602216// FIXME: Make calls work well. Currently they're a pure regression.
    13612217// https://bugs.webkit.org/show_bug.cgi?id=113621
    1362 EncodedJSValue JIT_OPERATION operationFTLCall(ExecState* exec)
     2218EncodedJSValue DFG_OPERATION operationFTLCall(ExecState* exec)
    13632219{
    13642220    ExecState* callerExec = exec->callerFrame();
     
    13802236// FIXME: Make calls work well. Currently they're a pure regression.
    13812237// https://bugs.webkit.org/show_bug.cgi?id=113621
    1382 EncodedJSValue JIT_OPERATION operationFTLConstruct(ExecState* exec)
     2238EncodedJSValue DFG_OPERATION operationFTLConstruct(ExecState* exec)
    13832239{
    13842240    ExecState* callerExec = exec->callerFrame();
Note: See TracChangeset for help on using the changeset viewer.