2 * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 #include "DFGAbstractInterpreter.h"
31 #include "DFGGenerationInfo.h"
32 #include "DFGInPlaceAbstractState.h"
33 #include "DFGJITCompiler.h"
34 #include "DFGOSRExit.h"
35 #include "DFGOSRExitJumpPlaceholder.h"
36 #include "DFGRegisterBank.h"
37 #include "DFGSilentRegisterSavePlan.h"
38 #include "JITMathIC.h"
39 #include "JITOperations.h"
40 #include "MarkedAllocator.h"
42 #include "SpillRegistersMode.h"
43 #include "StructureStubInfo.h"
44 #include "ValueRecovery.h"
45 #include "VirtualRegister.h"
47 namespace JSC { namespace DFG {
51 class SlowPathGenerator;
53 class SpeculateInt32Operand;
54 class SpeculateStrictInt32Operand;
55 class SpeculateDoubleOperand;
56 class SpeculateCellOperand;
57 class SpeculateBooleanOperand;
59 enum GeneratedOperandType { GeneratedOperandTypeUnknown, GeneratedOperandInteger, GeneratedOperandJSValue};
61 // === SpeculativeJIT ===
63 // The SpeculativeJIT is used to generate a fast, but potentially
64 // incomplete code path for the dataflow. When code generating
65 // we may make assumptions about operand types, dynamically check,
66 // and bail-out to an alternate code path if these checks fail.
67 // Importantly, the speculative code path cannot be reentered once
68 // a speculative check has failed. This allows the SpeculativeJIT
69 // to propagate type information (including information that has
70 // only speculatively been asserted) through the dataflow.
71 class SpeculativeJIT {
72 WTF_MAKE_FAST_ALLOCATED;
74 friend struct OSRExit;
76 typedef JITCompiler::TrustedImm32 TrustedImm32;
77 typedef JITCompiler::Imm32 Imm32;
78 typedef JITCompiler::ImmPtr ImmPtr;
79 typedef JITCompiler::TrustedImm64 TrustedImm64;
80 typedef JITCompiler::Imm64 Imm64;
82 // These constants are used to set priorities for spill order for
83 // the register allocator.
86 SpillOrderConstant = 1, // no spill, and cheap fill
87 SpillOrderSpilled = 2, // no spill
88 SpillOrderJS = 4, // needs spill
89 SpillOrderCell = 4, // needs spill
90 SpillOrderStorage = 4, // needs spill
91 SpillOrderInteger = 5, // needs spill and box
92 SpillOrderBoolean = 5, // needs spill and box
93 SpillOrderDouble = 6, // needs spill and convert
95 #elif USE(JSVALUE32_64)
97 SpillOrderConstant = 1, // no spill, and cheap fill
98 SpillOrderSpilled = 2, // no spill
99 SpillOrderJS = 4, // needs spill
100 SpillOrderStorage = 4, // needs spill
101 SpillOrderDouble = 4, // needs spill
102 SpillOrderInteger = 5, // needs spill and box
103 SpillOrderCell = 5, // needs spill and box
104 SpillOrderBoolean = 5, // needs spill and box
108 enum UseChildrenMode { CallUseChildren, UseChildrenCalledExplicitly };
111 SpeculativeJIT(JITCompiler&);
119 struct TrustedImmPtr {
120 template <typename T>
121 explicit TrustedImmPtr(T* value)
124 static_assert(!std::is_base_of<HeapCell, T>::value, "To use a GC pointer, the graph must be aware of it. Use SpeculativeJIT::TrustedImmPtr::weakPointer instead.");
127 explicit TrustedImmPtr(RegisteredStructure structure)
128 : m_value(structure.get())
131 // This is only here so that TrustedImmPtr(0) does not confuse the C++
132 // overload handling rules.
133 explicit TrustedImmPtr(int value)
139 explicit TrustedImmPtr(std::nullptr_t)
143 explicit TrustedImmPtr(FrozenValue* value)
145 RELEASE_ASSERT(value->value().isCell());
146 m_value = MacroAssembler::TrustedImmPtr(value->cell());
149 explicit TrustedImmPtr(size_t value)
150 : m_value(bitwise_cast<void*>(value))
154 static TrustedImmPtr weakPointer(Graph& graph, JSCell* cell)
156 // There are weird relationships in how optimized CodeBlocks
157 // point to other CodeBlocks. We don't want to have them be
158 // part of the weak pointer set. For example, an optimized CodeBlock
159 // having a weak pointer to itself will cause it to get collected.
160 ASSERT(!jsDynamicCast<CodeBlock*>(graph.m_vm, cell));
162 graph.m_plan.weakReferences.addLazily(cell);
163 return TrustedImmPtr(bitwise_cast<size_t>(cell));
166 operator MacroAssembler::TrustedImmPtr() const { return m_value; }
170 return m_value.asIntptr();
174 MacroAssembler::TrustedImmPtr m_value;
179 void createOSREntries();
180 void linkOSREntries(LinkBuffer&);
182 BasicBlock* nextBlock()
184 for (BlockIndex resultIndex = m_block->index + 1; ; resultIndex++) {
185 if (resultIndex >= m_jit.graph().numBlocks())
187 if (BasicBlock* result = m_jit.graph().block(resultIndex))
193 GPRReg fillJSValue(Edge);
194 #elif USE(JSVALUE32_64)
195 bool fillJSValue(Edge, GPRReg&, GPRReg&, FPRReg&);
197 GPRReg fillStorage(Edge);
199 // lock and unlock GPR & FPR registers.
200 void lock(GPRReg reg)
204 void lock(FPRReg reg)
208 void unlock(GPRReg reg)
212 void unlock(FPRReg reg)
217 // Used to check whether a child node is on its last use,
218 // and its machine registers may be reused.
219 bool canReuse(Node* node)
221 return generationInfo(node).useCount() == 1;
223 bool canReuse(Node* nodeA, Node* nodeB)
225 return nodeA == nodeB && generationInfo(nodeA).useCount() == 2;
227 bool canReuse(Edge nodeUse)
229 return canReuse(nodeUse.node());
231 GPRReg reuse(GPRReg reg)
236 FPRReg reuse(FPRReg reg)
242 // Allocate a gpr/fpr.
245 #if ENABLE(DFG_REGISTER_ALLOCATION_VALIDATION)
246 m_jit.addRegisterAllocationAtOffset(m_jit.debugOffset());
248 VirtualRegister spillMe;
249 GPRReg gpr = m_gprs.allocate(spillMe);
250 if (spillMe.isValid()) {
251 #if USE(JSVALUE32_64)
252 GenerationInfo& info = generationInfoFromVirtualRegister(spillMe);
253 if ((info.registerFormat() & DataFormatJS))
254 m_gprs.release(info.tagGPR() == gpr ? info.payloadGPR() : info.tagGPR());
260 GPRReg allocate(GPRReg specific)
262 #if ENABLE(DFG_REGISTER_ALLOCATION_VALIDATION)
263 m_jit.addRegisterAllocationAtOffset(m_jit.debugOffset());
265 VirtualRegister spillMe = m_gprs.allocateSpecific(specific);
266 if (spillMe.isValid()) {
267 #if USE(JSVALUE32_64)
268 GenerationInfo& info = generationInfoFromVirtualRegister(spillMe);
269 RELEASE_ASSERT(info.registerFormat() != DataFormatJSDouble);
270 if ((info.registerFormat() & DataFormatJS))
271 m_gprs.release(info.tagGPR() == specific ? info.payloadGPR() : info.tagGPR());
279 return m_gprs.tryAllocate();
283 #if ENABLE(DFG_REGISTER_ALLOCATION_VALIDATION)
284 m_jit.addRegisterAllocationAtOffset(m_jit.debugOffset());
286 VirtualRegister spillMe;
287 FPRReg fpr = m_fprs.allocate(spillMe);
288 if (spillMe.isValid())
293 // Check whether a VirtualRegsiter is currently in a machine register.
294 // We use this when filling operands to fill those that are already in
295 // machine registers first (by locking VirtualRegsiters that are already
296 // in machine register before filling those that are not we attempt to
297 // avoid spilling values we will need immediately).
298 bool isFilled(Node* node)
300 return generationInfo(node).registerFormat() != DataFormatNone;
302 bool isFilledDouble(Node* node)
304 return generationInfo(node).registerFormat() == DataFormatDouble;
307 // Called on an operand once it has been consumed by a parent node.
310 if (!node->hasResult())
312 GenerationInfo& info = generationInfo(node);
314 // use() returns true when the value becomes dead, and any
315 // associated resources may be freed.
316 if (!info.use(*m_stream))
319 // Release the associated machine registers.
320 DataFormat registerFormat = info.registerFormat();
322 if (registerFormat == DataFormatDouble)
323 m_fprs.release(info.fpr());
324 else if (registerFormat != DataFormatNone)
325 m_gprs.release(info.gpr());
326 #elif USE(JSVALUE32_64)
327 if (registerFormat == DataFormatDouble)
328 m_fprs.release(info.fpr());
329 else if (registerFormat & DataFormatJS) {
330 m_gprs.release(info.tagGPR());
331 m_gprs.release(info.payloadGPR());
332 } else if (registerFormat != DataFormatNone)
333 m_gprs.release(info.gpr());
336 void use(Edge nodeUse)
341 RegisterSet usedRegisters();
343 bool masqueradesAsUndefinedWatchpointIsStillValid(const CodeOrigin& codeOrigin)
345 return m_jit.graph().masqueradesAsUndefinedWatchpointIsStillValid(codeOrigin);
347 bool masqueradesAsUndefinedWatchpointIsStillValid()
349 return masqueradesAsUndefinedWatchpointIsStillValid(m_currentNode->origin.semantic);
352 void compileStoreBarrier(Node*);
354 static GPRReg selectScratchGPR(GPRReg preserve1 = InvalidGPRReg, GPRReg preserve2 = InvalidGPRReg, GPRReg preserve3 = InvalidGPRReg, GPRReg preserve4 = InvalidGPRReg)
356 return AssemblyHelpers::selectScratchGPR(preserve1, preserve2, preserve3, preserve4);
359 // Called by the speculative operand types, below, to fill operand to
360 // machine registers, implicitly generating speculation checks as needed.
361 GPRReg fillSpeculateInt32(Edge, DataFormat& returnFormat);
362 GPRReg fillSpeculateInt32Strict(Edge);
363 GPRReg fillSpeculateInt52(Edge, DataFormat desiredFormat);
364 FPRReg fillSpeculateDouble(Edge);
365 GPRReg fillSpeculateCell(Edge);
366 GPRReg fillSpeculateBoolean(Edge);
367 GeneratedOperandType checkGeneratedTypeForToInt32(Node*);
369 void addSlowPathGenerator(std::unique_ptr<SlowPathGenerator>);
370 void addSlowPathGenerator(std::function<void()>);
371 void runSlowPathGenerators(PCToCodeOriginMapBuilder&);
374 void noticeOSRBirth(Node*);
375 void bail(AbortReason);
376 void compileCurrentBlock();
378 void checkArgumentTypes();
380 void clearGenerationInfo();
382 // These methods are used when generating 'unexpected'
383 // calls out from JIT code to C++ helper routines -
384 // they spill all live values to the appropriate
385 // slots in the JSStack without changing any state
386 // in the GenerationInfo.
387 SilentRegisterSavePlan silentSavePlanForGPR(VirtualRegister spillMe, GPRReg source);
388 SilentRegisterSavePlan silentSavePlanForFPR(VirtualRegister spillMe, FPRReg source);
389 void silentSpill(const SilentRegisterSavePlan&);
390 void silentFill(const SilentRegisterSavePlan&);
392 template<typename CollectionType>
393 void silentSpill(const CollectionType& savePlans)
395 for (unsigned i = 0; i < savePlans.size(); ++i)
396 silentSpill(savePlans[i]);
399 template<typename CollectionType>
400 void silentFill(const CollectionType& savePlans)
402 for (unsigned i = savePlans.size(); i--;)
403 silentFill(savePlans[i]);
406 template<typename CollectionType>
407 void silentSpillAllRegistersImpl(bool doSpill, CollectionType& plans, GPRReg exclude, GPRReg exclude2 = InvalidGPRReg, FPRReg fprExclude = InvalidFPRReg)
409 ASSERT(plans.isEmpty());
410 for (gpr_iterator iter = m_gprs.begin(); iter != m_gprs.end(); ++iter) {
411 GPRReg gpr = iter.regID();
412 if (iter.name().isValid() && gpr != exclude && gpr != exclude2) {
413 SilentRegisterSavePlan plan = silentSavePlanForGPR(iter.name(), gpr);
419 for (fpr_iterator iter = m_fprs.begin(); iter != m_fprs.end(); ++iter) {
420 if (iter.name().isValid() && iter.regID() != fprExclude) {
421 SilentRegisterSavePlan plan = silentSavePlanForFPR(iter.name(), iter.regID());
428 template<typename CollectionType>
429 void silentSpillAllRegistersImpl(bool doSpill, CollectionType& plans, NoResultTag)
431 silentSpillAllRegistersImpl(doSpill, plans, InvalidGPRReg, InvalidGPRReg, InvalidFPRReg);
433 template<typename CollectionType>
434 void silentSpillAllRegistersImpl(bool doSpill, CollectionType& plans, FPRReg exclude)
436 silentSpillAllRegistersImpl(doSpill, plans, InvalidGPRReg, InvalidGPRReg, exclude);
438 template<typename CollectionType>
439 void silentSpillAllRegistersImpl(bool doSpill, CollectionType& plans, JSValueRegs exclude)
441 #if USE(JSVALUE32_64)
442 silentSpillAllRegistersImpl(doSpill, plans, exclude.tagGPR(), exclude.payloadGPR());
444 silentSpillAllRegistersImpl(doSpill, plans, exclude.gpr());
448 void silentSpillAllRegisters(GPRReg exclude, GPRReg exclude2 = InvalidGPRReg, FPRReg fprExclude = InvalidFPRReg)
450 silentSpillAllRegistersImpl(true, m_plans, exclude, exclude2, fprExclude);
452 void silentSpillAllRegisters(FPRReg exclude)
454 silentSpillAllRegisters(InvalidGPRReg, InvalidGPRReg, exclude);
456 void silentSpillAllRegisters(JSValueRegs exclude)
459 silentSpillAllRegisters(exclude.payloadGPR());
461 silentSpillAllRegisters(exclude.payloadGPR(), exclude.tagGPR());
465 void silentFillAllRegisters()
467 while (!m_plans.isEmpty()) {
468 SilentRegisterSavePlan& plan = m_plans.last();
470 m_plans.removeLast();
474 // These methods convert between doubles, and doubles boxed and JSValues.
476 GPRReg boxDouble(FPRReg fpr, GPRReg gpr)
478 return m_jit.boxDouble(fpr, gpr);
480 FPRReg unboxDouble(GPRReg gpr, GPRReg resultGPR, FPRReg fpr)
482 return m_jit.unboxDouble(gpr, resultGPR, fpr);
484 GPRReg boxDouble(FPRReg fpr)
486 return boxDouble(fpr, allocate());
489 void boxInt52(GPRReg sourceGPR, GPRReg targetGPR, DataFormat);
490 #elif USE(JSVALUE32_64)
491 void boxDouble(FPRReg fpr, GPRReg tagGPR, GPRReg payloadGPR)
493 m_jit.boxDouble(fpr, tagGPR, payloadGPR);
495 void unboxDouble(GPRReg tagGPR, GPRReg payloadGPR, FPRReg fpr, FPRReg scratchFPR)
497 m_jit.unboxDouble(tagGPR, payloadGPR, fpr, scratchFPR);
500 void boxDouble(FPRReg fpr, JSValueRegs regs)
502 m_jit.boxDouble(fpr, regs);
505 // Spill a VirtualRegister to the JSStack.
506 void spill(VirtualRegister spillMe)
508 GenerationInfo& info = generationInfoFromVirtualRegister(spillMe);
510 #if USE(JSVALUE32_64)
511 if (info.registerFormat() == DataFormatNone) // it has been spilled. JS values which have two GPRs can reach here
514 // Check the GenerationInfo to see if this value need writing
515 // to the JSStack - if not, mark it as spilled & return.
516 if (!info.needsSpill()) {
517 info.setSpilled(*m_stream, spillMe);
521 DataFormat spillFormat = info.registerFormat();
522 switch (spillFormat) {
523 case DataFormatStorage: {
524 // This is special, since it's not a JS value - as in it's not visible to JS
526 m_jit.storePtr(info.gpr(), JITCompiler::addressFor(spillMe));
527 info.spill(*m_stream, spillMe, DataFormatStorage);
531 case DataFormatInt32: {
532 m_jit.store32(info.gpr(), JITCompiler::payloadFor(spillMe));
533 info.spill(*m_stream, spillMe, DataFormatInt32);
538 case DataFormatDouble: {
539 m_jit.storeDouble(info.fpr(), JITCompiler::addressFor(spillMe));
540 info.spill(*m_stream, spillMe, DataFormatDouble);
544 case DataFormatInt52:
545 case DataFormatStrictInt52: {
546 m_jit.store64(info.gpr(), JITCompiler::addressFor(spillMe));
547 info.spill(*m_stream, spillMe, spillFormat);
552 // The following code handles JSValues, int32s, and cells.
553 RELEASE_ASSERT(spillFormat == DataFormatCell || spillFormat & DataFormatJS);
555 GPRReg reg = info.gpr();
556 // We need to box int32 and cell values ...
557 // but on JSVALUE64 boxing a cell is a no-op!
558 if (spillFormat == DataFormatInt32)
559 m_jit.or64(GPRInfo::tagTypeNumberRegister, reg);
561 // Spill the value, and record it as spilled in its boxed form.
562 m_jit.store64(reg, JITCompiler::addressFor(spillMe));
563 info.spill(*m_stream, spillMe, (DataFormat)(spillFormat | DataFormatJS));
565 #elif USE(JSVALUE32_64)
567 case DataFormatBoolean: {
568 m_jit.store32(info.gpr(), JITCompiler::payloadFor(spillMe));
569 info.spill(*m_stream, spillMe, spillFormat);
573 case DataFormatDouble: {
574 // On JSVALUE32_64 boxing a double is a no-op.
575 m_jit.storeDouble(info.fpr(), JITCompiler::addressFor(spillMe));
576 info.spill(*m_stream, spillMe, DataFormatDouble);
581 // The following code handles JSValues.
582 RELEASE_ASSERT(spillFormat & DataFormatJS);
583 m_jit.store32(info.tagGPR(), JITCompiler::tagFor(spillMe));
584 m_jit.store32(info.payloadGPR(), JITCompiler::payloadFor(spillMe));
585 info.spill(*m_stream, spillMe, spillFormat);
591 bool isKnownInteger(Node* node) { return m_state.forNode(node).isType(SpecInt32Only); }
592 bool isKnownCell(Node* node) { return m_state.forNode(node).isType(SpecCell); }
594 bool isKnownNotInteger(Node* node) { return !(m_state.forNode(node).m_type & SpecInt32Only); }
595 bool isKnownNotNumber(Node* node) { return !(m_state.forNode(node).m_type & SpecFullNumber); }
596 bool isKnownNotCell(Node* node) { return !(m_state.forNode(node).m_type & SpecCell); }
597 bool isKnownNotOther(Node* node) { return !(m_state.forNode(node).m_type & SpecOther); }
599 UniquedStringImpl* identifierUID(unsigned index)
601 return m_jit.graph().identifiers()[index];
604 // Spill all VirtualRegisters back to the JSStack.
605 void flushRegisters()
607 for (gpr_iterator iter = m_gprs.begin(); iter != m_gprs.end(); ++iter) {
608 if (iter.name().isValid()) {
613 for (fpr_iterator iter = m_fprs.begin(); iter != m_fprs.end(); ++iter) {
614 if (iter.name().isValid()) {
621 // Used to ASSERT flushRegisters() has been called prior to
622 // calling out from JIT code to a C helper function.
625 for (gpr_iterator iter = m_gprs.begin(); iter != m_gprs.end(); ++iter) {
626 if (iter.name().isValid())
629 for (fpr_iterator iter = m_fprs.begin(); iter != m_fprs.end(); ++iter) {
630 if (iter.name().isValid())
637 static MacroAssembler::Imm64 valueOfJSConstantAsImm64(Node* node)
639 return MacroAssembler::Imm64(JSValue::encode(node->asJSValue()));
643 // Helper functions to enable code sharing in implementations of bit/shift ops.
644 void bitOp(NodeType op, int32_t imm, GPRReg op1, GPRReg result)
648 m_jit.and32(Imm32(imm), op1, result);
651 m_jit.or32(Imm32(imm), op1, result);
654 m_jit.xor32(Imm32(imm), op1, result);
657 RELEASE_ASSERT_NOT_REACHED();
660 void bitOp(NodeType op, GPRReg op1, GPRReg op2, GPRReg result)
664 m_jit.and32(op1, op2, result);
667 m_jit.or32(op1, op2, result);
670 m_jit.xor32(op1, op2, result);
673 RELEASE_ASSERT_NOT_REACHED();
676 void shiftOp(NodeType op, GPRReg op1, int32_t shiftAmount, GPRReg result)
680 m_jit.rshift32(op1, Imm32(shiftAmount), result);
683 m_jit.lshift32(op1, Imm32(shiftAmount), result);
686 m_jit.urshift32(op1, Imm32(shiftAmount), result);
689 RELEASE_ASSERT_NOT_REACHED();
692 void shiftOp(NodeType op, GPRReg op1, GPRReg shiftAmount, GPRReg result)
696 m_jit.rshift32(op1, shiftAmount, result);
699 m_jit.lshift32(op1, shiftAmount, result);
702 m_jit.urshift32(op1, shiftAmount, result);
705 RELEASE_ASSERT_NOT_REACHED();
709 // Returns the index of the branch node if peephole is okay, UINT_MAX otherwise.
710 unsigned detectPeepHoleBranch()
712 // Check that no intervening nodes will be generated.
713 for (unsigned index = m_indexInBlock + 1; index < m_block->size() - 1; ++index) {
714 Node* node = m_block->at(index);
715 if (!node->shouldGenerate())
717 // Check if it's a Phantom that can be safely ignored.
718 if (node->op() == Phantom && !node->child1())
723 // Check if the lastNode is a branch on this node.
724 Node* lastNode = m_block->terminal();
725 return lastNode->op() == Branch && lastNode->child1() == m_currentNode ? m_block->size() - 1 : UINT_MAX;
728 void compileCheckTraps(Node*);
730 void compileMovHint(Node*);
731 void compileMovHintAndCheck(Node*);
733 void cachedGetById(CodeOrigin, JSValueRegs base, JSValueRegs result, unsigned identifierNumber, JITCompiler::Jump slowPathTarget = JITCompiler::Jump(), SpillRegistersMode = NeedToSpill, AccessType = AccessType::Get);
736 void cachedGetById(CodeOrigin, GPRReg baseGPR, GPRReg resultGPR, unsigned identifierNumber, JITCompiler::Jump slowPathTarget = JITCompiler::Jump(), SpillRegistersMode = NeedToSpill, AccessType = AccessType::Get);
737 void cachedPutById(CodeOrigin, GPRReg base, GPRReg value, GPRReg scratchGPR, unsigned identifierNumber, PutKind, JITCompiler::Jump slowPathTarget = JITCompiler::Jump(), SpillRegistersMode = NeedToSpill);
738 void cachedGetByIdWithThis(CodeOrigin, GPRReg baseGPR, GPRReg thisGPR, GPRReg resultGPR, unsigned identifierNumber, JITCompiler::JumpList slowPathTarget = JITCompiler::JumpList());
739 #elif USE(JSVALUE32_64)
740 void cachedGetById(CodeOrigin, GPRReg baseTagGPROrNone, GPRReg basePayloadGPR, GPRReg resultTagGPR, GPRReg resultPayloadGPR, unsigned identifierNumber, JITCompiler::Jump slowPathTarget = JITCompiler::Jump(), SpillRegistersMode = NeedToSpill, AccessType = AccessType::Get);
741 void cachedPutById(CodeOrigin, GPRReg basePayloadGPR, GPRReg valueTagGPR, GPRReg valuePayloadGPR, GPRReg scratchGPR, unsigned identifierNumber, PutKind, JITCompiler::Jump slowPathTarget = JITCompiler::Jump(), SpillRegistersMode = NeedToSpill);
742 void cachedGetByIdWithThis(CodeOrigin, GPRReg baseTagGPROrNone, GPRReg basePayloadGPR, GPRReg thisTagGPROrNone, GPRReg thisPayloadGPR, GPRReg resultTagGPR, GPRReg resultPayloadGPR, unsigned identifierNumber, JITCompiler::JumpList slowPathTarget = JITCompiler::JumpList());
745 void compileDeleteById(Node*);
746 void compileDeleteByVal(Node*);
747 void compilePushWithScope(Node*);
748 void compileTryGetById(Node*);
749 void compileIn(Node*);
751 void nonSpeculativeNonPeepholeCompareNullOrUndefined(Edge operand);
752 void nonSpeculativePeepholeBranchNullOrUndefined(Edge operand, Node* branchNode);
754 void nonSpeculativePeepholeBranch(Node*, Node* branchNode, MacroAssembler::RelationalCondition, S_JITOperation_EJJ helperFunction);
755 void nonSpeculativeNonPeepholeCompare(Node*, MacroAssembler::RelationalCondition, S_JITOperation_EJJ helperFunction);
756 bool nonSpeculativeCompare(Node*, MacroAssembler::RelationalCondition, S_JITOperation_EJJ helperFunction);
758 void nonSpeculativePeepholeStrictEq(Node*, Node* branchNode, bool invert = false);
759 void nonSpeculativeNonPeepholeStrictEq(Node*, bool invert = false);
760 bool nonSpeculativeStrictEq(Node*, bool invert = false);
762 void compileInstanceOfForObject(Node*, GPRReg valueReg, GPRReg prototypeReg, GPRReg scratchAndResultReg, GPRReg scratch2Reg, GPRReg scratch3Reg);
763 void compileInstanceOf(Node*);
764 void compileInstanceOfCustom(Node*);
766 void compileIsCellWithType(Node*);
767 void compileIsTypedArrayView(Node*);
769 void emitCall(Node*);
771 void emitAllocateButterfly(GPRReg storageGPR, GPRReg sizeGPR, GPRReg scratch1, GPRReg scratch2, GPRReg scratch3, MacroAssembler::JumpList& slowCases);
772 void emitInitializeButterfly(GPRReg storageGPR, GPRReg sizeGPR, JSValueRegs emptyValueRegs, GPRReg scratchGPR);
773 void compileAllocateNewArrayWithSize(JSGlobalObject*, GPRReg resultGPR, GPRReg sizeGPR, IndexingType, bool shouldConvertLargeSizeToArrayStorage = true);
775 // Called once a node has completed code generation but prior to setting
776 // its result, to free up its children. (This must happen prior to setting
777 // the nodes result, since the node may have the same VirtualRegister as
778 // a child, and as such will use the same GeneratioInfo).
779 void useChildren(Node*);
781 // These method called to initialize the GenerationInfo
782 // to describe the result of an operation.
783 void int32Result(GPRReg reg, Node* node, DataFormat format = DataFormatInt32, UseChildrenMode mode = CallUseChildren)
785 if (mode == CallUseChildren)
788 VirtualRegister virtualRegister = node->virtualRegister();
789 GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister);
791 if (format == DataFormatInt32) {
792 m_jit.jitAssertIsInt32(reg);
793 m_gprs.retain(reg, virtualRegister, SpillOrderInteger);
794 info.initInt32(node, node->refCount(), reg);
797 RELEASE_ASSERT(format == DataFormatJSInt32);
798 m_jit.jitAssertIsJSInt32(reg);
799 m_gprs.retain(reg, virtualRegister, SpillOrderJS);
800 info.initJSValue(node, node->refCount(), reg, format);
801 #elif USE(JSVALUE32_64)
802 RELEASE_ASSERT_NOT_REACHED();
806 void int32Result(GPRReg reg, Node* node, UseChildrenMode mode)
808 int32Result(reg, node, DataFormatInt32, mode);
810 void int52Result(GPRReg reg, Node* node, DataFormat format, UseChildrenMode mode = CallUseChildren)
812 if (mode == CallUseChildren)
815 VirtualRegister virtualRegister = node->virtualRegister();
816 GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister);
818 m_gprs.retain(reg, virtualRegister, SpillOrderJS);
819 info.initInt52(node, node->refCount(), reg, format);
821 void int52Result(GPRReg reg, Node* node, UseChildrenMode mode = CallUseChildren)
823 int52Result(reg, node, DataFormatInt52, mode);
825 void strictInt52Result(GPRReg reg, Node* node, UseChildrenMode mode = CallUseChildren)
827 int52Result(reg, node, DataFormatStrictInt52, mode);
829 void noResult(Node* node, UseChildrenMode mode = CallUseChildren)
831 if (mode == UseChildrenCalledExplicitly)
835 void cellResult(GPRReg reg, Node* node, UseChildrenMode mode = CallUseChildren)
837 if (mode == CallUseChildren)
840 VirtualRegister virtualRegister = node->virtualRegister();
841 m_gprs.retain(reg, virtualRegister, SpillOrderCell);
842 GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister);
843 info.initCell(node, node->refCount(), reg);
845 void blessedBooleanResult(GPRReg reg, Node* node, UseChildrenMode mode = CallUseChildren)
848 jsValueResult(reg, node, DataFormatJSBoolean, mode);
850 booleanResult(reg, node, mode);
853 void unblessedBooleanResult(GPRReg reg, Node* node, UseChildrenMode mode = CallUseChildren)
858 blessedBooleanResult(reg, node, mode);
861 void jsValueResult(GPRReg reg, Node* node, DataFormat format = DataFormatJS, UseChildrenMode mode = CallUseChildren)
863 if (format == DataFormatJSInt32)
864 m_jit.jitAssertIsJSInt32(reg);
866 if (mode == CallUseChildren)
869 VirtualRegister virtualRegister = node->virtualRegister();
870 m_gprs.retain(reg, virtualRegister, SpillOrderJS);
871 GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister);
872 info.initJSValue(node, node->refCount(), reg, format);
874 void jsValueResult(GPRReg reg, Node* node, UseChildrenMode mode)
876 jsValueResult(reg, node, DataFormatJS, mode);
878 #elif USE(JSVALUE32_64)
879 void booleanResult(GPRReg reg, Node* node, UseChildrenMode mode = CallUseChildren)
881 if (mode == CallUseChildren)
884 VirtualRegister virtualRegister = node->virtualRegister();
885 m_gprs.retain(reg, virtualRegister, SpillOrderBoolean);
886 GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister);
887 info.initBoolean(node, node->refCount(), reg);
889 void jsValueResult(GPRReg tag, GPRReg payload, Node* node, DataFormat format = DataFormatJS, UseChildrenMode mode = CallUseChildren)
891 if (mode == CallUseChildren)
894 VirtualRegister virtualRegister = node->virtualRegister();
895 m_gprs.retain(tag, virtualRegister, SpillOrderJS);
896 m_gprs.retain(payload, virtualRegister, SpillOrderJS);
897 GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister);
898 info.initJSValue(node, node->refCount(), tag, payload, format);
900 void jsValueResult(GPRReg tag, GPRReg payload, Node* node, UseChildrenMode mode)
902 jsValueResult(tag, payload, node, DataFormatJS, mode);
905 void jsValueResult(JSValueRegs regs, Node* node, DataFormat format = DataFormatJS, UseChildrenMode mode = CallUseChildren)
908 jsValueResult(regs.gpr(), node, format, mode);
910 jsValueResult(regs.tagGPR(), regs.payloadGPR(), node, format, mode);
913 void storageResult(GPRReg reg, Node* node, UseChildrenMode mode = CallUseChildren)
915 if (mode == CallUseChildren)
918 VirtualRegister virtualRegister = node->virtualRegister();
919 m_gprs.retain(reg, virtualRegister, SpillOrderStorage);
920 GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister);
921 info.initStorage(node, node->refCount(), reg);
923 void doubleResult(FPRReg reg, Node* node, UseChildrenMode mode = CallUseChildren)
925 if (mode == CallUseChildren)
928 VirtualRegister virtualRegister = node->virtualRegister();
929 m_fprs.retain(reg, virtualRegister, SpillOrderDouble);
930 GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister);
931 info.initDouble(node, node->refCount(), reg);
933 void initConstantInfo(Node* node)
935 ASSERT(node->hasConstant());
936 generationInfo(node).initConstant(node, node->refCount());
939 // These methods add calls to C++ helper functions.
940 // These methods are broadly value representation specific (i.e.
941 // deal with the fact that a JSValue may be passed in one or two
942 // machine registers, and delegate the calling convention specific
943 // decision as to how to fill the regsiters to setupArguments* methods.
945 JITCompiler::Call callOperation(V_JITOperation_E operation)
947 m_jit.setupArgumentsExecState();
948 return appendCall(operation);
950 JITCompiler::Call callOperation(P_JITOperation_E operation, GPRReg result)
952 m_jit.setupArgumentsExecState();
953 return appendCallSetResult(operation, result);
955 JITCompiler::Call callOperation(P_JITOperation_EC operation, GPRReg result, GPRReg cell)
957 m_jit.setupArgumentsWithExecState(cell);
958 return appendCallSetResult(operation, result);
960 JITCompiler::Call callOperation(Jss_JITOperation_EJssUi operation, GPRReg result, GPRReg arg1, GPRReg arg2)
962 m_jit.setupArgumentsWithExecState(arg1, arg2);
963 return appendCallSetResult(operation, result);
965 JITCompiler::Call callOperation(V_JITOperation_EJssUi operation, GPRReg arg1, uint32_t arg2)
967 m_jit.setupArgumentsWithExecState(arg1, TrustedImm32(arg2));
968 return appendCall(operation);
970 JITCompiler::Call callOperation(P_JITOperation_EO operation, GPRReg result, GPRReg object)
972 m_jit.setupArgumentsWithExecState(object);
973 return appendCallSetResult(operation, result);
975 JITCompiler::Call callOperation(P_JITOperation_EOS operation, GPRReg result, GPRReg object, size_t size)
977 m_jit.setupArgumentsWithExecState(object, TrustedImmPtr(size));
978 return appendCallSetResult(operation, result);
980 JITCompiler::Call callOperation(P_JITOperation_EOZ operation, GPRReg result, GPRReg object, int32_t size)
982 m_jit.setupArgumentsWithExecState(object, TrustedImmPtr(size));
983 return appendCallSetResult(operation, result);
985 JITCompiler::Call callOperation(C_JITOperation_EOZ operation, GPRReg result, GPRReg object, int32_t size)
987 m_jit.setupArgumentsWithExecState(object, TrustedImmPtr(static_cast<size_t>(size)));
988 return appendCallSetResult(operation, result);
990 JITCompiler::Call callOperation(J_JITOperation_EO operation, JSValueRegs result, GPRReg object)
992 m_jit.setupArgumentsWithExecState(object);
993 return appendCallSetResult(operation, result);
995 JITCompiler::Call callOperation(P_JITOperation_EPS operation, GPRReg result, GPRReg old, size_t size)
997 m_jit.setupArgumentsWithExecState(old, TrustedImmPtr(size));
998 return appendCallSetResult(operation, result);
1000 JITCompiler::Call callOperation(C_JITOperation_EPUi operation, GPRReg result, void* arg1, uint32_t arg2)
1002 m_jit.setupArgumentsWithExecState(TrustedImmPtr(arg1), TrustedImm32(arg2));
1003 return appendCallSetResult(operation, result);
1005 JITCompiler::Call callOperation(P_JITOperation_ES operation, GPRReg result, size_t size)
1007 m_jit.setupArgumentsWithExecState(TrustedImmPtr(size));
1008 return appendCallSetResult(operation, result);
1010 JITCompiler::Call callOperation(P_JITOperation_ESJss operation, GPRReg result, size_t index, GPRReg arg1)
1012 m_jit.setupArgumentsWithExecState(TrustedImmPtr(index), arg1);
1013 return appendCallSetResult(operation, result);
1015 JITCompiler::Call callOperation(Z_JITOperation_EOI operation, GPRReg result, GPRReg obj, GPRReg impl)
1017 m_jit.setupArgumentsWithExecState(obj, impl);
1018 return appendCallSetResult(operation, result);
1020 JITCompiler::Call callOperation(Z_JITOperation_EBJssZ operation, GPRReg result, GPRReg butterfly, GPRReg string, GPRReg index)
1022 m_jit.setupArgumentsWithExecState(butterfly, string, index);
1023 return appendCallSetResult(operation, result);
1025 JITCompiler::Call callOperation(P_JITOperation_ESt operation, GPRReg result, RegisteredStructure structure)
1027 m_jit.setupArgumentsWithExecState(TrustedImmPtr(structure));
1028 return appendCallSetResult(operation, result);
1030 JITCompiler::Call callOperation(P_JITOperation_EStZP operation, GPRReg result, RegisteredStructure structure, GPRReg arg2, GPRReg arg3)
1032 m_jit.setupArgumentsWithExecState(TrustedImmPtr(structure), arg2, arg3);
1033 return appendCallSetResult(operation, result);
1035 JITCompiler::Call callOperation(P_JITOperation_EStZP operation, GPRReg result, RegisteredStructure structure, size_t arg2, GPRReg arg3)
1037 m_jit.setupArgumentsWithExecState(TrustedImmPtr(structure), TrustedImm32(arg2), arg3);
1038 return appendCallSetResult(operation, result);
1040 JITCompiler::Call callOperation(P_JITOperation_EStZP operation, GPRReg result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
1042 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1043 return appendCallSetResult(operation, result);
1045 JITCompiler::Call callOperation(P_JITOperation_EStZB operation, GPRReg result, RegisteredStructure structure, GPRReg arg2, GPRReg butterfly)
1047 m_jit.setupArgumentsWithExecState(TrustedImmPtr(structure), arg2, butterfly);
1048 return appendCallSetResult(operation, result);
1050 JITCompiler::Call callOperation(P_JITOperation_EStZB operation, GPRReg result, RegisteredStructure structure, size_t arg2, GPRReg butterfly)
1052 m_jit.setupArgumentsWithExecState(TrustedImmPtr(structure), TrustedImm32(arg2), butterfly);
1053 return appendCallSetResult(operation, result);
1055 JITCompiler::Call callOperation(P_JITOperation_EStZB operation, GPRReg result, GPRReg arg1, GPRReg arg2, GPRReg butterfly)
1057 m_jit.setupArgumentsWithExecState(arg1, arg2, butterfly);
1058 return appendCallSetResult(operation, result);
1060 JITCompiler::Call callOperation(P_JITOperation_EStZB operation, GPRReg result, GPRReg arg1, GPRReg arg2, Butterfly* butterfly)
1062 m_jit.setupArgumentsWithExecState(arg1, arg2, TrustedImmPtr(butterfly));
1063 return appendCallSetResult(operation, result);
1065 JITCompiler::Call callOperation(P_JITOperation_EStPS operation, GPRReg result, RegisteredStructure structure, void* pointer, size_t size)
1067 m_jit.setupArgumentsWithExecState(TrustedImmPtr(structure), TrustedImmPtr(pointer), TrustedImmPtr(size));
1068 return appendCallSetResult(operation, result);
1070 JITCompiler::Call callOperation(P_JITOperation_EStSS operation, GPRReg result, RegisteredStructure structure, size_t index, size_t size)
1072 m_jit.setupArgumentsWithExecState(TrustedImmPtr(structure), TrustedImmPtr(index), TrustedImmPtr(size));
1073 return appendCallSetResult(operation, result);
1075 JITCompiler::Call callOperation(C_JITOperation_E operation, GPRReg result)
1077 m_jit.setupArgumentsExecState();
1078 return appendCallSetResult(operation, result);
1080 JITCompiler::Call callOperation(C_JITOperation_EC operation, GPRReg result, GPRReg arg1)
1082 m_jit.setupArgumentsWithExecState(arg1);
1083 return appendCallSetResult(operation, result);
1085 JITCompiler::Call callOperation(C_JITOperation_EC operation, GPRReg result, JSCell* cell)
1087 m_jit.setupArgumentsWithExecState(TrustedImmPtr::weakPointer(m_jit.graph(), cell));
1088 return appendCallSetResult(operation, result);
1090 JITCompiler::Call callOperation(C_JITOperation_ECZ operation, GPRReg result, GPRReg arg1, GPRReg arg2)
1092 m_jit.setupArgumentsWithExecState(arg1, arg2);
1093 return appendCallSetResult(operation, result);
1095 JITCompiler::Call callOperation(C_JITOperation_ECZC operation, GPRReg result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
1097 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1098 return appendCallSetResult(operation, result);
1100 JITCompiler::Call callOperation(C_JITOperation_EJscC operation, GPRReg result, GPRReg arg1, JSCell* cell)
1102 m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr::weakPointer(m_jit.graph(), cell));
1103 return appendCallSetResult(operation, result);
1105 JITCompiler::Call callOperation(C_JITOperation_EIcf operation, GPRReg result, InlineCallFrame* inlineCallFrame)
1107 m_jit.setupArgumentsWithExecState(TrustedImmPtr(inlineCallFrame));
1108 return appendCallSetResult(operation, result);
1110 JITCompiler::Call callOperation(C_JITOperation_ESt operation, GPRReg result, RegisteredStructure structure)
1112 m_jit.setupArgumentsWithExecState(TrustedImmPtr(structure));
1113 return appendCallSetResult(operation, result);
1117 JITCompiler::Call callOperation(C_JITOperation_EStJscSymtabJ operation, GPRReg result, RegisteredStructure structure, GPRReg scope, SymbolTable* table, TrustedImm64 initialValue)
1119 m_jit.setupArgumentsWithExecState(TrustedImmPtr(structure), scope, TrustedImmPtr::weakPointer(m_jit.graph(), table), initialValue);
1120 return appendCallSetResult(operation, result);
1123 JITCompiler::Call callOperation(C_JITOperation_EStJscSymtabJ operation, GPRReg result, RegisteredStructure structure, GPRReg scope, SymbolTable* table, TrustedImm32 tag, TrustedImm32 payload)
1125 m_jit.setupArgumentsWithExecState(TrustedImmPtr(structure), scope, TrustedImmPtr::weakPointer(m_jit.graph(), table), payload, tag);
1126 return appendCallSetResult(operation, result);
1129 JITCompiler::Call callOperation(C_JITOperation_EStZ operation, GPRReg result, RegisteredStructure structure, unsigned knownLength)
1131 m_jit.setupArgumentsWithExecState(TrustedImmPtr(structure), TrustedImm32(knownLength));
1132 return appendCallSetResult(operation, result);
1134 JITCompiler::Call callOperation(C_JITOperation_ECZZ operation, GPRReg result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
1136 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1137 return appendCallSetResult(operation, result);
1139 JITCompiler::Call callOperation(C_JITOperation_EStZZ operation, GPRReg result, RegisteredStructure structure, unsigned knownLength, unsigned minCapacity)
1141 m_jit.setupArgumentsWithExecState(TrustedImmPtr(structure), TrustedImm32(knownLength), TrustedImm32(minCapacity));
1142 return appendCallSetResult(operation, result);
1144 JITCompiler::Call callOperation(C_JITOperation_EStZ operation, GPRReg result, RegisteredStructure structure, GPRReg length)
1146 m_jit.setupArgumentsWithExecState(TrustedImmPtr(structure), length);
1147 return appendCallSetResult(operation, result);
1149 JITCompiler::Call callOperation(C_JITOperation_EStZZ operation, GPRReg result, RegisteredStructure structure, GPRReg length, unsigned minCapacity)
1151 m_jit.setupArgumentsWithExecState(TrustedImmPtr(structure), length, TrustedImm32(minCapacity));
1152 return appendCallSetResult(operation, result);
1154 JITCompiler::Call callOperation(C_JITOperation_EJssSt operation, GPRReg result, GPRReg arg1, RegisteredStructure structure)
1156 m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(structure));
1157 return appendCallSetResult(operation, result);
1159 JITCompiler::Call callOperation(C_JITOperation_EJssJss operation, GPRReg result, GPRReg arg1, GPRReg arg2)
1161 m_jit.setupArgumentsWithExecState(arg1, arg2);
1162 return appendCallSetResult(operation, result);
1164 JITCompiler::Call callOperation(C_JITOperation_B_EJssJss operation, GPRReg result, GPRReg arg1, GPRReg arg2)
1166 m_jit.setupArgumentsWithExecState(arg1, arg2);
1167 return appendCallSetResult(operation, result);
1169 JITCompiler::Call callOperation(C_JITOperation_TT operation, GPRReg result, GPRReg arg1, GPRReg arg2)
1171 m_jit.setupArguments(arg1, arg2);
1172 return appendCallSetResult(operation, result);
1174 JITCompiler::Call callOperation(C_JITOperation_EJssJssJss operation, GPRReg result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
1176 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1177 return appendCallSetResult(operation, result);
1180 JITCompiler::Call callOperation(S_JITOperation_ECC operation, GPRReg result, GPRReg arg1, GPRReg arg2)
1182 m_jit.setupArgumentsWithExecState(arg1, arg2);
1183 return appendCallSetResult(operation, result);
1186 JITCompiler::Call callOperation(S_JITOperation_EGC operation, GPRReg result, JSGlobalObject* globalObject, GPRReg arg2)
1188 m_jit.setupArgumentsWithExecState(TrustedImmPtr::weakPointer(m_jit.graph(), globalObject), arg2);
1189 return appendCallSetResult(operation, result);
1192 JITCompiler::Call callOperation(C_JITOperation_EGC operation, GPRReg result, TrustedImmPtr globalObject, GPRReg arg2)
1194 m_jit.setupArgumentsWithExecState(globalObject, arg2);
1195 return appendCallSetResult(operation, result);
1198 JITCompiler::Call callOperation(C_JITOperation_EGC operation, GPRReg result, JSGlobalObject* globalObject, GPRReg arg2)
1200 m_jit.setupArgumentsWithExecState(TrustedImmPtr::weakPointer(m_jit.graph(), globalObject), arg2);
1201 return appendCallSetResult(operation, result);
1204 JITCompiler::Call callOperation(Jss_JITOperation_EZ operation, GPRReg result, GPRReg arg1)
1206 m_jit.setupArgumentsWithExecState(arg1);
1207 return appendCallSetResult(operation, result);
1210 JITCompiler::Call callOperation(V_JITOperation_EC operation, GPRReg arg1)
1212 m_jit.setupArgumentsWithExecState(arg1);
1213 return appendCall(operation);
1216 JITCompiler::Call callOperation(V_JITOperation_ECliJsf operation, CallLinkInfo* callLinkInfo, GPRReg arg1)
1218 m_jit.setupArgumentsWithExecState(TrustedImmPtr(callLinkInfo), arg1);
1219 return appendCall(operation);
1222 JITCompiler::Call callOperation(V_JITOperation_EC operation, JSCell* arg1)
1224 m_jit.setupArgumentsWithExecState(TrustedImmPtr::weakPointer(m_jit.graph(), arg1));
1225 return appendCall(operation);
1228 JITCompiler::Call callOperation(V_JITOperation_ECIcf operation, GPRReg arg1, InlineCallFrame* inlineCallFrame)
1230 m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(inlineCallFrame));
1231 return appendCall(operation);
1233 JITCompiler::Call callOperation(V_JITOperation_ECCIcf operation, GPRReg arg1, GPRReg arg2, InlineCallFrame* inlineCallFrame)
1235 m_jit.setupArgumentsWithExecState(arg1, arg2, TrustedImmPtr(inlineCallFrame));
1236 return appendCall(operation);
1239 JITCompiler::Call callOperation(V_JITOperation_ECZ operation, GPRReg arg1, int arg2)
1241 m_jit.setupArgumentsWithExecState(arg1, TrustedImm32(arg2));
1242 return appendCall(operation);
1244 JITCompiler::Call callOperation(V_JITOperation_ECC operation, GPRReg arg1, GPRReg arg2)
1246 m_jit.setupArgumentsWithExecState(arg1, arg2);
1247 return appendCall(operation);
1249 JITCompiler::Call callOperation(V_JITOperation_ECC operation, GPRReg arg1, JSCell* arg2)
1251 m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr::weakPointer(m_jit.graph(), arg2));
1252 return appendCall(operation);
1254 JITCompiler::Call callOperation(V_JITOperation_ECC operation, JSCell* arg1, GPRReg arg2)
1256 m_jit.setupArgumentsWithExecState(TrustedImmPtr::weakPointer(m_jit.graph(), arg1), arg2);
1257 return appendCall(operation);
1260 JITCompiler::Call callOperationWithCallFrameRollbackOnException(V_JITOperation_ECb operation, void* pointer)
1262 m_jit.setupArgumentsWithExecState(TrustedImmPtr(pointer));
1263 return appendCallWithCallFrameRollbackOnException(operation);
1266 JITCompiler::Call callOperationWithCallFrameRollbackOnException(Z_JITOperation_E operation, GPRReg result)
1268 m_jit.setupArgumentsExecState();
1269 return appendCallWithCallFrameRollbackOnExceptionSetResult(operation, result);
1271 JITCompiler::Call callOperation(Z_JITOperation_EC operation, GPRReg result, GPRReg arg1)
1273 m_jit.setupArgumentsWithExecState(arg1);
1274 return appendCallSetResult(operation, result);
1277 JITCompiler::Call callOperation(V_JITOperation_ECIZC operation, GPRReg regOp1, UniquedStringImpl* identOp2, int32_t op3, GPRReg regOp4)
1279 m_jit.setupArgumentsWithExecState(regOp1, TrustedImmPtr(identOp2), TrustedImm32(op3), regOp4);
1280 return appendCall(operation);
1283 template<typename FunctionType, typename... Args>
1284 JITCompiler::Call callOperation(FunctionType operation, NoResultTag, Args... args)
1286 return callOperation(operation, args...);
1289 JITCompiler::Call callOperation(D_JITOperation_ZZ operation, FPRReg result, GPRReg arg1, GPRReg arg2)
1291 m_jit.setupArguments(arg1, arg2);
1292 return appendCallSetResult(operation, result);
1294 JITCompiler::Call callOperation(D_JITOperation_D operation, FPRReg result, FPRReg arg1)
1296 m_jit.setupArguments(arg1);
1297 return appendCallSetResult(operation, result);
1299 JITCompiler::Call callOperation(D_JITOperation_DD operation, FPRReg result, FPRReg arg1, FPRReg arg2)
1301 m_jit.setupArguments(arg1, arg2);
1302 return appendCallSetResult(operation, result);
1305 JITCompiler::Call callOperation(J_JITOperation_EJss operation, JSValueRegs result, GPRReg arg1)
1307 m_jit.setupArgumentsWithExecState(arg1);
1308 return appendCallSetResult(operation, result);
1311 JITCompiler::Call callOperation(T_JITOperation_EJss operation, GPRReg result, GPRReg arg1)
1313 m_jit.setupArgumentsWithExecState(arg1);
1314 return appendCallSetResult(operation, result);
1316 JITCompiler::Call callOperation(C_JITOperation_EJscZ operation, GPRReg result, GPRReg arg1, int32_t arg2)
1318 m_jit.setupArgumentsWithExecState(arg1, TrustedImm32(arg2));
1319 return appendCallSetResult(operation, result);
1321 JITCompiler::Call callOperation(C_JITOperation_EZ operation, GPRReg result, GPRReg arg1)
1323 m_jit.setupArgumentsWithExecState(arg1);
1324 return appendCallSetResult(operation, result);
1326 JITCompiler::Call callOperation(C_JITOperation_EZ operation, GPRReg result, int32_t arg1)
1328 m_jit.setupArgumentsWithExecState(TrustedImm32(arg1));
1329 return appendCallSetResult(operation, result);
1332 JITCompiler::Call callOperation(J_JITOperation_EJscC operation, GPRReg result, GPRReg arg1, JSCell* cell)
1334 m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr::weakPointer(m_jit.graph(), cell));
1335 return appendCallSetResult(operation, result);
1338 JITCompiler::Call callOperation(J_JITOperation_EJscCJ operation, GPRReg result, GPRReg arg1, JSCell* cell, GPRReg arg2)
1340 m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr::weakPointer(m_jit.graph(), cell), arg2);
1341 return appendCallSetResult(operation, result);
1344 JITCompiler::Call callOperation(J_JITOperation_EGReoJ operation, GPRReg result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
1346 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1347 return appendCallSetResult(operation, result);
1350 JITCompiler::Call callOperation(J_JITOperation_EGReoJss operation, GPRReg result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
1352 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1353 return appendCallSetResult(operation, result);
1356 JITCompiler::Call callOperation(V_JITOperation_EWs operation, WatchpointSet* watchpointSet)
1358 m_jit.setupArgumentsWithExecState(TrustedImmPtr(watchpointSet));
1359 return appendCall(operation);
1362 JITCompiler::Call callOperation(C_JITOperation_ERUiUi operation, GPRReg result, GPRReg arg1, Imm32 arg2, GPRReg arg3)
1364 m_jit.setupArgumentsWithExecState(arg1, arg2.asTrustedImm32(), arg3);
1365 return appendCallSetResult(operation, result);
1368 JITCompiler::Call callOperation(S_JITOperation_EO operation, GPRReg result, GPRReg arg1)
1370 m_jit.setupArgumentsWithExecState(arg1);
1371 return appendCallSetResult(operation, result);
1374 JITCompiler::Call callOperation(C_JITOperation_EJscI operation, GPRReg result, GPRReg arg1, UniquedStringImpl* impl)
1376 m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(impl));
1377 return appendCallSetResult(operation, result);
1380 JITCompiler::Call callOperation(P_JITOperation_EZZ operation, GPRReg result, GPRReg arg1, GPRReg arg2)
1382 m_jit.setupArgumentsWithExecState(arg1, arg2);
1383 return appendCallSetResult(operation, result);
1386 JITCompiler::Call callOperation(P_JITOperation_EZZ operation, GPRReg result, GPRReg arg1, TrustedImm32 arg2)
1388 m_jit.setupArgumentsWithExecState(arg1, arg2);
1389 return appendCallSetResult(operation, result);
1392 JITCompiler::Call callOperation(P_JITOperation_EDZ operation, GPRReg result, FPRReg arg1, GPRReg arg2)
1394 m_jit.setupArgumentsWithExecState(arg1, arg2);
1395 return appendCallSetResult(operation, result);
1398 JITCompiler::Call callOperation(P_JITOperation_EDZ operation, GPRReg result, FPRReg arg1, TrustedImm32 arg2)
1400 m_jit.setupArgumentsWithExecState(arg1, arg2);
1401 return appendCallSetResult(operation, result);
1404 JITCompiler::Call callOperation(V_JITOperation_EJ operation, JSValueRegs arg1)
1407 m_jit.setupArgumentsWithExecState(arg1.gpr());
1409 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR());
1411 return appendCall(operation);
1415 JITCompiler::Call callOperation(Z_JITOperation_EOJ operation, GPRReg result, GPRReg arg1, GPRReg arg2)
1417 m_jit.setupArgumentsWithExecState(arg1, arg2);
1418 return appendCallSetResult(operation, result);
1420 JITCompiler::Call callOperation(C_JITOperation_ECJZ operation, GPRReg result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
1422 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1423 return appendCallSetResult(operation, result);
1425 JITCompiler::Call callOperation(C_JITOperation_ECJ operation, GPRReg result, GPRReg arg1, JSValueRegs arg2)
1427 m_jit.setupArgumentsWithExecState(arg1, arg2.gpr());
1428 return appendCallSetResult(operation, result);
1430 JITCompiler::Call callOperation(C_JITOperation_ECO operation, GPRReg result, GPRReg arg1, GPRReg arg2)
1432 m_jit.setupArgumentsWithExecState(arg1, arg2);
1433 return appendCallSetResult(operation, result);
1435 JITCompiler::Call callOperation(J_JITOperation_EJMic operation, JSValueRegs result, JSValueRegs arg, TrustedImmPtr mathIC)
1437 m_jit.setupArgumentsWithExecState(arg.gpr(), mathIC);
1438 return appendCallSetResult(operation, result.gpr());
1440 JITCompiler::Call callOperation(J_JITOperation_EJJMic operation, JSValueRegs result, JSValueRegs arg1, JSValueRegs arg2, TrustedImmPtr mathIC)
1442 m_jit.setupArgumentsWithExecState(arg1.gpr(), arg2.gpr(), mathIC);
1443 return appendCallSetResult(operation, result.gpr());
1445 JITCompiler::Call callOperation(J_JITOperation_EJJI operation, GPRReg result, GPRReg arg1, GPRReg arg2, UniquedStringImpl* uid)
1447 m_jit.setupArgumentsWithExecState(arg1, arg2, TrustedImmPtr(uid));
1448 return appendCallSetResult(operation, result);
1450 JITCompiler::Call callOperation(J_JITOperation_EJscI operation, GPRReg result, GPRReg arg1, UniquedStringImpl* impl)
1452 m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(impl));
1453 return appendCallSetResult(operation, result);
1455 JITCompiler::Call callOperation(V_JITOperation_EJJJI operation, GPRReg arg1, GPRReg arg2, GPRReg arg3, UniquedStringImpl* uid)
1457 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3, TrustedImmPtr(uid));
1458 return appendCall(operation);
1460 JITCompiler::Call callOperation(V_JITOperation_EJJJJ operation, GPRReg arg1, GPRReg arg2, GPRReg arg3, GPRReg arg4)
1462 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3, arg4);
1463 return appendCall(operation);
1465 JITCompiler::Call callOperation(V_JITOperation_EOJJZ operation, GPRReg arg1, JSValueRegs arg2, JSValueRegs arg3, GPRReg arg4)
1467 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg3.payloadGPR(), arg4);
1468 return appendCall(operation);
1470 JITCompiler::Call callOperation(V_JITOperation_EOJssJZ operation, GPRReg arg1, GPRReg arg2, JSValueRegs arg3, GPRReg arg4)
1472 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3.payloadGPR(), arg4);
1473 return appendCall(operation);
1475 JITCompiler::Call callOperation(V_JITOperation_EOIJZ operation, GPRReg arg1, GPRReg arg2, JSValueRegs arg3, GPRReg arg4)
1477 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3.payloadGPR(), arg4);
1478 return appendCall(operation);
1480 JITCompiler::Call callOperation(V_JITOperation_EOSymJZ operation, GPRReg arg1, GPRReg arg2, JSValueRegs arg3, GPRReg arg4)
1482 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3.payloadGPR(), arg4);
1483 return appendCall(operation);
1485 JITCompiler::Call callOperation(V_JITOperation_EOJOOZ operation, GPRReg arg1, JSValueRegs arg2, GPRReg arg3, GPRReg arg4, GPRReg arg5)
1487 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg3, arg4, arg5);
1488 return appendCall(operation);
1490 JITCompiler::Call callOperation(V_JITOperation_EOJssOOZ operation, GPRReg arg1, GPRReg arg2, GPRReg arg3, GPRReg arg4, GPRReg arg5)
1492 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3, arg4, arg5);
1493 return appendCall(operation);
1495 JITCompiler::Call callOperation(V_JITOperation_EOIOOZ operation, GPRReg arg1, GPRReg arg2, GPRReg arg3, GPRReg arg4, GPRReg arg5)
1497 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3, arg4, arg5);
1498 return appendCall(operation);
1500 JITCompiler::Call callOperation(V_JITOperation_EOSymOOZ operation, GPRReg arg1, GPRReg arg2, GPRReg arg3, GPRReg arg4, GPRReg arg5)
1502 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3, arg4, arg5);
1503 return appendCall(operation);
1505 JITCompiler::Call callOperation(V_JITOperation_EOJIUi operation, GPRReg arg1, GPRReg arg2, UniquedStringImpl* impl, unsigned value)
1507 m_jit.setupArgumentsWithExecState(arg1, arg2, TrustedImmPtr(impl), TrustedImm32(value));
1508 return appendCall(operation);
1510 JITCompiler::Call callOperation(J_JITOperation_EOIUi operation, GPRReg result, GPRReg arg1, UniquedStringImpl* impl, unsigned value)
1512 m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(impl), TrustedImm32(value));
1513 return appendCallSetResult(operation, result);
1515 JITCompiler::Call callOperation(J_JITOperation_E operation, GPRReg result)
1517 m_jit.setupArgumentsExecState();
1518 return appendCallSetResult(operation, result);
1520 JITCompiler::Call callOperation(J_JITOperation_EP operation, GPRReg result, void* pointer)
1522 m_jit.setupArgumentsWithExecState(TrustedImmPtr(pointer));
1523 return appendCallSetResult(operation, result);
1525 JITCompiler::Call callOperation(Z_JITOperation_D operation, GPRReg result, FPRReg arg1)
1527 m_jit.setupArguments(arg1);
1528 JITCompiler::Call call = m_jit.appendCall(operation);
1529 m_jit.zeroExtend32ToPtr(GPRInfo::returnValueGPR, result);
1532 JITCompiler::Call callOperation(Q_JITOperation_J operation, GPRReg result, GPRReg value)
1534 m_jit.setupArguments(value);
1535 return appendCallSetResult(operation, result);
1537 JITCompiler::Call callOperation(Q_JITOperation_D operation, GPRReg result, FPRReg value)
1539 m_jit.setupArguments(value);
1540 return appendCallSetResult(operation, result);
1542 JITCompiler::Call callOperation(J_JITOperation_EI operation, GPRReg result, UniquedStringImpl* uid)
1544 m_jit.setupArgumentsWithExecState(TrustedImmPtr(uid));
1545 return appendCallSetResult(operation, result);
1547 JITCompiler::Call callOperation(J_JITOperation_EA operation, GPRReg result, GPRReg arg1)
1549 m_jit.setupArgumentsWithExecState(arg1);
1550 return appendCallSetResult(operation, result);
1552 JITCompiler::Call callOperation(J_JITOperation_EOZ operation, GPRReg result, GPRReg arg1, GPRReg arg2)
1554 m_jit.setupArgumentsWithExecState(arg1, arg2);
1555 return appendCallSetResult(operation, result);
1557 JITCompiler::Call callOperation(J_JITOperation_EJssReo operation, GPRReg result, GPRReg arg1, GPRReg arg2)
1559 m_jit.setupArgumentsWithExecState(arg1, arg2);
1560 return appendCallSetResult(operation, result);
1562 JITCompiler::Call callOperation(J_JITOperation_EJssReoJss operation, GPRReg result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
1564 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1565 return appendCallSetResult(operation, result);
1567 JITCompiler::Call callOperation(J_JITOperation_EJssZ operation, GPRReg result, GPRReg arg1, GPRReg arg2)
1569 m_jit.setupArgumentsWithExecState(arg1, arg2);
1570 return appendCallSetResult(operation, result);
1572 JITCompiler::Call callOperation(J_JITOperation_EPS operation, GPRReg result, void* pointer, size_t size)
1574 m_jit.setupArgumentsWithExecState(TrustedImmPtr(pointer), TrustedImmPtr(size));
1575 return appendCallSetResult(operation, result);
1577 JITCompiler::Call callOperation(J_JITOperation_ESS operation, GPRReg result, int startConstant, int numConstants)
1579 m_jit.setupArgumentsWithExecState(TrustedImm32(startConstant), TrustedImm32(numConstants));
1580 return appendCallSetResult(operation, result);
1582 JITCompiler::Call callOperation(J_JITOperation_EPP operation, GPRReg result, GPRReg arg1, void* pointer)
1584 m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(pointer));
1585 return appendCallSetResult(operation, result);
1587 JITCompiler::Call callOperation(J_JITOperation_EC operation, GPRReg result, JSCell* cell)
1589 m_jit.setupArgumentsWithExecState(TrustedImmPtr::weakPointer(m_jit.graph(), cell));
1590 return appendCallSetResult(operation, result);
1592 JITCompiler::Call callOperation(J_JITOperation_ECZ operation, GPRReg result, GPRReg arg1, GPRReg arg2)
1594 m_jit.setupArgumentsWithExecState(arg1, arg2);
1595 return appendCallSetResult(operation, result);
1597 JITCompiler::Call callOperation(J_JITOperation_ECZZ operation, GPRReg result, GPRReg arg1, GPRReg arg2, int32_t constant)
1599 m_jit.setupArgumentsWithExecState(arg1, arg2, TrustedImm32(constant));
1600 return appendCallSetResult(operation, result);
1602 JITCompiler::Call callOperation(J_JITOperation_ESsiCI operation, GPRReg result, StructureStubInfo* stubInfo, GPRReg arg1, const UniquedStringImpl* uid)
1604 m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1, TrustedImmPtr(uid));
1605 return appendCallSetResult(operation, result);
1607 JITCompiler::Call callOperation(J_JITOperation_ESsiJI operation, GPRReg result, StructureStubInfo* stubInfo, GPRReg arg1, UniquedStringImpl* uid)
1609 m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1, TrustedImmPtr(uid));
1610 return appendCallSetResult(operation, result);
1612 JITCompiler::Call callOperation(J_JITOperation_ESsiJJI operation, GPRReg result, StructureStubInfo* stubInfo, GPRReg arg1, GPRReg arg2, UniquedStringImpl* uid)
1614 m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1, arg2, TrustedImmPtr(uid));
1615 return appendCallSetResult(operation, result);
1617 JITCompiler::Call callOperation(J_JITOperation_EDA operation, GPRReg result, FPRReg arg1, GPRReg arg2)
1619 m_jit.setupArgumentsWithExecState(arg1, arg2);
1620 return appendCallSetResult(operation, result);
1622 JITCompiler::Call callOperation(J_JITOperation_EJC operation, GPRReg result, GPRReg arg1, GPRReg arg2)
1624 m_jit.setupArgumentsWithExecState(arg1, arg2);
1625 return appendCallSetResult(operation, result);
1627 JITCompiler::Call callOperation(J_JITOperation_EJZ operation, GPRReg result, GPRReg arg1, GPRReg arg2)
1629 m_jit.setupArgumentsWithExecState(arg1, arg2);
1630 return appendCallSetResult(operation, result);
1632 JITCompiler::Call callOperation(J_JITOperation_EJA operation, JSValueRegs result, JSValueRegs arg1, GPRReg arg2)
1634 m_jit.setupArgumentsWithExecState(arg1.gpr(), arg2);
1635 return appendCallSetResult(operation, result.payloadGPR());
1637 JITCompiler::Call callOperation(J_JITOperation_EJA operation, GPRReg result, JSValueRegs arg1, GPRReg arg2)
1639 m_jit.setupArgumentsWithExecState(arg1.gpr(), arg2);
1640 return appendCallSetResult(operation, result);
1642 JITCompiler::Call callOperation(J_JITOperation_EP operation, GPRReg result, GPRReg arg1)
1644 m_jit.setupArgumentsWithExecState(arg1);
1645 return appendCallSetResult(operation, result);
1647 JITCompiler::Call callOperation(J_JITOperation_EZ operation, GPRReg result, GPRReg arg1)
1649 m_jit.setupArgumentsWithExecState(arg1);
1650 return appendCallSetResult(operation, result);
1652 JITCompiler::Call callOperation(J_JITOperation_EZ operation, GPRReg result, int32_t arg1)
1654 m_jit.setupArgumentsWithExecState(TrustedImm32(arg1));
1655 return appendCallSetResult(operation, result);
1657 JITCompiler::Call callOperation(J_JITOperation_EZZ operation, GPRReg result, int32_t arg1, GPRReg arg2)
1659 m_jit.setupArgumentsWithExecState(TrustedImm32(arg1), arg2);
1660 return appendCallSetResult(operation, result);
1662 JITCompiler::Call callOperation(P_JITOperation_EQZ operation, GPRReg result, GPRReg arg1, GPRReg arg2)
1664 m_jit.setupArgumentsWithExecState(arg1, arg2);
1665 return appendCallSetResult(operation, result);
1667 JITCompiler::Call callOperation(P_JITOperation_EQZ operation, GPRReg result, GPRReg arg1, TrustedImm32 arg2)
1669 m_jit.setupArgumentsWithExecState(arg1, arg2);
1670 return appendCallSetResult(operation, result);
1673 JITCompiler::Call callOperation(J_JITOperation_EZIcfZ operation, GPRReg result, int32_t arg1, InlineCallFrame* inlineCallFrame, GPRReg arg2)
1675 m_jit.setupArgumentsWithExecState(TrustedImm32(arg1), TrustedImmPtr(inlineCallFrame), arg2);
1676 return appendCallSetResult(operation, result);
1679 JITCompiler::Call callOperation(P_JITOperation_EJS operation, GPRReg result, GPRReg value, size_t index)
1681 m_jit.setupArgumentsWithExecState(value, TrustedImmPtr(index));
1682 return appendCallSetResult(operation, result);
1685 JITCompiler::Call callOperation(P_JITOperation_EStJ operation, GPRReg result, RegisteredStructure structure, GPRReg arg2)
1687 m_jit.setupArgumentsWithExecState(TrustedImmPtr(structure), arg2);
1688 return appendCallSetResult(operation, result);
1691 JITCompiler::Call callOperation(C_JITOperation_EGJ operation, GPRReg result, TrustedImmPtr globalObject, GPRReg arg1)
1693 m_jit.setupArgumentsWithExecState(globalObject, arg1);
1694 return appendCallSetResult(operation, result);
1697 JITCompiler::Call callOperation(C_JITOperation_EGJ operation, GPRReg result, TrustedImmPtr globalObject, JSValueRegs arg1)
1699 return callOperation(operation, result, globalObject, arg1.gpr());
1702 JITCompiler::Call callOperation(C_JITOperation_EGJ operation, GPRReg result, JSGlobalObject* globalObject, GPRReg arg1)
1704 return callOperation(operation, result, TrustedImmPtr::weakPointer(m_jit.graph(), globalObject), arg1);
1707 JITCompiler::Call callOperation(C_JITOperation_EGJ operation, GPRReg result, JSGlobalObject* globalObject, JSValueRegs arg1)
1709 return callOperation(operation, result, globalObject, arg1.gpr());
1712 JITCompiler::Call callOperation(C_JITOperation_EGJI operation, GPRReg result, JSGlobalObject* globalObject, JSValueRegs arg1, UniquedStringImpl* arg2)
1714 m_jit.setupArgumentsWithExecState(TrustedImmPtr::weakPointer(m_jit.graph(), globalObject), arg1.gpr(), TrustedImmPtr(arg2));
1715 return appendCallSetResult(operation, result);
1718 JITCompiler::Call callOperation(C_JITOperation_EJ operation, GPRReg result, GPRReg arg1)
1720 m_jit.setupArgumentsWithExecState(arg1);
1721 return appendCallSetResult(operation, result);
1723 JITCompiler::Call callOperation(C_JITOperation_EJ operation, GPRReg result, JSValueRegs arg1)
1725 m_jit.setupArgumentsWithExecState(arg1.gpr());
1726 return appendCallSetResult(operation, result);
1728 JITCompiler::Call callOperation(C_JITOperation_EJJ operation, GPRReg result, GPRReg arg1, GPRReg arg2)
1730 m_jit.setupArgumentsWithExecState(arg1, arg2);
1731 return appendCallSetResult(operation, result);
1733 JITCompiler::Call callOperation(C_JITOperation_EJJC operation, GPRReg result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
1735 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1736 return appendCallSetResult(operation, result);
1738 JITCompiler::Call callOperation(C_JITOperation_EJJJ operation, GPRReg result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
1740 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1741 return appendCallSetResult(operation, result);
1743 JITCompiler::Call callOperation(C_JITOperation_EJZ operation, GPRReg result, GPRReg arg1, GPRReg arg2)
1745 m_jit.setupArgumentsWithExecState(arg1, arg2);
1746 return appendCallSetResult(operation, result);
1748 JITCompiler::Call callOperation(C_JITOperation_EJZC operation, GPRReg result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
1750 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1751 return appendCallSetResult(operation, result);
1753 JITCompiler::Call callOperation(S_JITOperation_J operation, GPRReg result, GPRReg arg1)
1755 m_jit.setupArguments(arg1);
1756 return appendCallSetResult(operation, result);
1758 JITCompiler::Call callOperation(S_JITOperation_EJ operation, GPRReg result, GPRReg arg1)
1760 m_jit.setupArgumentsWithExecState(arg1);
1761 return appendCallSetResult(operation, result);
1763 JITCompiler::Call callOperation(S_JITOperation_EJ operation, GPRReg result, JSValueRegs arg1)
1765 return callOperation(operation, result, arg1.gpr());
1767 JITCompiler::Call callOperation(J_JITOperation_EJ operation, JSValueRegs result, JSValueRegs arg1)
1769 return callOperation(operation, result.payloadGPR(), arg1.payloadGPR());
1771 JITCompiler::Call callOperation(J_JITOperation_EJ operation, GPRReg result, JSValueRegs arg1)
1773 return callOperation(operation, result, arg1.payloadGPR());
1775 JITCompiler::Call callOperation(J_JITOperation_EJ operation, GPRReg result, GPRReg arg1)
1777 m_jit.setupArgumentsWithExecState(arg1);
1778 return appendCallSetResult(operation, result);
1780 JITCompiler::Call callOperation(S_JITOperation_EJI operation, GPRReg result, GPRReg arg1, UniquedStringImpl* uid)
1782 m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(uid));
1783 return appendCallSetResult(operation, result);
1785 JITCompiler::Call callOperation(S_JITOperation_EJI operation, GPRReg result, JSValueRegs arg1, UniquedStringImpl* uid)
1787 return callOperation(operation, result, arg1.gpr(), uid);
1789 JITCompiler::Call callOperation(S_JITOperation_EJJ operation, GPRReg result, GPRReg arg1, GPRReg arg2)
1791 m_jit.setupArgumentsWithExecState(arg1, arg2);
1792 return appendCallSetResult(operation, result);
1794 JITCompiler::Call callOperation(S_JITOperation_EJJ operation, GPRReg result, JSValueRegs arg1, JSValueRegs arg2)
1796 return callOperation(operation, result, arg1.gpr(), arg2.gpr());
1798 JITCompiler::Call callOperation(S_JITOperation_EGJJ operation, GPRReg result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
1800 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1801 return appendCallSetResult(operation, result);
1803 JITCompiler::Call callOperation(S_JITOperation_EGReoJ operation, GPRReg result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
1805 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1806 return appendCallSetResult(operation, result);
1808 JITCompiler::Call callOperation(S_JITOperation_EGReoJss operation, GPRReg result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
1810 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1811 return appendCallSetResult(operation, result);
1814 JITCompiler::Call callOperation(J_JITOperation_EPP operation, GPRReg result, GPRReg arg1, GPRReg arg2)
1816 m_jit.setupArgumentsWithExecState(arg1, arg2);
1817 return appendCallSetResult(operation, result);
1819 JITCompiler::Call callOperation(J_JITOperation_EPPP operation, GPRReg result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
1821 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1822 return appendCallSetResult(operation, result);
1824 JITCompiler::Call callOperation(J_JITOperation_EGP operation, GPRReg result, GPRReg arg1, GPRReg arg2)
1826 m_jit.setupArgumentsWithExecState(arg1, arg2);
1827 return appendCallSetResult(operation, result);
1829 JITCompiler::Call callOperation(J_JITOperation_EAPZ operation, JSValueRegs result, GPRReg arg1, GPRReg arg2, TrustedImm32 arg3)
1831 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1832 return appendCallSetResult(operation, result.payloadGPR());
1834 JITCompiler::Call callOperation(J_JITOperation_EAPZ operation, GPRReg result, GPRReg arg1, GPRReg arg2, TrustedImm32 arg3)
1836 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1837 return appendCallSetResult(operation, result);
1839 JITCompiler::Call callOperation(J_JITOperation_EJJ operation, GPRReg result, GPRReg arg1, GPRReg arg2)
1841 m_jit.setupArgumentsWithExecState(arg1, arg2);
1842 return appendCallSetResult(operation, result);
1844 JITCompiler::Call callOperation(J_JITOperation_EGJJ operation, GPRReg result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
1846 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1847 return appendCallSetResult(operation, result);
1849 JITCompiler::Call callOperation(J_JITOperation_EJJ operation, GPRReg result, GPRReg arg1, int32_t imm)
1851 m_jit.setupArgumentsWithExecState(arg1, MacroAssembler::TrustedImm64(JSValue::encode(jsNumber(imm))));
1852 return appendCallSetResult(operation, result);
1854 JITCompiler::Call callOperation(J_JITOperation_EJJ operation, GPRReg result, int32_t imm, GPRReg arg2)
1856 m_jit.setupArgumentsWithExecState(MacroAssembler::TrustedImm64(JSValue::encode(jsNumber(imm))), arg2);
1857 return appendCallSetResult(operation, result);
1859 JITCompiler::Call callOperation(J_JITOperation_EJJ operation, JSValueRegs result, JSValueRegs arg1, JSValueRegs arg2)
1861 return callOperation(operation, result.payloadGPR(), arg1.payloadGPR(), arg2.payloadGPR());
1863 JITCompiler::Call callOperation(J_JITOperation_EJJJ operation, GPRReg result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
1865 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1866 return appendCallSetResult(operation, result);
1868 JITCompiler::Call callOperation(J_JITOperation_EJJJJ operation, GPRReg result, GPRReg arg1, GPRReg arg2, GPRReg arg3, GPRReg arg4)
1870 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3, arg4);
1871 return appendCallSetResult(operation, result);
1873 JITCompiler::Call callOperation(J_JITOperation_ECC operation, GPRReg result, GPRReg arg1, GPRReg arg2)
1875 m_jit.setupArgumentsWithExecState(arg1, arg2);
1876 return appendCallSetResult(operation, result);
1878 JITCompiler::Call callOperation(J_JITOperation_ECCZ operation, JSValueRegs result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
1880 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1881 return appendCallSetResult(operation, result.payloadGPR());
1883 JITCompiler::Call callOperation(J_JITOperation_ECJ operation, GPRReg result, GPRReg arg1, GPRReg arg2)
1885 m_jit.setupArgumentsWithExecState(arg1, arg2);
1886 return appendCallSetResult(operation, result);
1888 JITCompiler::Call callOperation(J_JITOperation_ECJ operation, GPRReg result, GPRReg arg1, JSValueRegs arg2)
1890 m_jit.setupArgumentsWithExecState(arg1, arg2.gpr());
1891 return appendCallSetResult(operation, result);
1894 JITCompiler::Call callOperation(V_JITOperation_EOZD operation, GPRReg arg1, GPRReg arg2, FPRReg arg3)
1896 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1897 return appendCall(operation);
1899 JITCompiler::Call callOperation(V_JITOperation_EJ operation, GPRReg arg1)
1901 m_jit.setupArgumentsWithExecState(arg1);
1902 return appendCall(operation);
1904 JITCompiler::Call callOperation(V_JITOperation_EJPP operation, GPRReg arg1, GPRReg arg2, void* pointer)
1906 m_jit.setupArgumentsWithExecState(arg1, arg2, TrustedImmPtr(pointer));
1907 return appendCall(operation);
1909 JITCompiler::Call callOperation(V_JITOperation_ESsiJJI operation, StructureStubInfo* stubInfo, GPRReg arg1, GPRReg arg2, UniquedStringImpl* uid)
1911 m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1, arg2, TrustedImmPtr(uid));
1912 return appendCall(operation);
1914 JITCompiler::Call callOperation(V_JITOperation_EJJJ operation, GPRReg arg1, GPRReg arg2, GPRReg arg3)
1916 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1917 return appendCall(operation);
1919 JITCompiler::Call callOperation(V_JITOperation_EPZJ operation, GPRReg arg1, GPRReg arg2, GPRReg arg3)
1921 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1922 return appendCall(operation);
1925 JITCompiler::Call callOperation(V_JITOperation_EOZJ operation, GPRReg arg1, GPRReg arg2, GPRReg arg3)
1927 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1928 return appendCall(operation);
1930 JITCompiler::Call callOperation(V_JITOperation_ECJ operation, GPRReg arg1, JSValueRegs arg2)
1932 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR());
1933 return appendCall(operation);
1935 JITCompiler::Call callOperation(V_JITOperation_ECJZ operation, GPRReg arg1, JSValueRegs arg2, GPRReg arg3)
1937 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg3);
1938 return appendCall(operation);
1940 JITCompiler::Call callOperation(V_JITOperation_ECJJ operation, GPRReg arg1, GPRReg arg2, GPRReg arg3)
1942 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1943 return appendCall(operation);
1945 JITCompiler::Call callOperation(V_JITOperation_ECJJZ operation, GPRReg arg1, JSValueRegs arg2, JSValueRegs arg3, GPRReg arg4)
1947 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg3.payloadGPR(), arg4);
1948 return appendCall(operation);
1950 JITCompiler::Call callOperation(V_JITOperation_ECCJ operation, GPRReg arg1, GPRReg arg2, JSValueRegs arg3)
1952 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3.payloadGPR());
1953 return appendCall(operation);
1956 JITCompiler::Call callOperation(Z_JITOperation_EJ operation, GPRReg result, JSValueRegs arg1)
1958 m_jit.setupArgumentsWithExecState(arg1.payloadGPR());
1959 return appendCallSetResult(operation, result);
1962 JITCompiler::Call callOperation(Z_JITOperation_EJZZ operation, GPRReg result, GPRReg arg1, unsigned arg2, unsigned arg3)
1964 m_jit.setupArgumentsWithExecState(arg1, TrustedImm32(arg2), TrustedImm32(arg3));
1965 return appendCallSetResult(operation, result);
1967 JITCompiler::Call callOperation(F_JITOperation_EFJZZ operation, GPRReg result, GPRReg arg1, GPRReg arg2, unsigned arg3, GPRReg arg4)
1969 m_jit.setupArgumentsWithExecState(arg1, arg2, TrustedImm32(arg3), arg4);
1970 return appendCallSetResult(operation, result);
1973 JITCompiler::Call callOperation(Z_JITOperation_EJOJ operation, GPRReg result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
1975 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1976 return appendCallSetResult(operation, result);
1978 JITCompiler::Call callOperation(Z_JITOperation_EJOJ operation, GPRReg result, JSValueRegs arg1, GPRReg arg2, JSValueRegs arg3)
1980 return callOperation(operation, result, arg1.payloadGPR(), arg2, arg3.payloadGPR());
1983 JITCompiler::Call callOperation(Z_JITOperation_EJZ operation, GPRReg result, GPRReg arg1, unsigned arg2)
1985 m_jit.setupArgumentsWithExecState(arg1, TrustedImm32(arg2));
1986 return appendCallSetResult(operation, result);
1988 JITCompiler::Call callOperation(Z_JITOperation_EBJZ operation, GPRReg result, GPRReg arg1, JSValueRegs arg2, GPRReg arg3)
1990 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg3);
1991 return appendCallSetResult(operation, result);
1993 JITCompiler::Call callOperation(V_JITOperation_EZJZZZ operation, unsigned arg1, GPRReg arg2, unsigned arg3, GPRReg arg4, unsigned arg5)
1995 m_jit.setupArgumentsWithExecState(TrustedImm32(arg1), arg2, TrustedImm32(arg3), arg4, TrustedImm32(arg5));
1996 return appendCall(operation);
1998 JITCompiler::Call callOperation(V_JITOperation_ECJZC operation, GPRReg regOp1, GPRReg regOp2, int32_t op3, GPRReg regOp4)
2000 m_jit.setupArgumentsWithExecState(regOp1, regOp2, TrustedImm32(op3), regOp4);
2001 return appendCall(operation);
2003 JITCompiler::Call callOperation(V_JITOperation_ECIZJJ operation, GPRReg regOp1, UniquedStringImpl* identOp2, int32_t op3, GPRReg regOp4, GPRReg regOp5)
2005 m_jit.setupArgumentsWithExecState(regOp1, TrustedImmPtr(identOp2), TrustedImm32(op3), regOp4, regOp5);
2006 return appendCall(operation);
2008 JITCompiler::Call callOperation(D_JITOperation_EJ operation, FPRReg result, JSValueRegs arg1)
2010 m_jit.setupArgumentsWithExecState(arg1.gpr());
2011 return appendCallSetResult(operation, result);
2014 JITCompiler::Call callCustomGetter(J_JITOperation_EJI function, JSValueRegs result, GPRReg arg1, UniquedStringImpl* uid)
2016 m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(uid));
2017 m_jit.storePtr(GPRInfo::callFrameRegister, &m_jit.vm()->topCallFrame);
2018 m_jit.emitStoreCodeOrigin(m_currentNode->origin.semantic);
2019 JITCompiler::Call call = m_jit.appendCall(function);
2020 if (result.payloadGPR() != InvalidGPRReg)
2021 m_jit.move(GPRInfo::returnValueGPR, result.payloadGPR());
2024 #else // USE(JSVALUE32_64)
2025 JITCompiler::Call callOperation(Z_JITOperation_EOJ operation, GPRReg result, GPRReg arg1, JSValueRegs arg2)
2027 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR());
2028 return appendCallSetResult(operation, result);
2030 JITCompiler::Call callOperation(C_JITOperation_ECJZ operation, GPRReg result, GPRReg arg1, JSValueRegs arg2, GPRReg arg3)
2032 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR(), arg3);
2033 return appendCallSetResult(operation, result);
2035 JITCompiler::Call callOperation(C_JITOperation_ECJ operation, GPRReg result, GPRReg arg1, JSValueRegs arg2)
2037 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR());
2038 return appendCallSetResult(operation, result);
2040 JITCompiler::Call callOperation(C_JITOperation_ECO operation, GPRReg result, GPRReg arg1, GPRReg arg2)
2042 m_jit.setupArgumentsWithExecState(arg1, arg2);
2043 return appendCallSetResult(operation, result);
2045 JITCompiler::Call callOperation(J_JITOperation_EJMic operation, JSValueRegs result, JSValueRegs arg, TrustedImmPtr mathIC)
2047 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg.payloadGPR(), arg.tagGPR(), mathIC);
2048 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2050 JITCompiler::Call callOperation(J_JITOperation_EJZ operation, JSValueRegs result, JSValueRegs arg1, GPRReg arg2)
2052 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2);
2053 return appendCallSetResult(operation, result);
2055 JITCompiler::Call callOperation(J_JITOperation_EJJMic operation, JSValueRegs result, JSValueRegs arg1, JSValueRegs arg2, TrustedImmPtr mathIC)
2057 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2.payloadGPR(), arg2.tagGPR(), mathIC);
2058 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2061 JITCompiler::Call callOperation(J_JITOperation_EJJI operation, JSValueRegs result, JSValueRegs arg1, JSValueRegs arg2, UniquedStringImpl* uid)
2063 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2.payloadGPR(), arg2.tagGPR(), TrustedImmPtr(uid));
2064 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2066 JITCompiler::Call callOperation(V_JITOperation_EJJJI operation, JSValueRegs arg1, JSValueRegs arg2, JSValueRegs arg3, UniquedStringImpl* uid)
2068 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2.payloadGPR(), arg2.tagGPR(), arg3.payloadGPR(), arg3.tagGPR(), TrustedImmPtr(uid));
2069 return appendCall(operation);
2071 JITCompiler::Call callOperation(V_JITOperation_EJJJJ operation, JSValueRegs arg1, JSValueRegs arg2, JSValueRegs arg3, JSValueRegs arg4)
2073 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2.payloadGPR(), arg2.tagGPR(), arg3.payloadGPR(), arg3.tagGPR(), arg4.payloadGPR(), arg4.tagGPR());
2074 return appendCall(operation);
2076 JITCompiler::Call callOperation(J_JITOperation_EJscI operation, JSValueRegs result, GPRReg arg1, UniquedStringImpl* impl)
2078 m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(impl));
2079 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2081 JITCompiler::Call callOperation(V_JITOperation_EOJJZ operation, GPRReg arg1, JSValueRegs arg2, JSValueRegs arg3, GPRReg arg4)
2083 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR(), arg3.payloadGPR(), arg3.tagGPR(), arg4);
2084 return appendCall(operation);
2086 JITCompiler::Call callOperation(V_JITOperation_EOJssJZ operation, GPRReg arg1, GPRReg arg2, JSValueRegs arg3, GPRReg arg4)
2088 m_jit.setupArgumentsWithExecState(arg1, arg2, EABI_32BIT_DUMMY_ARG arg3.payloadGPR(), arg3.tagGPR(), arg4);
2089 return appendCall(operation);
2091 JITCompiler::Call callOperation(V_JITOperation_EOIJZ operation, GPRReg arg1, GPRReg arg2, JSValueRegs arg3, GPRReg arg4)
2093 m_jit.setupArgumentsWithExecState(arg1, arg2, EABI_32BIT_DUMMY_ARG arg3.payloadGPR(), arg3.tagGPR(), arg4);
2094 return appendCall(operation);
2096 JITCompiler::Call callOperation(V_JITOperation_EOSymJZ operation, GPRReg arg1, GPRReg arg2, JSValueRegs arg3, GPRReg arg4)
2098 m_jit.setupArgumentsWithExecState(arg1, arg2, EABI_32BIT_DUMMY_ARG arg3.payloadGPR(), arg3.tagGPR(), arg4);
2099 return appendCall(operation);
2101 JITCompiler::Call callOperation(V_JITOperation_EOJOOZ operation, GPRReg arg1, JSValueRegs arg2, GPRReg arg3, GPRReg arg4, GPRReg arg5)
2103 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR(), arg3, arg4, arg5);
2104 return appendCall(operation);
2106 JITCompiler::Call callOperation(V_JITOperation_EOJssOOZ operation, GPRReg arg1, GPRReg arg2, GPRReg arg3, GPRReg arg4, GPRReg arg5)
2108 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3, arg4, arg5);
2109 return appendCall(operation);
2111 JITCompiler::Call callOperation(V_JITOperation_EOIOOZ operation, GPRReg arg1, GPRReg arg2, GPRReg arg3, GPRReg arg4, GPRReg arg5)
2113 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3, arg4, arg5);
2114 return appendCall(operation);
2116 JITCompiler::Call callOperation(V_JITOperation_EOSymOOZ operation, GPRReg arg1, GPRReg arg2, GPRReg arg3, GPRReg arg4, GPRReg arg5)
2118 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3, arg4, arg5);
2119 return appendCall(operation);
2121 JITCompiler::Call callOperation(V_JITOperation_EOJIUi operation, GPRReg arg1, JSValueRegs arg2, UniquedStringImpl* impl, unsigned value)
2123 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR(), TrustedImmPtr(impl), TrustedImm32(value));
2124 return appendCall(operation);
2126 JITCompiler::Call callOperation(J_JITOperation_EOIUi operation, JSValueRegs result, GPRReg arg1, UniquedStringImpl* impl, unsigned value)
2128 m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(impl), TrustedImm32(value));
2129 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2131 JITCompiler::Call callOperation(D_JITOperation_G operation, FPRReg result, JSGlobalObject* globalObject)
2133 m_jit.setupArguments(TrustedImmPtr::weakPointer(m_jit.graph(), globalObject));
2134 return appendCallSetResult(operation, result);
2136 JITCompiler::Call callOperation(Z_JITOperation_D operation, GPRReg result, FPRReg arg1)
2138 prepareForExternalCall();
2139 m_jit.setupArguments(arg1);
2140 JITCompiler::Call call = m_jit.appendCall(operation);
2141 m_jit.zeroExtend32ToPtr(GPRInfo::returnValueGPR, result);
2144 JITCompiler::Call callOperation(J_JITOperation_E operation, JSValueRegs result)
2146 m_jit.setupArgumentsExecState();
2147 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2149 JITCompiler::Call callOperation(J_JITOperation_EP operation, JSValueRegs result, void* pointer)
2151 m_jit.setupArgumentsWithExecState(TrustedImmPtr(pointer));
2152 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2154 JITCompiler::Call callOperation(J_JITOperation_EPP operation, JSValueRegs result, GPRReg arg1, void* pointer)
2156 m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(pointer));
2157 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2159 JITCompiler::Call callOperation(J_JITOperation_EPP operation, JSValueRegs result, GPRReg arg1, GPRReg arg2)
2161 m_jit.setupArgumentsWithExecState(arg1, arg2);
2162 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2164 JITCompiler::Call callOperation(J_JITOperation_EPPP operation, JSValueRegs result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
2166 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
2167 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2169 JITCompiler::Call callOperation(J_JITOperation_EGP operation, JSValueRegs result, GPRReg arg1, GPRReg arg2)
2171 m_jit.setupArgumentsWithExecState(arg1, arg2);
2172 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2174 JITCompiler::Call callOperation(J_JITOperation_EAPZ operation, JSValueRegs result, GPRReg arg1, GPRReg arg2, TrustedImm32 arg3)
2176 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
2177 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2179 JITCompiler::Call callOperation(J_JITOperation_EP operation, JSValueRegs result, GPRReg arg1)
2181 m_jit.setupArgumentsWithExecState(arg1);
2182 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2184 JITCompiler::Call callOperation(J_JITOperation_EI operation, JSValueRegs result, UniquedStringImpl* uid)
2186 m_jit.setupArgumentsWithExecState(TrustedImmPtr(uid));
2187 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2189 JITCompiler::Call callOperation(J_JITOperation_EA operation, JSValueRegs result, GPRReg arg1)
2191 m_jit.setupArgumentsWithExecState(arg1);
2192 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2194 JITCompiler::Call callOperation(J_JITOperation_EOZ operation, JSValueRegs result, GPRReg arg1, GPRReg arg2)
2196 m_jit.setupArgumentsWithExecState(arg1, arg2);
2197 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2199 JITCompiler::Call callOperation(J_JITOperation_EJ operation, JSValueRegs result, GPRReg arg1)
2201 m_jit.setupArgumentsWithExecState(arg1);
2202 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2204 JITCompiler::Call callOperation(J_JITOperation_EJC operation, JSValueRegs result, JSValueRegs arg1, GPRReg arg2)
2206 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2);
2207 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2209 JITCompiler::Call callOperation(J_JITOperation_EJssZ operation, JSValueRegs result, GPRReg arg1, GPRReg arg2)
2211 m_jit.setupArgumentsWithExecState(arg1, arg2);
2212 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2214 JITCompiler::Call callOperation(J_JITOperation_EJssReo operation, JSValueRegs result, GPRReg arg1, GPRReg arg2)
2216 m_jit.setupArgumentsWithExecState(arg1, arg2);
2217 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2219 JITCompiler::Call callOperation(J_JITOperation_EJssReoJss operation, JSValueRegs result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
2221 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
2222 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2224 JITCompiler::Call callOperation(J_JITOperation_EPS operation, JSValueRegs result, void* pointer, size_t size)
2226 m_jit.setupArgumentsWithExecState(TrustedImmPtr(pointer), TrustedImmPtr(size));
2227 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2229 JITCompiler::Call callOperation(J_JITOperation_ESS operation, JSValueRegs result, int startConstant, int numConstants)
2231 m_jit.setupArgumentsWithExecState(TrustedImm32(startConstant), TrustedImm32(numConstants));
2232 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2234 JITCompiler::Call callOperation(J_JITOperation_EJP operation, JSValueRegs result, JSValueRegs arg1, void* pointer)
2236 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), TrustedImmPtr(pointer));
2237 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2239 JITCompiler::Call callOperation(J_JITOperation_EJP operation, JSValueRegs result, JSValueRegs arg1, GPRReg arg2)
2241 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2);
2242 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2245 JITCompiler::Call callOperation(J_JITOperation_EC operation, JSValueRegs result, JSCell* cell)
2247 m_jit.setupArgumentsWithExecState(TrustedImmPtr::weakPointer(m_jit.graph(), cell));
2248 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2250 JITCompiler::Call callOperation(J_JITOperation_ECZ operation, JSValueRegs result, GPRReg arg1, GPRReg arg2)
2252 m_jit.setupArgumentsWithExecState(arg1, arg2);
2253 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2255 JITCompiler::Call callOperation(J_JITOperation_ECZZ operation, JSValueRegs result, GPRReg arg1, GPRReg arg2, int32_t constant)
2257 m_jit.setupArgumentsWithExecState(arg1, arg2, TrustedImm32(constant));
2258 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2260 JITCompiler::Call callOperation(J_JITOperation_EJscC operation, JSValueRegs result, GPRReg arg1, JSCell* cell)
2262 m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr::weakPointer(m_jit.graph(), cell));
2263 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2265 JITCompiler::Call callOperation(J_JITOperation_EJscCJ operation, GPRReg result, GPRReg arg1, JSCell* cell, JSValueRegs arg2)
2267 m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr::weakPointer(m_jit.graph(), cell), EABI_32BIT_DUMMY_ARG arg2.payloadGPR(), arg2.tagGPR());
2268 return appendCallSetResult(operation, result);
2270 JITCompiler::Call callOperation(J_JITOperation_EGReoJ operation, JSValueRegs result, GPRReg arg1, GPRReg arg2, JSValueRegs arg3)
2272 m_jit.setupArgumentsWithExecState(arg1, arg2, EABI_32BIT_DUMMY_ARG arg3.payloadGPR(), arg3.tagGPR());
2273 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2275 JITCompiler::Call callOperation(J_JITOperation_EGReoJss operation, JSValueRegs result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
2277 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
2278 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2280 JITCompiler::Call callOperation(J_JITOperation_ESsiCI operation, JSValueRegs result, StructureStubInfo* stubInfo, GPRReg arg1, const UniquedStringImpl* uid)
2282 m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1, TrustedImmPtr(uid));
2283 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2285 JITCompiler::Call callOperation(J_JITOperation_ESsiJI operation, JSValueRegs result, StructureStubInfo* stubInfo, JSValueRegs arg1, UniquedStringImpl* uid)
2287 m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1.payloadGPR(), arg1.tagGPR(), TrustedImmPtr(uid));
2288 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2290 JITCompiler::Call callOperation(J_JITOperation_ESsiJJI operation, JSValueRegs result, StructureStubInfo* stubInfo, JSValueRegs arg1, JSValueRegs arg2, UniquedStringImpl* uid)
2292 m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1.payloadGPR(), arg1.tagGPR(), arg2.payloadGPR(), arg2.tagGPR(), TrustedImmPtr(uid));
2293 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2295 JITCompiler::Call callOperation(J_JITOperation_ESsiJJI operation, JSValueRegs result, StructureStubInfo* stubInfo, int32_t arg1Tag, GPRReg arg1Payload, GPRReg arg2Tag, GPRReg arg2Payload, UniquedStringImpl* uid)
2297 m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1Payload, TrustedImm32(arg1Tag), arg2Payload, arg2Tag, TrustedImmPtr(uid));
2298 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2300 JITCompiler::Call callOperation(J_JITOperation_ESsiJI operation, JSValueRegs result, StructureStubInfo* stubInfo, int32_t arg1Tag, GPRReg arg1Payload, UniquedStringImpl* uid)
2302 m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1Payload, TrustedImm32(arg1Tag), TrustedImmPtr(uid));
2303 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2305 JITCompiler::Call callOperation(J_JITOperation_ESsiJJI operation, JSValueRegs result, StructureStubInfo* stubInfo, int32_t arg1Tag, GPRReg arg1Payload, int32_t arg2Tag, GPRReg arg2Payload, UniquedStringImpl* uid)
2307 m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1Payload, TrustedImm32(arg1Tag), arg2Payload, TrustedImm32(arg2Tag), TrustedImmPtr(uid));
2308 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2310 JITCompiler::Call callOperation(J_JITOperation_ESsiJI operation, JSValueRegs result, StructureStubInfo* stubInfo, GPRReg arg1Tag, GPRReg arg1Payload, UniquedStringImpl* uid)
2312 m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1Payload, arg1Tag, TrustedImmPtr(uid));
2313 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2315 JITCompiler::Call callOperation(J_JITOperation_EDA operation, JSValueRegs result, FPRReg arg1, GPRReg arg2)
2317 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1, arg2);
2318 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2320 JITCompiler::Call callOperation(J_JITOperation_EJA operation, JSValueRegs result, JSValueRegs arg1, GPRReg arg2)
2322 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2);
2323 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2325 JITCompiler::Call callOperation(J_JITOperation_EJA operation, JSValueRegs result, TrustedImm32 arg1Tag, GPRReg arg1Payload, GPRReg arg2)
2327 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1Payload, arg1Tag, arg2);
2328 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2330 JITCompiler::Call callOperation(J_JITOperation_EJA operation, JSValueRegs result, GPRReg arg1Tag, GPRReg arg1Payload, GPRReg arg2)
2332 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1Payload, arg1Tag, arg2);
2333 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2335 JITCompiler::Call callOperation(J_JITOperation_EJ operation, JSValueRegs result, JSValueRegs arg1)
2337 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR());
2338 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2340 JITCompiler::Call callOperation(J_JITOperation_EZ operation, JSValueRegs result, GPRReg arg1)
2342 m_jit.setupArgumentsWithExecState(arg1);
2343 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2345 JITCompiler::Call callOperation(J_JITOperation_EZ operation, JSValueRegs result, int32_t arg1)
2347 m_jit.setupArgumentsWithExecState(TrustedImm32(arg1));
2348 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2350 JITCompiler::Call callOperation(J_JITOperation_EZIcfZ operation, JSValueRegs result, int32_t arg1, InlineCallFrame* inlineCallFrame, GPRReg arg2)
2352 m_jit.setupArgumentsWithExecState(TrustedImm32(arg1), TrustedImmPtr(inlineCallFrame), arg2);
2353 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2355 JITCompiler::Call callOperation(J_JITOperation_EZZ operation, JSValueRegs result, int32_t arg1, GPRReg arg2)
2357 m_jit.setupArgumentsWithExecState(TrustedImm32(arg1), arg2);
2358 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2361 JITCompiler::Call callOperation(P_JITOperation_EJS operation, GPRReg result, JSValueRegs value, size_t index)
2363 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG value.payloadGPR(), value.tagGPR(), TrustedImmPtr(index));
2364 return appendCallSetResult(operation, result);
2367 JITCompiler::Call callOperation(P_JITOperation_EStJ operation, GPRReg result, RegisteredStructure structure, JSValueRegs arg2)
2369 m_jit.setupArgumentsWithExecState(TrustedImmPtr(structure), arg2.payloadGPR(), arg2.tagGPR());
2370 return appendCallSetResult(operation, result);
2373 JITCompiler::Call callOperation(C_JITOperation_EGJ operation, GPRReg result, TrustedImmPtr globalObject, JSValueRegs arg1)
2375 m_jit.setupArgumentsWithExecState(globalObject, arg1.payloadGPR(), arg1.tagGPR());
2376 return appendCallSetResult(operation, result);
2379 JITCompiler::Call callOperation(C_JITOperation_EGJ operation, GPRReg result, JSGlobalObject* globalObject, JSValueRegs arg1)
2381 m_jit.setupArgumentsWithExecState(TrustedImmPtr::weakPointer(m_jit.graph(), globalObject), arg1.payloadGPR(), arg1.tagGPR());
2382 return appendCallSetResult(operation, result);
2385 JITCompiler::Call callOperation(C_JITOperation_EGJI operation, GPRReg result, JSGlobalObject* globalObject, JSValueRegs arg1, UniquedStringImpl* arg2)
2387 m_jit.setupArgumentsWithExecState(TrustedImmPtr::weakPointer(m_jit.graph(), globalObject), arg1.payloadGPR(), arg1.tagGPR(), TrustedImmPtr(arg2));
2388 return appendCallSetResult(operation, result);
2391 JITCompiler::Call callOperation(C_JITOperation_EJ operation, GPRReg result, JSValueRegs arg1)
2393 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR());
2394 return appendCallSetResult(operation, result);
2397 JITCompiler::Call callOperation(C_JITOperation_EJJ operation, GPRReg result, JSValueRegs arg1, JSValueRegs arg2)
2399 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2.payloadGPR(), arg2.tagGPR());
2400 return appendCallSetResult(operation, result);
2403 JITCompiler::Call callOperation(C_JITOperation_EJJJ operation, GPRReg result, JSValueRegs arg1, JSValueRegs arg2, JSValueRegs arg3)
2405 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2.payloadGPR(), arg2.tagGPR(), arg3.payloadGPR(), arg3.tagGPR());
2406 return appendCallSetResult(operation, result);
2409 JITCompiler::Call callOperation(S_JITOperation_EJ operation, GPRReg result, JSValueRegs arg1)
2411 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR());
2412 return appendCallSetResult(operation, result);
2415 JITCompiler::Call callOperation(S_JITOperation_EJI operation, GPRReg result, JSValueRegs arg1, UniquedStringImpl* uid)
2417 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), TrustedImmPtr(uid));
2418 return appendCallSetResult(operation, result);
2421 JITCompiler::Call callOperation(S_JITOperation_EJJ operation, GPRReg result, JSValueRegs arg1, JSValueRegs arg2)
2423 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2.payloadGPR(), arg2.tagGPR());
2424 return appendCallSetResult(operation, result);
2427 JITCompiler::Call callOperation(S_JITOperation_EGJJ operation, GPRReg result, GPRReg arg1, JSValueRegs arg2, JSValueRegs arg3)
2429 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR(), arg3.payloadGPR(), arg3.tagGPR());
2430 return appendCallSetResult(operation, result);
2432 JITCompiler::Call callOperation(S_JITOperation_EGReoJ operation, GPRReg result, GPRReg arg1, GPRReg arg2, JSValueRegs arg3)
2434 m_jit.setupArgumentsWithExecState(arg1, arg2, EABI_32BIT_DUMMY_ARG arg3.payloadGPR(), arg3.tagGPR());
2435 return appendCallSetResult(operation, result);
2437 JITCompiler::Call callOperation(S_JITOperation_EGReoJss operation, GPRReg result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
2439 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
2440 return appendCallSetResult(operation, result);
2442 JITCompiler::Call callOperation(J_JITOperation_EJJ operation, JSValueRegs result, JSValueRegs arg1, JSValueRegs arg2)
2444 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2.payloadGPR(), arg2.tagGPR());
2445 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2447 JITCompiler::Call callOperation(J_JITOperation_EGJJ operation, JSValueRegs result, GPRReg arg1, JSValueRegs arg2, JSValueRegs arg3)
2449 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR(), arg3.payloadGPR(), arg3.tagGPR());
2450 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2452 JITCompiler::Call callOperation(J_JITOperation_EJJ operation, JSValueRegs result, JSValueRegs arg1, MacroAssembler::TrustedImm32 imm)
2454 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), imm, TrustedImm32(JSValue::Int32Tag));
2455 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2457 JITCompiler::Call callOperation(J_JITOperation_EJJ operation, JSValueRegs result, MacroAssembler::TrustedImm32 imm, JSValueRegs arg2)
2459 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG imm, TrustedImm32(JSValue::Int32Tag), arg2.payloadGPR(), arg2.tagGPR());
2460 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2462 JITCompiler::Call callOperation(J_JITOperation_EJJJ operation, JSValueRegs result, JSValueRegs arg1, JSValueRegs arg2, JSValueRegs arg3)
2464 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2.payloadGPR(), arg2.tagGPR(), arg3.payloadGPR(), arg3.tagGPR());
2465 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2468 JITCompiler::Call callOperation(J_JITOperation_ECJ operation, JSValueRegs result, GPRReg arg1, JSValueRegs arg2)
2470 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR());
2471 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2473 JITCompiler::Call callOperation(J_JITOperation_ECJ operation, JSValueRegs result, GPRReg arg1, GPRReg arg2Payload)
2475 m_jit.setupArgumentsWithExecState(arg1, arg2Payload, MacroAssembler::TrustedImm32(JSValue::CellTag));
2476 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2478 JITCompiler::Call callOperation(J_JITOperation_ECC operation, JSValueRegs result, GPRReg arg1, GPRReg arg2)
2480 m_jit.setupArgumentsWithExecState(arg1, arg2);
2481 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2483 JITCompiler::Call callOperation(J_JITOperation_ECCZ operation, JSValueRegs result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
2485 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
2486 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2489 JITCompiler::Call callOperation(V_JITOperation_EOZD operation, GPRReg arg1, GPRReg arg2, FPRReg arg3)
2491 m_jit.setupArgumentsWithExecState(arg1, arg2, EABI_32BIT_DUMMY_ARG arg3);
2492 return appendCall(operation);
2495 JITCompiler::Call callOperation(V_JITOperation_EJPP operation, JSValueRegs arg1, GPRReg arg2, void* pointer)
2497 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2, TrustedImmPtr(pointer));
2498 return appendCall(operation);
2500 JITCompiler::Call callOperation(V_JITOperation_ESsiJJI operation, StructureStubInfo* stubInfo, JSValueRegs arg1, GPRReg arg2Payload, UniquedStringImpl* uid)
2502 m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1.payloadGPR(), arg1.tagGPR(), arg2Payload, TrustedImm32(JSValue::CellTag), TrustedImmPtr(uid));
2503 return appendCall(operation);
2505 JITCompiler::Call callOperation(V_JITOperation_ECJ operation, GPRReg arg1, JSValueRegs arg2)
2507 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR());
2508 return appendCall(operation);
2510 JITCompiler::Call callOperation(V_JITOperation_ECJJ operation, GPRReg arg1, JSValueRegs arg2, JSValueRegs arg3)
2512 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR(), arg3.payloadGPR(), arg3.tagGPR());
2513 return appendCall(operation);
2515 JITCompiler::Call callOperation(V_JITOperation_ECJZ operation, GPRReg arg1, JSValueRegs arg2, GPRReg arg3)
2517 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR(), arg3);
2518 return appendCall(operation);
2520 JITCompiler::Call callOperation(V_JITOperation_ECJJZ operation, GPRReg arg1, JSValueRegs arg2, JSValueRegs arg3, GPRReg arg4)
2522 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR(), arg3.payloadGPR(), arg3.tagGPR(), arg4);
2523 return appendCall(operation);
2525 JITCompiler::Call callOperation(V_JITOperation_ECCJ operation, GPRReg arg1, GPRReg arg2, JSValueRegs arg3)
2527 m_jit.setupArgumentsWithExecState(arg1, arg2, EABI_32BIT_DUMMY_ARG arg3.payloadGPR(), arg3.tagGPR());
2528 return appendCall(operation);
2531 JITCompiler::Call callOperation(V_JITOperation_EPZJ operation, GPRReg arg1, GPRReg arg2, JSValueRegs arg3)
2533 m_jit.setupArgumentsWithExecState(arg1, arg2, EABI_32BIT_DUMMY_ARG arg3.payloadGPR(), arg3.tagGPR());
2534 return appendCall(operation);
2537 JITCompiler::Call callOperation(V_JITOperation_EOZJ operation, GPRReg arg1, GPRReg arg2, JSValueRegs arg3)
2539 m_jit.setupArgumentsWithExecState(arg1, arg2, EABI_32BIT_DUMMY_ARG arg3.payloadGPR(), arg3.tagGPR());
2540 return appendCall(operation);
2542 JITCompiler::Call callOperation(V_JITOperation_EOZJ operation, GPRReg arg1, GPRReg arg2, TrustedImm32 arg3Tag, GPRReg arg3Payload)
2544 m_jit.setupArgumentsWithExecState(arg1, arg2, EABI_32BIT_DUMMY_ARG arg3Payload, arg3Tag);
2545 return appendCall(operation);
2547 JITCompiler::Call callOperation(V_JITOperation_EOZJ operation, GPRReg arg1, GPRReg arg2, GPRReg arg3Tag, GPRReg arg3Payload)
2549 m_jit.setupArgumentsWithExecState(arg1, arg2, EABI_32BIT_DUMMY_ARG arg3Payload, arg3Tag);
2550 return appendCall(operation);
2553 JITCompiler::Call callOperation(Z_JITOperation_EJOJ operation, GPRReg result, JSValueRegs arg1, GPRReg arg2, JSValueRegs arg3)
2555 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2, EABI_32BIT_DUMMY_ARG arg3.payloadGPR(), arg3.tagGPR());
2556 return appendCallSetResult(operation, result);
2558 JITCompiler::Call callOperation(Z_JITOperation_EJ operation, GPRReg result, JSValueRegs arg1)
2560 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR());
2561 return appendCallSetResult(operation, result);
2563 JITCompiler::Call callOperation(Z_JITOperation_EJZZ operation, GPRReg result, JSValueRegs arg1, unsigned arg2, unsigned arg3)
2565 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), TrustedImm32(arg2), TrustedImm32(arg3));
2566 return appendCallSetResult(operation, result);
2568 JITCompiler::Call callOperation(F_JITOperation_EFJZZ operation, GPRReg result, GPRReg arg1, JSValueRegs arg2, unsigned arg3, GPRReg arg4)
2570 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR(), TrustedImm32(arg3), arg4);
2571 return appendCallSetResult(operation, result);
2573 JITCompiler::Call callOperation(Z_JITOperation_EJZ operation, GPRReg result, JSValueRegs arg1, unsigned arg2)
2575 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), TrustedImm32(arg2));
2576 return appendCallSetResult(operation, result);
2578 JITCompiler::Call callOperation(Z_JITOperation_EBJZ operation, GPRReg result, GPRReg arg1, JSValueRegs arg2, GPRReg arg3)
2580 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR(), arg3);
2581 return appendCallSetResult(operation, result);
2583 JITCompiler::Call callOperation(V_JITOperation_EZJZZZ operation, unsigned arg1, JSValueRegs arg2, unsigned arg3, GPRReg arg4, unsigned arg5)
2585 m_jit.setupArgumentsWithExecState(TrustedImm32(arg1), arg2.payloadGPR(), arg2.tagGPR(), TrustedImm32(arg3), arg4, TrustedImm32(arg5));
2586 return appendCall(operation);
2588 JITCompiler::Call callOperation(V_JITOperation_ECJZC operation, GPRReg arg1, JSValueRegs arg2, int32_t arg3, GPRReg arg4)
2590 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR(), TrustedImm32(arg3), arg4);
2591 return appendCall(operation);
2593 JITCompiler::Call callOperation(V_JITOperation_ECIZCC operation, GPRReg arg1, UniquedStringImpl* identOp2, int32_t op3, GPRReg arg4, GPRReg arg5)
2595 m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(identOp2), TrustedImm32(op3), arg4, arg5);
2596 return appendCall(operation);
2598 JITCompiler::Call callOperation(D_JITOperation_EJ operation, FPRReg result, JSValueRegs arg1)
2600 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR());
2601 return appendCallSetResult(operation, result);
2604 JITCompiler::Call callCustomGetter(J_JITOperation_EJI function, JSValueRegs result, TrustedImm32 arg1Tag, GPRReg arg1Payload, UniquedStringImpl* uid)
2606 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1Payload, arg1Tag, TrustedImmPtr(uid));
2607 m_jit.storePtr(GPRInfo::callFrameRegister, &m_jit.vm()->topCallFrame);
2608 m_jit.emitStoreCodeOrigin(m_currentNode->origin.semantic);
2609 JITCompiler::Call call = m_jit.appendCall(function);
2610 m_jit.setupResults(result.payloadGPR(), result.tagGPR());
2613 #endif // USE(JSVALUE32_64)
2615 #if !defined(NDEBUG) && !CPU(ARM) && !CPU(MIPS)
2616 void prepareForExternalCall()
2618 // We're about to call out to a "native" helper function. The helper
2619 // function is expected to set topCallFrame itself with the ExecState
2620 // that is passed to it.
2622 // We explicitly trash topCallFrame here so that we'll know if some of
2623 // the helper functions are not setting topCallFrame when they should
2624 // be doing so. Note: the previous value in topcallFrame was not valid
2625 // anyway since it was not being updated by JIT'ed code by design.
2627 for (unsigned i = 0; i < sizeof(void*) / 4; i++)
2628 m_jit.store32(TrustedImm32(0xbadbeef), reinterpret_cast<char*>(&m_jit.vm()->topCallFrame) + i * 4);
2631 void prepareForExternalCall() { }
2634 // These methods add call instructions, optionally setting results, and optionally rolling back the call frame on an exception.
2635 JITCompiler::Call appendCall(const FunctionPtr& function)
2637 prepareForExternalCall();
2638 m_jit.emitStoreCodeOrigin(m_currentNode->origin.semantic);
2639 return m_jit.appendCall(function);
2641 JITCompiler::Call appendCallWithCallFrameRollbackOnException(const FunctionPtr& function)
2643 JITCompiler::Call call = appendCall(function);
2644 m_jit.exceptionCheckWithCallFrameRollback();
2647 JITCompiler::Call appendCallWithCallFrameRollbackOnExceptionSetResult(const FunctionPtr& function, GPRReg result)
2649 JITCompiler::Call call = appendCallWithCallFrameRollbackOnException(function);
2650 if ((result != InvalidGPRReg) && (result != GPRInfo::returnValueGPR))
2651 m_jit.move(GPRInfo::returnValueGPR, result);
2654 JITCompiler::Call appendCallSetResult(const FunctionPtr& function, GPRReg result)
2656 JITCompiler::Call call = appendCall(function);
2657 if (result != InvalidGPRReg)
2658 m_jit.move(GPRInfo::returnValueGPR, result);
2661 JITCompiler::Call appendCallSetResult(const FunctionPtr& function, GPRReg result1, GPRReg result2)
2663 JITCompiler::Call call = appendCall(function);
2664 m_jit.setupResults(result1, result2);
2667 JITCompiler::Call appendCallSetResult(const FunctionPtr& function, JSValueRegs resultRegs)
2670 return appendCallSetResult(function, resultRegs.gpr());
2672 return appendCallSetResult(function, resultRegs.payloadGPR(), resultRegs.tagGPR());
2676 JITCompiler::Call appendCallSetResult(const FunctionPtr& function, FPRReg result)
2678 JITCompiler::Call call = appendCall(function);
2679 if (result != InvalidFPRReg) {
2680 m_jit.assembler().fstpl(0, JITCompiler::stackPointerRegister);
2681 m_jit.loadDouble(JITCompiler::stackPointerRegister, result);
2685 #elif CPU(ARM) && !CPU(ARM_HARDFP)
2686 JITCompiler::Call appendCallSetResult(const FunctionPtr& function, FPRReg result)
2688 JITCompiler::Call call = appendCall(function);
2689 if (result != InvalidFPRReg)
2690 m_jit.assembler().vmov(result, GPRInfo::returnValueGPR, GPRInfo::returnValueGPR2);
2693 #else // CPU(X86_64) || (CPU(ARM) && CPU(ARM_HARDFP)) || CPU(ARM64) || CPU(MIPS)
2694 JITCompiler::Call appendCallSetResult(const FunctionPtr& function, FPRReg result)
2696 JITCompiler::Call call = appendCall(function);
2697 if (result != InvalidFPRReg)
2698 m_jit.moveDouble(FPRInfo::returnValueFPR, result);
2703 void branchDouble(JITCompiler::DoubleCondition cond, FPRReg left, FPRReg right, BasicBlock* destination)
2705 return addBranch(m_jit.branchDouble(cond, left, right), destination);
2708 void branchDoubleNonZero(FPRReg value, FPRReg scratch, BasicBlock* destination)
2710 return addBranch(m_jit.branchDoubleNonZero(value, scratch), destination);
2713 template<typename T, typename U>
2714 void branch32(JITCompiler::RelationalCondition cond, T left, U right, BasicBlock* destination)
2716 return addBranch(m_jit.branch32(cond, left, right), destination);
2719 template<typename T, typename U>
2720 void branchTest32(JITCompiler::ResultCondition cond, T value, U mask, BasicBlock* destination)
2722 return addBranch(m_jit.branchTest32(cond, value, mask), destination);
2725 template<typename T>
2726 void branchTest32(JITCompiler::ResultCondition cond, T value, BasicBlock* destination)
2728 return addBranch(m_jit.branchTest32(cond, value), destination);
2732 template<typename T, typename U>
2733 void branch64(JITCompiler::RelationalCondition cond, T left, U right, BasicBlock* destination)
2735 return addBranch(m_jit.branch64(cond, left, right), destination);
2739 template<typename T, typename U>
2740 void branch8(JITCompiler::RelationalCondition cond, T left, U right, BasicBlock* destination)
2742 return addBranch(m_jit.branch8(cond, left, right), destination);
2745 template<typename T, typename U>
2746 void branchPtr(JITCompiler::RelationalCondition cond, T left, U right, BasicBlock* destination)
2748 return addBranch(m_jit.branchPtr(cond, left, right), destination);
2751 template<typename T, typename U>
2752 void branchTestPtr(JITCompiler::ResultCondition cond, T value, U mask, BasicBlock* destination)
2754 return addBranch(m_jit.branchTestPtr(cond, value, mask), destination);
2757 template<typename T>
2758 void branchTestPtr(JITCompiler::ResultCondition cond, T value, BasicBlock* destination)
2760 return addBranch(m_jit.branchTestPtr(cond, value), destination);
2763 template<typename T, typename U>
2764 void branchTest8(JITCompiler::ResultCondition cond, T value, U mask, BasicBlock* destination)
2766 return addBranch(m_jit.branchTest8(cond, value, mask), destination);
2769 template<typename T>
2770 void branchTest8(JITCompiler::ResultCondition cond, T value, BasicBlock* destination)
2772 return addBranch(m_jit.branchTest8(cond, value), destination);
2775 enum FallThroughMode {
2779 void jump(BasicBlock* destination, FallThroughMode fallThroughMode = AtFallThroughPoint)
2781 if (destination == nextBlock()
2782 && fallThroughMode == AtFallThroughPoint)
2784 addBranch(m_jit.jump(), destination);
2787 void addBranch(const MacroAssembler::Jump& jump, BasicBlock* destination)
2789 m_branches.append(BranchRecord(jump, destination));
2791 void addBranch(const MacroAssembler::JumpList& jump, BasicBlock* destination);
2793 void linkBranches();
2795 void dump(const char* label = 0);
2797 bool betterUseStrictInt52(Node* node)
2799 return !generationInfo(node).isInt52();
2801 bool betterUseStrictInt52(Edge edge)
2803 return betterUseStrictInt52(edge.node());
2806 bool compare(Node*, MacroAssembler::RelationalCondition, MacroAssembler::DoubleCondition, S_JITOperation_EJJ);
2807 void compileCompareUnsigned(Node*, MacroAssembler::RelationalCondition);
2808 bool compilePeepHoleBranch(Node*, MacroAssembler::RelationalCondition, MacroAssembler::DoubleCondition, S_JITOperation_EJJ);
2809 void compilePeepHoleInt32Branch(Node*, Node* branchNode, JITCompiler::RelationalCondition);
2810 void compilePeepHoleInt52Branch(Node*, Node* branchNode, JITCompiler::RelationalCondition);
2811 void compilePeepHoleBooleanBranch(Node*, Node* branchNode, JITCompiler::RelationalCondition);
2812 void compilePeepHoleDoubleBranch(Node*, Node* branchNode, JITCompiler::DoubleCondition);
2813 void compilePeepHoleObjectEquality(Node*, Node* branchNode);
2814 void compilePeepHoleObjectStrictEquality(Edge objectChild, Edge otherChild, Node* branchNode);
2815 void compilePeepHoleObjectToObjectOrOtherEquality(Edge leftChild, Edge rightChild, Node* branchNode);
2816 void compileObjectEquality(Node*);
2817 void compileObjectStrictEquality(Edge objectChild, Edge otherChild);
2818 void compileObjectToObjectOrOtherEquality(Edge leftChild, Edge rightChild);
2819 void compileObjectOrOtherLogicalNot(Edge value);
2820 void compileLogicalNot(Node*);
2821 void compileLogicalNotStringOrOther(Node*);
2822 void compileStringEquality(
2823 Node*, GPRReg leftGPR, GPRReg rightGPR, GPRReg lengthGPR,
2824 GPRReg leftTempGPR, GPRReg rightTempGPR, GPRReg leftTemp2GPR,
2825 GPRReg rightTemp2GPR, JITCompiler::JumpList fastTrue,
2826 JITCompiler::JumpList fastSlow);
2827 void compileStringEquality(Node*);
2828 void compileStringIdentEquality(Node*);
2829 void compileStringToUntypedEquality(Node*, Edge stringEdge, Edge untypedEdge);
2830 void compileStringIdentToNotStringVarEquality(Node*, Edge stringEdge, Edge notStringVarEdge);
2831 void compileStringZeroLength(Node*);
2832 void compileMiscStrictEq(Node*);
2834 void compileSymbolEquality(Node*);
2835 void compilePeepHoleSymbolEquality(Node*, Node* branchNode);
2836 void compileSymbolUntypedEquality(Node*, Edge symbolEdge, Edge untypedEdge);
2838 void emitObjectOrOtherBranch(Edge value, BasicBlock* taken, BasicBlock* notTaken);
2839 void emitStringBranch(Edge value, BasicBlock* taken, BasicBlock* notTaken);
2840 void emitStringOrOtherBranch(Edge value, BasicBlock* taken, BasicBlock* notTaken);
2841 void emitBranch(Node*);
2843 struct StringSwitchCase {
2844 StringSwitchCase() { }
2846 StringSwitchCase(StringImpl* string, BasicBlock* target)
2852 bool operator<(const StringSwitchCase& other) const
2854 return stringLessThan(*string, *other.string);
2861 void emitSwitchIntJump(SwitchData*, GPRReg value, GPRReg scratch);
2862 void emitSwitchImm(Node*, SwitchData*);
2863 void emitSwitchCharStringJump(SwitchData*, GPRReg value, GPRReg scratch);
2864 void emitSwitchChar(Node*, SwitchData*);
2865 void emitBinarySwitchStringRecurse(
2866 SwitchData*, const Vector<StringSwitchCase>&, unsigned numChecked,
2867 unsigned begin, unsigned end, GPRReg buffer, GPRReg length, GPRReg temp,
2868 unsigned alreadyCheckedLength, bool checkedExactLength);
2869 void emitSwitchStringOnString(SwitchData*, GPRReg string);
2870 void emitSwitchString(Node*, SwitchData*);
2871 void emitSwitch(Node*);
2873 void compileToStringOrCallStringConstructor(Node*);
2874 void compileNumberToStringWithRadix(Node*);
2875 void compileNumberToStringWithValidRadixConstant(Node*);
2876 void compileNumberToStringWithValidRadixConstant(Node*, int32_t radix);
2877 void compileNewStringObject(Node*);
2879 void compileNewTypedArray(Node*);
2881 void compileInt32Compare(Node*, MacroAssembler::RelationalCondition);
2882 void compileInt52Compare(Node*, MacroAssembler::RelationalCondition);
2883 void compileBooleanCompare(Node*, MacroAssembler::RelationalCondition);
2884 void compileDoubleCompare(Node*, MacroAssembler::DoubleCondition);
2885 void compileStringCompare(Node*, MacroAssembler::RelationalCondition);
2886 void compileStringIdentCompare(Node*, MacroAssembler::RelationalCondition);
2888 bool compileStrictEq(Node*);
2890 void compileAllocatePropertyStorage(Node*);
2891 void compileReallocatePropertyStorage(Node*);
2892 void compileNukeStructureAndSetButterfly(Node*);
2893 void compileGetButterfly(Node*);
2894 void compileCallDOMGetter(Node*);
2895 void compileCallDOM(Node*);
2896 void compileCheckSubClass(Node*);
2897 void compileGetMapBucketHead(Node*);
2898 void compileGetMapBucketNext(Node*);
2899 void compileSetAdd(Node*);
2900 void compileMapSet(Node*);
2901 void compileWeakMapGet(Node*);
2902 void compileLoadKeyFromMapBucket(Node*);
2903 void compileLoadValueFromMapBucket(Node*);
2904 void compileGetPrototypeOf(Node*);
2906 #if USE(JSVALUE32_64)
2907 template<typename BaseOperandType, typename PropertyOperandType, typename ValueOperandType, typename TagType>
2908 void compileContiguousPutByVal(Node*, BaseOperandType&, PropertyOperandType&, ValueOperandType&, GPRReg valuePayloadReg, TagType valueTag);
2910 void compileDoublePutByVal(Node*, SpeculateCellOperand& base, SpeculateStrictInt32Operand& property);
2911 bool putByValWillNeedExtraRegister(ArrayMode arrayMode)
2913 return arrayMode.mayStoreToHole();
2915 GPRReg temporaryRegisterForPutByVal(GPRTemporary&, ArrayMode);
2916 GPRReg temporaryRegisterForPutByVal(GPRTemporary& temporary, Node* node)
2918 return temporaryRegisterForPutByVal(temporary, node->arrayMode());
2921 void compileGetCharCodeAt(Node*);
2922 void compileGetByValOnString(Node*);
2923 void compileFromCharCode(Node*);
2925 void compileGetByValOnDirectArguments(Node*);
2926 void compileGetByValOnScopedArguments(Node*);
2928 void compileGetScope(Node*);
2929 void compileSkipScope(Node*);
2930 void compileGetGlobalObject(Node*);
2931 void compileGetGlobalThis(Node*);
2933 void compileGetArrayLength(Node*);
2935 void compileCheckTypeInfoFlags(Node*);
2936 void compileCheckStringIdent(Node*);
2938 void compileParseInt(Node*);
2940 void compileValueRep(Node*);
2941 void compileDoubleRep(Node*);
2943 void compileValueToInt32(Node*);
2944 void compileUInt32ToNumber(Node*);
2945 void compileDoubleAsInt32(Node*);
2947 template<typename SnippetGenerator, J_JITOperation_EJJ slowPathFunction>
2948 void emitUntypedBitOp(Node*);
2949 void compileBitwiseOp(Node*);
2951 void emitUntypedRightShiftBitOp(Node*);
2952 void compileShiftOp(Node*);
2954 template <typename Generator, typename RepatchingFunction, typename NonRepatchingFunction>
2955 void compileMathIC(Node*, JITBinaryMathIC<Generator>*, bool needsScratchGPRReg, bool needsScratchFPRReg, RepatchingFunction, NonRepatchingFunction);
2956 template <typename Generator, typename RepatchingFunction, typename NonRepatchingFunction>
2957 void compileMathIC(Node*, JITUnaryMathIC<Generator>*, bool needsScratchGPRReg, RepatchingFunction, NonRepatchingFunction);
2959 void compileArithDoubleUnaryOp(Node*, double (*doubleFunction)(double), double (*operation)(ExecState*, EncodedJSValue));
2960 void compileValueAdd(Node*);
2961 void compileArithAdd(Node*);
2962 void compileMakeRope(Node*);
2963 void compileArithAbs(Node*);
2964 void compileArithClz32(Node*);
2965 void compileArithSub(Node*);
2966 void compileArithNegate(Node*);
2967 void compileArithMul(Node*);
2968 void compileArithDiv(Node*);
2969 void compileArithFRound(Node*);
2970 void compileArithMod(Node*);
2971 void compileArithPow(Node*);
2972 void compileArithRounding(Node*);
2973 void compileArithRandom(Node*);
2974 void compileArithUnary(Node*);
2975 void compileArithSqrt(Node*);
2976 void compileConstantStoragePointer(Node*);
2977 void compileGetIndexedPropertyStorage(Node*);
2978 JITCompiler::Jump jumpForTypedArrayOutOfBounds(Node*, GPRReg baseGPR, GPRReg indexGPR);
2979 JITCompiler::Jump jumpForTypedArrayIsNeuteredIfOutOfBounds(Node*, GPRReg baseGPR, JITCompiler::Jump outOfBounds);
2980 void emitTypedArrayBoundsCheck(Node*, GPRReg baseGPR, GPRReg indexGPR);
2981 void compileGetTypedArrayByteOffset(Node*);
2982 void compileGetByValOnIntTypedArray(Node*, TypedArrayType);
2983 void compilePutByValForIntTypedArray(GPRReg base, GPRReg property, Node*, TypedArrayType);
2984 void compileGetByValOnFloatTypedArray(Node*, TypedArrayType);
2985 void compilePutByValForFloatTypedArray(GPRReg base, GPRReg property, Node*, TypedArrayType);
2986 void compileGetByValForObjectWithString(Node*);
2987 void compileGetByValForObjectWithSymbol(Node*);
2988 void compilePutByValForCellWithString(Node*, Edge& child1, Edge& child2, Edge& child3);
2989 void compilePutByValForCellWithSymbol(Node*, Edge& child1, Edge& child2, Edge& child3);
2990 // If this returns false it means that we terminated speculative execution.
2991 bool getIntTypedArrayStoreOperand(
2992 GPRTemporary& value,
2994 #if USE(JSVALUE32_64)
2995 GPRTemporary& propertyTag,
2996 GPRTemporary& valueTag,
2998 Edge valueUse, JITCompiler::JumpList& slowPathCases, bool isClamped = false);
2999 void loadFromIntTypedArray(GPRReg storageReg, GPRReg propertyReg, GPRReg resultReg, TypedArrayType);
3000 void setIntTypedArrayLoadResult(Node*, GPRReg resultReg, TypedArrayType, bool canSpeculate = false);
3001 template <typename ClassType> void compileNewFunctionCommon(GPRReg, RegisteredStructure, GPRReg, GPRReg, GPRReg, MacroAssembler::JumpList&, size_t, FunctionExecutable*, ptrdiff_t, ptrdiff_t, ptrdiff_t);
3002 void compileNewFunction(Node*);
3003 void compileSetFunctionName(Node*);
3004 void compileForwardVarargs(Node*);
3005 void compileCreateActivation(Node*);
3006 void compileCreateDirectArguments(Node*);
3007 void compileGetFromArguments(Node*);
3008 void compilePutToArguments(Node*);
3009 void compileGetArgument(Node*);
3010 void compileCreateScopedArguments(Node*);
3011 void compileCreateClonedArguments(Node*);
3012 void compileCreateRest(Node*);
3013 void compileSpread(Node*);
3014 void compileNewArrayWithSpread(Node*);
3015 void compileGetRestLength(Node*);
3016 void compileArraySlice(Node*);
3017 void compileArrayIndexOf(Node*);
3018 void compileArrayPush(Node*);
3019 void compileNotifyWrite(Node*);
3020 bool compileRegExpExec(Node*);
3021 void compileIsObjectOrNull(Node*);
3022 void compileIsFunction(Node*);
3023 void compileTypeOf(Node*);
3024 void compileCheckStructure(Node*);
3025 void emitStructureCheck(Node*, GPRReg cellGPR, GPRReg tempGPR);
3026 void compilePutAccessorById(Node*);
3027 void compilePutGetterSetterById(Node*);
3028 void compilePutAccessorByVal(Node*);
3029 void compileGetRegExpObjectLastIndex(Node*);
3030 void compileSetRegExpObjectLastIndex(Node*);
3031 void compileLazyJSConstant(Node*);
3032 void compileMaterializeNewObject(Node*);
3033 void compileRecordRegExpCachedResult(Node*);
3034 void compileToObjectOrCallObjectConstructor(Node*);
3035 void compileResolveScope(Node*);
3036 void compileResolveScopeForHoistingFuncDeclInEval(Node*);
3037 void compileGetDynamicVar(Node*);
3038 void compilePutDynamicVar(Node*);
3039 void compileCompareEqPtr(Node*);
3040 void compileDefineDataProperty(Node*);
3041 void compileDefineAccessorProperty(Node*);
3042 void compileStringSlice(Node*);
3043 void compileToLowerCase(Node*);
3044 void compileThrow(Node*);
3045 void compileThrowStaticError(Node*);
3047 void moveTrueTo(GPRReg);
3048 void moveFalseTo(GPRReg);
3049 void blessBoolean(GPRReg);
3051 // Allocator for a cell of a specific size.
3052 template <typename StructureType> // StructureType can be GPR or ImmPtr.
3053 void emitAllocateJSCell(
3054 GPRReg resultGPR, MarkedAllocator* allocator, GPRReg allocatorGPR, StructureType structure,
3055 GPRReg scratchGPR, MacroAssembler::JumpList& slowPath)
3057 m_jit.emitAllocateJSCell(resultGPR, allocator, allocatorGPR, structure, scratchGPR, slowPath);
3060 // Allocator for an object of a specific size.
3061 template <typename StructureType, typename StorageType> // StructureType and StorageType can be GPR or ImmPtr.
3062 void emitAllocateJSObject(
3063 GPRReg resultGPR, MarkedAllocator* allocator, GPRReg allocatorGPR, StructureType structure,
3064 StorageType storage, GPRReg scratchGPR, MacroAssembler::JumpList& slowPath)
3066 m_jit.emitAllocateJSObject(
3067 resultGPR, allocator, allocatorGPR, structure, storage, scratchGPR, slowPath);
3070 template <typename ClassType, typename StructureType, typename StorageType> // StructureType and StorageType can be GPR or ImmPtr.
3071 void emitAllocateJSObjectWithKnownSize(
3072 GPRReg resultGPR, StructureType structure, StorageType storage, GPRReg scratchGPR1,
3073 GPRReg scratchGPR2, MacroAssembler::JumpList& slowPath, size_t size)
3075 m_jit.emitAllocateJSObjectWithKnownSize<ClassType>(*m_jit.vm(), resultGPR, structure, storage, scratchGPR1, scratchGPR2, slowPath, size);
3078 // Convenience allocator for a built-in object.
3079 template <typename ClassType, typename StructureType, typename StorageType> // StructureType and StorageType can be GPR or ImmPtr.
3080 void emitAllocateJSObject(GPRReg resultGPR, StructureType structure, StorageType storage,
3081 GPRReg scratchGPR1, GPRReg scratchGPR2, MacroAssembler::JumpList& slowPath)
3083 m_jit.emitAllocateJSObject<ClassType>(*m_jit.vm(), resultGPR, structure, storage, scratchGPR1, scratchGPR2, slowPath);
3086 template <typename ClassType, typename StructureType> // StructureType and StorageType can be GPR or ImmPtr.
3087 void emitAllocateVariableSizedJSObject(GPRReg resultGPR, StructureType structure, GPRReg allocationSize, GPRReg scratchGPR1, GPRReg scratchGPR2, MacroAssembler::JumpList& slowPath)
3089 m_jit.emitAllocateVariableSizedJSObject<ClassType>(*m_jit.vm(), resultGPR, structure, allocationSize, scratchGPR1, scratchGPR2, slowPath);
3092 template<typename ClassType>
3093 void emitAllocateDestructibleObject(GPRReg resultGPR, RegisteredStructure structure,
3094 GPRReg scratchGPR1, GPRReg scratchGPR2, MacroAssembler::JumpList& slowPath)
3096 m_jit.emitAllocateDestructibleObject<ClassType>(*m_jit.vm(), resultGPR, structure.get(), scratchGPR1, scratchGPR2, slowPath);
3099 void emitAllocateRawObject(GPRReg resultGPR, RegisteredStructure, GPRReg storageGPR, unsigned numElements, unsigned vectorLength);
3101 void emitGetLength(InlineCallFrame*, GPRReg lengthGPR, bool includeThis = false);
3102 void emitGetLength(CodeOrigin, GPRReg lengthGPR, bool includeThis = false);
3103 void emitGetCallee(CodeOrigin, GPRReg calleeGPR);
3104 void emitGetArgumentStart(CodeOrigin, GPRReg startGPR);
3105 void emitPopulateSliceIndex(Edge&, GPRReg length, GPRReg result);
3107 // Generate an OSR exit fuzz check. Returns Jump() if OSR exit fuzz is not enabled, or if
3108 // it's in training mode.
3109 MacroAssembler::Jump emitOSRExitFuzzCheck();
3111 // Add a speculation check.
3112 void speculationCheck(ExitKind, JSValueSource, Node*, MacroAssembler::Jump jumpToFail);
3113 void speculationCheck(ExitKind, JSValueSource, Node*, const MacroAssembler::JumpList& jumpsToFail);
3115 // Add a speculation check without additional recovery, and with a promise to supply a jump later.
3116 OSRExitJumpPlaceholder speculationCheck(ExitKind, JSValueSource, Node*);
3117 OSRExitJumpPlaceholder speculationCheck(ExitKind, JSValueSource, Edge);
3118 void speculationCheck(ExitKind, JSValueSource, Edge, MacroAssembler::Jump jumpToFail);
3119 void speculationCheck(ExitKind, JSValueSource, Edge, const MacroAssembler::JumpList& jumpsToFail);
3120 // Add a speculation check with additional recovery.
3121 void speculationCheck(ExitKind, JSValueSource, Node*, MacroAssembler::Jump jumpToFail, const SpeculationRecovery&);
3122 void speculationCheck(ExitKind, JSValueSource, Edge, MacroAssembler::Jump jumpToFail, const SpeculationRecovery&);
3124 void emitInvalidationPoint(Node*);
3126 void unreachable(Node*);
3128 // Called when we statically determine that a speculation will fail.
3129 void terminateSpeculativeExecution(ExitKind, JSValueRegs, Node*);
3130 void terminateSpeculativeExecution(ExitKind, JSValueRegs, Edge);
3132 // Helpers for performing type checks on an edge stored in the given registers.
3133 bool needsTypeCheck(Edge edge, SpeculatedType typesPassedThrough) { return m_interpreter.needsTypeCheck(edge, typesPassedThrough); }
3134 void typeCheck(JSValueSource, Edge, SpeculatedType typesPassedThrough, MacroAssembler::Jump jumpToFail, ExitKind = BadType);
3136 void speculateCellTypeWithoutTypeFiltering(Edge, GPRReg cellGPR, JSType);
3137 void speculateCellType(Edge, GPRReg cellGPR, SpeculatedType, JSType);
3139 void speculateInt32(Edge);
3141 void convertAnyInt(Edge, GPRReg resultGPR);
3142 void speculateAnyInt(Edge);
3143 void speculateInt32(Edge, JSValueRegs);
3144 void speculateDoubleRepAnyInt(Edge);
3145 #endif // USE(JSVALUE64)
3146 void speculateNumber(Edge);
3147 void speculateRealNumber(Edge);
3148 void speculateDoubleRepReal(Edge);
3149 void speculateBoolean(Edge);
3150 void speculateCell(Edge);
3151 void speculateCellOrOther(Edge);
3152 void speculateObject(Edge, GPRReg cell);
3153 void speculateObject(Edge);
3154 void speculateArray(Edge, GPRReg cell);
3155 void speculateArray(Edge);
3156 void speculateFunction(Edge, GPRReg cell);
3157 void speculateFunction(Edge);
3158 void speculateFinalObject(Edge, GPRReg cell);
3159 void speculateFinalObject(Edge);
3160 void speculateRegExpObject(Edge, GPRReg cell);
3161 void speculateRegExpObject(Edge);
3162 void speculateProxyObject(Edge, GPRReg cell);
3163 void speculateProxyObject(Edge);
3164 void speculateDerivedArray(Edge, GPRReg cell);
3165 void speculateDerivedArray(Edge);
3166 void speculateMapObject(Edge);
3167 void speculateMapObject(Edge, GPRReg cell);
3168 void speculateSetObject(Edge);
3169 void speculateSetObject(Edge, GPRReg cell);
3170 void speculateWeakMapObject(Edge);
3171 void speculateWeakMapObject(Edge, GPRReg cell);
3172 void speculateWeakSetObject(Edge);
3173 void speculateWeakSetObject(Edge, GPRReg cell);
3174 void speculateObjectOrOther(Edge);
3175 void speculateString(Edge edge, GPRReg cell);
3176 void speculateStringIdentAndLoadStorage(Edge edge, GPRReg string, GPRReg storage);
3177 void speculateStringIdent(Edge edge, GPRReg string);
3178 void speculateStringIdent(Edge);
3179 void speculateString(Edge);
3180 void speculateStringOrOther(Edge, JSValueRegs, GPRReg scratch);
3181 void speculateStringOrOther(Edge);
3182 void speculateNotStringVar(Edge);
3183 void speculateNotSymbol(Edge);
3184 template<typename StructureLocationType>
3185 void speculateStringObjectForStructure(Edge, StructureLocationType);
3186 void speculateStringObject(Edge, GPRReg);
3187 void speculateStringObject(Edge);
3188 void speculateStringOrStringObject(Edge);
3189 void speculateSymbol(Edge, GPRReg cell);
3190 void speculateSymbol(Edge);
3191 void speculateNotCell(Edge, JSValueRegs);
3192 void speculateNotCell(Edge);
3193 void speculateOther(Edge, JSValueRegs, GPRReg temp);
3194 void speculateOther(Edge, JSValueRegs);
3195 void speculateOther(Edge);
3196 void speculateMisc(Edge, JSValueRegs);
3197 void speculateMisc(Edge);
3198 void speculate(Node*, Edge);
3200 JITCompiler::Jump jumpSlowForUnwantedArrayMode(GPRReg tempWithIndexingTypeReg, ArrayMode, IndexingType);
3201 JITCompiler::JumpList jumpSlowForUnwantedArrayMode(GPRReg tempWithIndexingTypeReg, ArrayMode);
3202 void checkArray(Node*);
3203 void arrayify(Node*, GPRReg baseReg, GPRReg propertyReg);
3204 void arrayify(Node*);
3206 template<bool strict>
3207 GPRReg fillSpeculateInt32Internal(Edge, DataFormat& returnFormat);
3209 void cageTypedArrayStorage(GPRReg);
3211 // It is possible, during speculative generation, to reach a situation in which we
3212 // can statically determine a speculation will fail (for example, when two nodes
3213 // will make conflicting speculations about the same operand). In such cases this
3214 // flag is cleared, indicating no further code generation should take place.
3217 void recordSetLocal(
3218 VirtualRegister bytecodeReg, VirtualRegister machineReg, DataFormat format)
3220 m_stream->appendAndLog(VariableEvent::setLocal(bytecodeReg, machineReg, format));
3223 void recordSetLocal(DataFormat format)
3225 VariableAccessData* variable = m_currentNode->variableAccessData();
3226 recordSetLocal(variable->local(), variable->machineLocal(), format);
3229 GenerationInfo& generationInfoFromVirtualRegister(VirtualRegister virtualRegister)
3231 return m_generationInfo[virtualRegister.toLocal()];
3234 GenerationInfo& generationInfo(Node* node)
3236 return generationInfoFromVirtualRegister(node->virtualRegister());
3239 GenerationInfo& generationInfo(Edge edge)
3241 return generationInfo(edge.node());
3244 // The JIT, while also provides MacroAssembler functionality.
3247 // The current node being generated.
3248 BasicBlock* m_block;
3249 Node* m_currentNode;
3250 NodeType m_lastGeneratedNode;
3251 unsigned m_indexInBlock;