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_ECJJ operation, GPRReg arg1, GPRReg arg2, GPRReg arg3)
1937 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1938 return appendCall(operation);
1940 JITCompiler::Call callOperation(V_JITOperation_ECCJ operation, GPRReg arg1, GPRReg arg2, JSValueRegs arg3)
1942 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3.payloadGPR());
1943 return appendCall(operation);
1946 JITCompiler::Call callOperation(Z_JITOperation_EJ operation, GPRReg result, JSValueRegs arg1)
1948 m_jit.setupArgumentsWithExecState(arg1.payloadGPR());
1949 return appendCallSetResult(operation, result);
1952 JITCompiler::Call callOperation(Z_JITOperation_EJZZ operation, GPRReg result, GPRReg arg1, unsigned arg2, unsigned arg3)
1954 m_jit.setupArgumentsWithExecState(arg1, TrustedImm32(arg2), TrustedImm32(arg3));
1955 return appendCallSetResult(operation, result);
1957 JITCompiler::Call callOperation(F_JITOperation_EFJZZ operation, GPRReg result, GPRReg arg1, GPRReg arg2, unsigned arg3, GPRReg arg4)
1959 m_jit.setupArgumentsWithExecState(arg1, arg2, TrustedImm32(arg3), arg4);
1960 return appendCallSetResult(operation, result);
1963 JITCompiler::Call callOperation(Z_JITOperation_EJOJ operation, GPRReg result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
1965 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
1966 return appendCallSetResult(operation, result);
1968 JITCompiler::Call callOperation(Z_JITOperation_EJOJ operation, GPRReg result, JSValueRegs arg1, GPRReg arg2, JSValueRegs arg3)
1970 return callOperation(operation, result, arg1.payloadGPR(), arg2, arg3.payloadGPR());
1973 JITCompiler::Call callOperation(Z_JITOperation_EJZ operation, GPRReg result, GPRReg arg1, unsigned arg2)
1975 m_jit.setupArgumentsWithExecState(arg1, TrustedImm32(arg2));
1976 return appendCallSetResult(operation, result);
1978 JITCompiler::Call callOperation(Z_JITOperation_EBJZ operation, GPRReg result, GPRReg arg1, JSValueRegs arg2, GPRReg arg3)
1980 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg3);
1981 return appendCallSetResult(operation, result);
1983 JITCompiler::Call callOperation(V_JITOperation_EZJZZZ operation, unsigned arg1, GPRReg arg2, unsigned arg3, GPRReg arg4, unsigned arg5)
1985 m_jit.setupArgumentsWithExecState(TrustedImm32(arg1), arg2, TrustedImm32(arg3), arg4, TrustedImm32(arg5));
1986 return appendCall(operation);
1988 JITCompiler::Call callOperation(V_JITOperation_ECJZC operation, GPRReg regOp1, GPRReg regOp2, int32_t op3, GPRReg regOp4)
1990 m_jit.setupArgumentsWithExecState(regOp1, regOp2, TrustedImm32(op3), regOp4);
1991 return appendCall(operation);
1993 JITCompiler::Call callOperation(V_JITOperation_ECIZJJ operation, GPRReg regOp1, UniquedStringImpl* identOp2, int32_t op3, GPRReg regOp4, GPRReg regOp5)
1995 m_jit.setupArgumentsWithExecState(regOp1, TrustedImmPtr(identOp2), TrustedImm32(op3), regOp4, regOp5);
1996 return appendCall(operation);
1998 JITCompiler::Call callOperation(D_JITOperation_EJ operation, FPRReg result, JSValueRegs arg1)
2000 m_jit.setupArgumentsWithExecState(arg1.gpr());
2001 return appendCallSetResult(operation, result);
2004 JITCompiler::Call callCustomGetter(J_JITOperation_EJI function, JSValueRegs result, GPRReg arg1, UniquedStringImpl* uid)
2006 m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(uid));
2007 m_jit.storePtr(GPRInfo::callFrameRegister, &m_jit.vm()->topCallFrame);
2008 m_jit.emitStoreCodeOrigin(m_currentNode->origin.semantic);
2009 JITCompiler::Call call = m_jit.appendCall(function);
2010 if (result.payloadGPR() != InvalidGPRReg)
2011 m_jit.move(GPRInfo::returnValueGPR, result.payloadGPR());
2014 #else // USE(JSVALUE32_64)
2015 JITCompiler::Call callOperation(Z_JITOperation_EOJ operation, GPRReg result, GPRReg arg1, JSValueRegs arg2)
2017 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR());
2018 return appendCallSetResult(operation, result);
2020 JITCompiler::Call callOperation(C_JITOperation_ECJZ operation, GPRReg result, GPRReg arg1, JSValueRegs arg2, GPRReg arg3)
2022 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR(), arg3);
2023 return appendCallSetResult(operation, result);
2025 JITCompiler::Call callOperation(C_JITOperation_ECJ 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_ECO operation, GPRReg result, GPRReg arg1, GPRReg arg2)
2032 m_jit.setupArgumentsWithExecState(arg1, arg2);
2033 return appendCallSetResult(operation, result);
2035 JITCompiler::Call callOperation(J_JITOperation_EJMic operation, JSValueRegs result, JSValueRegs arg, TrustedImmPtr mathIC)
2037 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg.payloadGPR(), arg.tagGPR(), mathIC);
2038 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2040 JITCompiler::Call callOperation(J_JITOperation_EJZ operation, JSValueRegs result, JSValueRegs arg1, GPRReg arg2)
2042 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2);
2043 return appendCallSetResult(operation, result);
2045 JITCompiler::Call callOperation(J_JITOperation_EJJMic operation, JSValueRegs result, JSValueRegs arg1, JSValueRegs arg2, TrustedImmPtr mathIC)
2047 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2.payloadGPR(), arg2.tagGPR(), mathIC);
2048 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2051 JITCompiler::Call callOperation(J_JITOperation_EJJI operation, JSValueRegs result, JSValueRegs arg1, JSValueRegs arg2, UniquedStringImpl* uid)
2053 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2.payloadGPR(), arg2.tagGPR(), TrustedImmPtr(uid));
2054 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2056 JITCompiler::Call callOperation(V_JITOperation_EJJJI operation, JSValueRegs arg1, JSValueRegs arg2, JSValueRegs arg3, UniquedStringImpl* uid)
2058 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2.payloadGPR(), arg2.tagGPR(), arg3.payloadGPR(), arg3.tagGPR(), TrustedImmPtr(uid));
2059 return appendCall(operation);
2061 JITCompiler::Call callOperation(V_JITOperation_EJJJJ operation, JSValueRegs arg1, JSValueRegs arg2, JSValueRegs arg3, JSValueRegs arg4)
2063 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2.payloadGPR(), arg2.tagGPR(), arg3.payloadGPR(), arg3.tagGPR(), arg4.payloadGPR(), arg4.tagGPR());
2064 return appendCall(operation);
2066 JITCompiler::Call callOperation(J_JITOperation_EJscI operation, JSValueRegs result, GPRReg arg1, UniquedStringImpl* impl)
2068 m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(impl));
2069 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2071 JITCompiler::Call callOperation(V_JITOperation_EOJJZ operation, GPRReg arg1, JSValueRegs arg2, JSValueRegs arg3, GPRReg arg4)
2073 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR(), arg3.payloadGPR(), arg3.tagGPR(), arg4);
2074 return appendCall(operation);
2076 JITCompiler::Call callOperation(V_JITOperation_EOJssJZ operation, GPRReg arg1, GPRReg arg2, JSValueRegs arg3, GPRReg arg4)
2078 m_jit.setupArgumentsWithExecState(arg1, arg2, EABI_32BIT_DUMMY_ARG arg3.payloadGPR(), arg3.tagGPR(), arg4);
2079 return appendCall(operation);
2081 JITCompiler::Call callOperation(V_JITOperation_EOIJZ operation, GPRReg arg1, GPRReg arg2, JSValueRegs arg3, GPRReg arg4)
2083 m_jit.setupArgumentsWithExecState(arg1, arg2, EABI_32BIT_DUMMY_ARG arg3.payloadGPR(), arg3.tagGPR(), arg4);
2084 return appendCall(operation);
2086 JITCompiler::Call callOperation(V_JITOperation_EOSymJZ 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_EOJOOZ operation, GPRReg arg1, JSValueRegs arg2, GPRReg arg3, GPRReg arg4, GPRReg arg5)
2093 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR(), arg3, arg4, arg5);
2094 return appendCall(operation);
2096 JITCompiler::Call callOperation(V_JITOperation_EOJssOOZ operation, GPRReg arg1, GPRReg arg2, GPRReg arg3, GPRReg arg4, GPRReg arg5)
2098 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3, arg4, arg5);
2099 return appendCall(operation);
2101 JITCompiler::Call callOperation(V_JITOperation_EOIOOZ operation, GPRReg arg1, GPRReg arg2, GPRReg arg3, GPRReg arg4, GPRReg arg5)
2103 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3, arg4, arg5);
2104 return appendCall(operation);
2106 JITCompiler::Call callOperation(V_JITOperation_EOSymOOZ 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_EOJIUi operation, GPRReg arg1, JSValueRegs arg2, UniquedStringImpl* impl, unsigned value)
2113 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR(), TrustedImmPtr(impl), TrustedImm32(value));
2114 return appendCall(operation);
2116 JITCompiler::Call callOperation(J_JITOperation_EOIUi operation, JSValueRegs result, GPRReg arg1, UniquedStringImpl* impl, unsigned value)
2118 m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(impl), TrustedImm32(value));
2119 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2121 JITCompiler::Call callOperation(D_JITOperation_G operation, FPRReg result, JSGlobalObject* globalObject)
2123 m_jit.setupArguments(TrustedImmPtr::weakPointer(m_jit.graph(), globalObject));
2124 return appendCallSetResult(operation, result);
2126 JITCompiler::Call callOperation(Z_JITOperation_D operation, GPRReg result, FPRReg arg1)
2128 prepareForExternalCall();
2129 m_jit.setupArguments(arg1);
2130 JITCompiler::Call call = m_jit.appendCall(operation);
2131 m_jit.zeroExtend32ToPtr(GPRInfo::returnValueGPR, result);
2134 JITCompiler::Call callOperation(J_JITOperation_E operation, JSValueRegs result)
2136 m_jit.setupArgumentsExecState();
2137 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2139 JITCompiler::Call callOperation(J_JITOperation_EP operation, JSValueRegs result, void* pointer)
2141 m_jit.setupArgumentsWithExecState(TrustedImmPtr(pointer));
2142 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2144 JITCompiler::Call callOperation(J_JITOperation_EPP operation, JSValueRegs result, GPRReg arg1, void* pointer)
2146 m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(pointer));
2147 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2149 JITCompiler::Call callOperation(J_JITOperation_EPP operation, JSValueRegs result, GPRReg arg1, GPRReg arg2)
2151 m_jit.setupArgumentsWithExecState(arg1, arg2);
2152 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2154 JITCompiler::Call callOperation(J_JITOperation_EPPP operation, JSValueRegs result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
2156 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
2157 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2159 JITCompiler::Call callOperation(J_JITOperation_EGP 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_EAPZ operation, JSValueRegs result, GPRReg arg1, GPRReg arg2, TrustedImm32 arg3)
2166 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
2167 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2169 JITCompiler::Call callOperation(J_JITOperation_EP operation, JSValueRegs result, GPRReg arg1)
2171 m_jit.setupArgumentsWithExecState(arg1);
2172 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2174 JITCompiler::Call callOperation(J_JITOperation_EI operation, JSValueRegs result, UniquedStringImpl* uid)
2176 m_jit.setupArgumentsWithExecState(TrustedImmPtr(uid));
2177 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2179 JITCompiler::Call callOperation(J_JITOperation_EA operation, JSValueRegs result, GPRReg arg1)
2181 m_jit.setupArgumentsWithExecState(arg1);
2182 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2184 JITCompiler::Call callOperation(J_JITOperation_EOZ operation, JSValueRegs result, GPRReg arg1, GPRReg arg2)
2186 m_jit.setupArgumentsWithExecState(arg1, arg2);
2187 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2189 JITCompiler::Call callOperation(J_JITOperation_EJ operation, JSValueRegs result, GPRReg arg1)
2191 m_jit.setupArgumentsWithExecState(arg1);
2192 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2194 JITCompiler::Call callOperation(J_JITOperation_EJC operation, JSValueRegs result, JSValueRegs arg1, GPRReg arg2)
2196 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2);
2197 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2199 JITCompiler::Call callOperation(J_JITOperation_EJssZ operation, JSValueRegs result, GPRReg arg1, GPRReg arg2)
2201 m_jit.setupArgumentsWithExecState(arg1, arg2);
2202 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2204 JITCompiler::Call callOperation(J_JITOperation_EJssReo operation, JSValueRegs result, GPRReg arg1, GPRReg arg2)
2206 m_jit.setupArgumentsWithExecState(arg1, arg2);
2207 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2209 JITCompiler::Call callOperation(J_JITOperation_EJssReoJss operation, JSValueRegs result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
2211 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
2212 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2214 JITCompiler::Call callOperation(J_JITOperation_EPS operation, JSValueRegs result, void* pointer, size_t size)
2216 m_jit.setupArgumentsWithExecState(TrustedImmPtr(pointer), TrustedImmPtr(size));
2217 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2219 JITCompiler::Call callOperation(J_JITOperation_ESS operation, JSValueRegs result, int startConstant, int numConstants)
2221 m_jit.setupArgumentsWithExecState(TrustedImm32(startConstant), TrustedImm32(numConstants));
2222 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2224 JITCompiler::Call callOperation(J_JITOperation_EJP operation, JSValueRegs result, JSValueRegs arg1, void* pointer)
2226 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), TrustedImmPtr(pointer));
2227 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2229 JITCompiler::Call callOperation(J_JITOperation_EJP operation, JSValueRegs result, JSValueRegs arg1, GPRReg arg2)
2231 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2);
2232 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2235 JITCompiler::Call callOperation(J_JITOperation_EC operation, JSValueRegs result, JSCell* cell)
2237 m_jit.setupArgumentsWithExecState(TrustedImmPtr::weakPointer(m_jit.graph(), cell));
2238 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2240 JITCompiler::Call callOperation(J_JITOperation_ECZ operation, JSValueRegs result, GPRReg arg1, GPRReg arg2)
2242 m_jit.setupArgumentsWithExecState(arg1, arg2);
2243 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2245 JITCompiler::Call callOperation(J_JITOperation_ECZZ operation, JSValueRegs result, GPRReg arg1, GPRReg arg2, int32_t constant)
2247 m_jit.setupArgumentsWithExecState(arg1, arg2, TrustedImm32(constant));
2248 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2250 JITCompiler::Call callOperation(J_JITOperation_EJscC operation, JSValueRegs result, GPRReg arg1, JSCell* cell)
2252 m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr::weakPointer(m_jit.graph(), cell));
2253 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2255 JITCompiler::Call callOperation(J_JITOperation_EJscCJ operation, GPRReg result, GPRReg arg1, JSCell* cell, JSValueRegs arg2)
2257 m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr::weakPointer(m_jit.graph(), cell), EABI_32BIT_DUMMY_ARG arg2.payloadGPR(), arg2.tagGPR());
2258 return appendCallSetResult(operation, result);
2260 JITCompiler::Call callOperation(J_JITOperation_EGReoJ operation, JSValueRegs result, GPRReg arg1, GPRReg arg2, JSValueRegs arg3)
2262 m_jit.setupArgumentsWithExecState(arg1, arg2, EABI_32BIT_DUMMY_ARG arg3.payloadGPR(), arg3.tagGPR());
2263 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2265 JITCompiler::Call callOperation(J_JITOperation_EGReoJss operation, JSValueRegs result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
2267 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
2268 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2270 JITCompiler::Call callOperation(J_JITOperation_ESsiCI operation, JSValueRegs result, StructureStubInfo* stubInfo, GPRReg arg1, const UniquedStringImpl* uid)
2272 m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1, TrustedImmPtr(uid));
2273 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2275 JITCompiler::Call callOperation(J_JITOperation_ESsiJI operation, JSValueRegs result, StructureStubInfo* stubInfo, JSValueRegs arg1, UniquedStringImpl* uid)
2277 m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1.payloadGPR(), arg1.tagGPR(), TrustedImmPtr(uid));
2278 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2280 JITCompiler::Call callOperation(J_JITOperation_ESsiJJI operation, JSValueRegs result, StructureStubInfo* stubInfo, JSValueRegs arg1, JSValueRegs arg2, UniquedStringImpl* uid)
2282 m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1.payloadGPR(), arg1.tagGPR(), arg2.payloadGPR(), arg2.tagGPR(), TrustedImmPtr(uid));
2283 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2285 JITCompiler::Call callOperation(J_JITOperation_ESsiJJI operation, JSValueRegs result, StructureStubInfo* stubInfo, int32_t arg1Tag, GPRReg arg1Payload, GPRReg arg2Tag, GPRReg arg2Payload, UniquedStringImpl* uid)
2287 m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1Payload, TrustedImm32(arg1Tag), arg2Payload, arg2Tag, TrustedImmPtr(uid));
2288 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2290 JITCompiler::Call callOperation(J_JITOperation_ESsiJI operation, JSValueRegs result, StructureStubInfo* stubInfo, int32_t arg1Tag, GPRReg arg1Payload, UniquedStringImpl* uid)
2292 m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1Payload, TrustedImm32(arg1Tag), 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, int32_t arg2Tag, GPRReg arg2Payload, UniquedStringImpl* uid)
2297 m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1Payload, TrustedImm32(arg1Tag), arg2Payload, TrustedImm32(arg2Tag), TrustedImmPtr(uid));
2298 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2300 JITCompiler::Call callOperation(J_JITOperation_ESsiJI operation, JSValueRegs result, StructureStubInfo* stubInfo, GPRReg arg1Tag, GPRReg arg1Payload, UniquedStringImpl* uid)
2302 m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1Payload, arg1Tag, TrustedImmPtr(uid));
2303 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2305 JITCompiler::Call callOperation(J_JITOperation_EDA operation, JSValueRegs result, FPRReg arg1, GPRReg arg2)
2307 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1, arg2);
2308 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2310 JITCompiler::Call callOperation(J_JITOperation_EJA operation, JSValueRegs result, JSValueRegs arg1, GPRReg arg2)
2312 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2);
2313 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2315 JITCompiler::Call callOperation(J_JITOperation_EJA operation, JSValueRegs result, TrustedImm32 arg1Tag, GPRReg arg1Payload, GPRReg arg2)
2317 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1Payload, arg1Tag, arg2);
2318 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2320 JITCompiler::Call callOperation(J_JITOperation_EJA operation, JSValueRegs result, GPRReg arg1Tag, GPRReg arg1Payload, GPRReg arg2)
2322 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1Payload, arg1Tag, arg2);
2323 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2325 JITCompiler::Call callOperation(J_JITOperation_EJ operation, JSValueRegs result, JSValueRegs arg1)
2327 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR());
2328 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2330 JITCompiler::Call callOperation(J_JITOperation_EZ operation, JSValueRegs result, GPRReg arg1)
2332 m_jit.setupArgumentsWithExecState(arg1);
2333 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2335 JITCompiler::Call callOperation(J_JITOperation_EZ operation, JSValueRegs result, int32_t arg1)
2337 m_jit.setupArgumentsWithExecState(TrustedImm32(arg1));
2338 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2340 JITCompiler::Call callOperation(J_JITOperation_EZIcfZ operation, JSValueRegs result, int32_t arg1, InlineCallFrame* inlineCallFrame, GPRReg arg2)
2342 m_jit.setupArgumentsWithExecState(TrustedImm32(arg1), TrustedImmPtr(inlineCallFrame), arg2);
2343 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2345 JITCompiler::Call callOperation(J_JITOperation_EZZ operation, JSValueRegs result, int32_t arg1, GPRReg arg2)
2347 m_jit.setupArgumentsWithExecState(TrustedImm32(arg1), arg2);
2348 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2351 JITCompiler::Call callOperation(P_JITOperation_EJS operation, GPRReg result, JSValueRegs value, size_t index)
2353 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG value.payloadGPR(), value.tagGPR(), TrustedImmPtr(index));
2354 return appendCallSetResult(operation, result);
2357 JITCompiler::Call callOperation(P_JITOperation_EStJ operation, GPRReg result, RegisteredStructure structure, JSValueRegs arg2)
2359 m_jit.setupArgumentsWithExecState(TrustedImmPtr(structure), arg2.payloadGPR(), arg2.tagGPR());
2360 return appendCallSetResult(operation, result);
2363 JITCompiler::Call callOperation(C_JITOperation_EGJ operation, GPRReg result, TrustedImmPtr globalObject, JSValueRegs arg1)
2365 m_jit.setupArgumentsWithExecState(globalObject, arg1.payloadGPR(), arg1.tagGPR());
2366 return appendCallSetResult(operation, result);
2369 JITCompiler::Call callOperation(C_JITOperation_EGJ operation, GPRReg result, JSGlobalObject* globalObject, JSValueRegs arg1)
2371 m_jit.setupArgumentsWithExecState(TrustedImmPtr::weakPointer(m_jit.graph(), globalObject), arg1.payloadGPR(), arg1.tagGPR());
2372 return appendCallSetResult(operation, result);
2375 JITCompiler::Call callOperation(C_JITOperation_EGJI operation, GPRReg result, JSGlobalObject* globalObject, JSValueRegs arg1, UniquedStringImpl* arg2)
2377 m_jit.setupArgumentsWithExecState(TrustedImmPtr::weakPointer(m_jit.graph(), globalObject), arg1.payloadGPR(), arg1.tagGPR(), TrustedImmPtr(arg2));
2378 return appendCallSetResult(operation, result);
2381 JITCompiler::Call callOperation(C_JITOperation_EJ operation, GPRReg result, JSValueRegs arg1)
2383 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR());
2384 return appendCallSetResult(operation, result);
2387 JITCompiler::Call callOperation(C_JITOperation_EJJ operation, GPRReg result, JSValueRegs arg1, JSValueRegs arg2)
2389 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2.payloadGPR(), arg2.tagGPR());
2390 return appendCallSetResult(operation, result);
2393 JITCompiler::Call callOperation(C_JITOperation_EJJJ operation, GPRReg result, JSValueRegs arg1, JSValueRegs arg2, JSValueRegs arg3)
2395 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2.payloadGPR(), arg2.tagGPR(), arg3.payloadGPR(), arg3.tagGPR());
2396 return appendCallSetResult(operation, result);
2399 JITCompiler::Call callOperation(S_JITOperation_EJ operation, GPRReg result, JSValueRegs arg1)
2401 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR());
2402 return appendCallSetResult(operation, result);
2405 JITCompiler::Call callOperation(S_JITOperation_EJI operation, GPRReg result, JSValueRegs arg1, UniquedStringImpl* uid)
2407 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), TrustedImmPtr(uid));
2408 return appendCallSetResult(operation, result);
2411 JITCompiler::Call callOperation(S_JITOperation_EJJ operation, GPRReg result, JSValueRegs arg1, JSValueRegs arg2)
2413 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2.payloadGPR(), arg2.tagGPR());
2414 return appendCallSetResult(operation, result);
2417 JITCompiler::Call callOperation(S_JITOperation_EGJJ operation, GPRReg result, GPRReg arg1, JSValueRegs arg2, JSValueRegs arg3)
2419 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR(), arg3.payloadGPR(), arg3.tagGPR());
2420 return appendCallSetResult(operation, result);
2422 JITCompiler::Call callOperation(S_JITOperation_EGReoJ operation, GPRReg result, GPRReg arg1, GPRReg arg2, JSValueRegs arg3)
2424 m_jit.setupArgumentsWithExecState(arg1, arg2, EABI_32BIT_DUMMY_ARG arg3.payloadGPR(), arg3.tagGPR());
2425 return appendCallSetResult(operation, result);
2427 JITCompiler::Call callOperation(S_JITOperation_EGReoJss operation, GPRReg result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
2429 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
2430 return appendCallSetResult(operation, result);
2432 JITCompiler::Call callOperation(J_JITOperation_EJJ operation, JSValueRegs result, JSValueRegs arg1, JSValueRegs arg2)
2434 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2.payloadGPR(), arg2.tagGPR());
2435 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2437 JITCompiler::Call callOperation(J_JITOperation_EGJJ operation, JSValueRegs result, GPRReg arg1, JSValueRegs arg2, JSValueRegs arg3)
2439 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR(), arg3.payloadGPR(), arg3.tagGPR());
2440 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2442 JITCompiler::Call callOperation(J_JITOperation_EJJ operation, JSValueRegs result, JSValueRegs arg1, MacroAssembler::TrustedImm32 imm)
2444 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), imm, TrustedImm32(JSValue::Int32Tag));
2445 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2447 JITCompiler::Call callOperation(J_JITOperation_EJJ operation, JSValueRegs result, MacroAssembler::TrustedImm32 imm, JSValueRegs arg2)
2449 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG imm, TrustedImm32(JSValue::Int32Tag), arg2.payloadGPR(), arg2.tagGPR());
2450 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2452 JITCompiler::Call callOperation(J_JITOperation_EJJJ operation, JSValueRegs result, JSValueRegs arg1, JSValueRegs arg2, JSValueRegs arg3)
2454 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2.payloadGPR(), arg2.tagGPR(), arg3.payloadGPR(), arg3.tagGPR());
2455 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2458 JITCompiler::Call callOperation(J_JITOperation_ECJ operation, JSValueRegs result, GPRReg arg1, JSValueRegs arg2)
2460 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR());
2461 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2463 JITCompiler::Call callOperation(J_JITOperation_ECJ operation, JSValueRegs result, GPRReg arg1, GPRReg arg2Payload)
2465 m_jit.setupArgumentsWithExecState(arg1, arg2Payload, MacroAssembler::TrustedImm32(JSValue::CellTag));
2466 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2468 JITCompiler::Call callOperation(J_JITOperation_ECC operation, JSValueRegs result, GPRReg arg1, GPRReg arg2)
2470 m_jit.setupArgumentsWithExecState(arg1, arg2);
2471 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2473 JITCompiler::Call callOperation(J_JITOperation_ECCZ operation, JSValueRegs result, GPRReg arg1, GPRReg arg2, GPRReg arg3)
2475 m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
2476 return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR());
2479 JITCompiler::Call callOperation(V_JITOperation_EOZD operation, GPRReg arg1, GPRReg arg2, FPRReg arg3)
2481 m_jit.setupArgumentsWithExecState(arg1, arg2, EABI_32BIT_DUMMY_ARG arg3);
2482 return appendCall(operation);
2485 JITCompiler::Call callOperation(V_JITOperation_EJPP operation, JSValueRegs arg1, GPRReg arg2, void* pointer)
2487 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2, TrustedImmPtr(pointer));
2488 return appendCall(operation);
2490 JITCompiler::Call callOperation(V_JITOperation_ESsiJJI operation, StructureStubInfo* stubInfo, JSValueRegs arg1, GPRReg arg2Payload, UniquedStringImpl* uid)
2492 m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1.payloadGPR(), arg1.tagGPR(), arg2Payload, TrustedImm32(JSValue::CellTag), TrustedImmPtr(uid));
2493 return appendCall(operation);
2495 JITCompiler::Call callOperation(V_JITOperation_ECJ operation, GPRReg arg1, JSValueRegs arg2)
2497 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR());
2498 return appendCall(operation);
2500 JITCompiler::Call callOperation(V_JITOperation_ECJJ operation, GPRReg arg1, JSValueRegs arg2, JSValueRegs arg3)
2502 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR(), arg3.payloadGPR(), arg3.tagGPR());
2503 return appendCall(operation);
2505 JITCompiler::Call callOperation(V_JITOperation_ECCJ operation, GPRReg arg1, GPRReg arg2, JSValueRegs arg3)
2507 m_jit.setupArgumentsWithExecState(arg1, arg2, EABI_32BIT_DUMMY_ARG arg3.payloadGPR(), arg3.tagGPR());
2508 return appendCall(operation);
2511 JITCompiler::Call callOperation(V_JITOperation_EPZJ operation, GPRReg arg1, GPRReg arg2, JSValueRegs arg3)
2513 m_jit.setupArgumentsWithExecState(arg1, arg2, EABI_32BIT_DUMMY_ARG arg3.payloadGPR(), arg3.tagGPR());
2514 return appendCall(operation);
2517 JITCompiler::Call callOperation(V_JITOperation_EOZJ operation, GPRReg arg1, GPRReg arg2, JSValueRegs arg3)
2519 m_jit.setupArgumentsWithExecState(arg1, arg2, EABI_32BIT_DUMMY_ARG arg3.payloadGPR(), arg3.tagGPR());
2520 return appendCall(operation);
2522 JITCompiler::Call callOperation(V_JITOperation_EOZJ operation, GPRReg arg1, GPRReg arg2, TrustedImm32 arg3Tag, GPRReg arg3Payload)
2524 m_jit.setupArgumentsWithExecState(arg1, arg2, EABI_32BIT_DUMMY_ARG arg3Payload, arg3Tag);
2525 return appendCall(operation);
2527 JITCompiler::Call callOperation(V_JITOperation_EOZJ operation, GPRReg arg1, GPRReg arg2, GPRReg arg3Tag, GPRReg arg3Payload)
2529 m_jit.setupArgumentsWithExecState(arg1, arg2, EABI_32BIT_DUMMY_ARG arg3Payload, arg3Tag);
2530 return appendCall(operation);
2533 JITCompiler::Call callOperation(Z_JITOperation_EJOJ operation, GPRReg result, JSValueRegs arg1, GPRReg arg2, JSValueRegs arg3)
2535 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), arg2, EABI_32BIT_DUMMY_ARG arg3.payloadGPR(), arg3.tagGPR());
2536 return appendCallSetResult(operation, result);
2538 JITCompiler::Call callOperation(Z_JITOperation_EJ operation, GPRReg result, JSValueRegs arg1)
2540 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR());
2541 return appendCallSetResult(operation, result);
2543 JITCompiler::Call callOperation(Z_JITOperation_EJZZ operation, GPRReg result, JSValueRegs arg1, unsigned arg2, unsigned arg3)
2545 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), TrustedImm32(arg2), TrustedImm32(arg3));
2546 return appendCallSetResult(operation, result);
2548 JITCompiler::Call callOperation(F_JITOperation_EFJZZ operation, GPRReg result, GPRReg arg1, JSValueRegs arg2, unsigned arg3, GPRReg arg4)
2550 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR(), TrustedImm32(arg3), arg4);
2551 return appendCallSetResult(operation, result);
2553 JITCompiler::Call callOperation(Z_JITOperation_EJZ operation, GPRReg result, JSValueRegs arg1, unsigned arg2)
2555 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR(), TrustedImm32(arg2));
2556 return appendCallSetResult(operation, result);
2558 JITCompiler::Call callOperation(Z_JITOperation_EBJZ operation, GPRReg result, GPRReg arg1, JSValueRegs arg2, GPRReg arg3)
2560 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR(), arg3);
2561 return appendCallSetResult(operation, result);
2563 JITCompiler::Call callOperation(V_JITOperation_EZJZZZ operation, unsigned arg1, JSValueRegs arg2, unsigned arg3, GPRReg arg4, unsigned arg5)
2565 m_jit.setupArgumentsWithExecState(TrustedImm32(arg1), arg2.payloadGPR(), arg2.tagGPR(), TrustedImm32(arg3), arg4, TrustedImm32(arg5));
2566 return appendCall(operation);
2568 JITCompiler::Call callOperation(V_JITOperation_ECJZC operation, GPRReg arg1, JSValueRegs arg2, int32_t arg3, GPRReg arg4)
2570 m_jit.setupArgumentsWithExecState(arg1, arg2.payloadGPR(), arg2.tagGPR(), TrustedImm32(arg3), arg4);
2571 return appendCall(operation);
2573 JITCompiler::Call callOperation(V_JITOperation_ECIZCC operation, GPRReg arg1, UniquedStringImpl* identOp2, int32_t op3, GPRReg arg4, GPRReg arg5)
2575 m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(identOp2), TrustedImm32(op3), arg4, arg5);
2576 return appendCall(operation);
2578 JITCompiler::Call callOperation(D_JITOperation_EJ operation, FPRReg result, JSValueRegs arg1)
2580 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1.payloadGPR(), arg1.tagGPR());
2581 return appendCallSetResult(operation, result);
2584 JITCompiler::Call callCustomGetter(J_JITOperation_EJI function, JSValueRegs result, TrustedImm32 arg1Tag, GPRReg arg1Payload, UniquedStringImpl* uid)
2586 m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1Payload, arg1Tag, TrustedImmPtr(uid));
2587 m_jit.storePtr(GPRInfo::callFrameRegister, &m_jit.vm()->topCallFrame);
2588 m_jit.emitStoreCodeOrigin(m_currentNode->origin.semantic);
2589 JITCompiler::Call call = m_jit.appendCall(function);
2590 m_jit.setupResults(result.payloadGPR(), result.tagGPR());
2593 #endif // USE(JSVALUE32_64)
2595 #if !defined(NDEBUG) && !CPU(ARM) && !CPU(MIPS)
2596 void prepareForExternalCall()
2598 // We're about to call out to a "native" helper function. The helper
2599 // function is expected to set topCallFrame itself with the ExecState
2600 // that is passed to it.
2602 // We explicitly trash topCallFrame here so that we'll know if some of
2603 // the helper functions are not setting topCallFrame when they should
2604 // be doing so. Note: the previous value in topcallFrame was not valid
2605 // anyway since it was not being updated by JIT'ed code by design.
2607 for (unsigned i = 0; i < sizeof(void*) / 4; i++)
2608 m_jit.store32(TrustedImm32(0xbadbeef), reinterpret_cast<char*>(&m_jit.vm()->topCallFrame) + i * 4);
2611 void prepareForExternalCall() { }
2614 // These methods add call instructions, optionally setting results, and optionally rolling back the call frame on an exception.
2615 JITCompiler::Call appendCall(const FunctionPtr& function)
2617 prepareForExternalCall();
2618 m_jit.emitStoreCodeOrigin(m_currentNode->origin.semantic);
2619 return m_jit.appendCall(function);
2621 JITCompiler::Call appendCallWithCallFrameRollbackOnException(const FunctionPtr& function)
2623 JITCompiler::Call call = appendCall(function);
2624 m_jit.exceptionCheckWithCallFrameRollback();
2627 JITCompiler::Call appendCallWithCallFrameRollbackOnExceptionSetResult(const FunctionPtr& function, GPRReg result)
2629 JITCompiler::Call call = appendCallWithCallFrameRollbackOnException(function);
2630 if ((result != InvalidGPRReg) && (result != GPRInfo::returnValueGPR))
2631 m_jit.move(GPRInfo::returnValueGPR, result);
2634 JITCompiler::Call appendCallSetResult(const FunctionPtr& function, GPRReg result)
2636 JITCompiler::Call call = appendCall(function);
2637 if (result != InvalidGPRReg)
2638 m_jit.move(GPRInfo::returnValueGPR, result);
2641 JITCompiler::Call appendCallSetResult(const FunctionPtr& function, GPRReg result1, GPRReg result2)
2643 JITCompiler::Call call = appendCall(function);
2644 m_jit.setupResults(result1, result2);
2647 JITCompiler::Call appendCallSetResult(const FunctionPtr& function, JSValueRegs resultRegs)
2650 return appendCallSetResult(function, resultRegs.gpr());
2652 return appendCallSetResult(function, resultRegs.payloadGPR(), resultRegs.tagGPR());
2656 JITCompiler::Call appendCallSetResult(const FunctionPtr& function, FPRReg result)
2658 JITCompiler::Call call = appendCall(function);
2659 if (result != InvalidFPRReg) {
2660 m_jit.assembler().fstpl(0, JITCompiler::stackPointerRegister);
2661 m_jit.loadDouble(JITCompiler::stackPointerRegister, result);
2665 #elif CPU(ARM) && !CPU(ARM_HARDFP)
2666 JITCompiler::Call appendCallSetResult(const FunctionPtr& function, FPRReg result)
2668 JITCompiler::Call call = appendCall(function);
2669 if (result != InvalidFPRReg)
2670 m_jit.assembler().vmov(result, GPRInfo::returnValueGPR, GPRInfo::returnValueGPR2);
2673 #else // CPU(X86_64) || (CPU(ARM) && CPU(ARM_HARDFP)) || CPU(ARM64) || CPU(MIPS)
2674 JITCompiler::Call appendCallSetResult(const FunctionPtr& function, FPRReg result)
2676 JITCompiler::Call call = appendCall(function);
2677 if (result != InvalidFPRReg)
2678 m_jit.moveDouble(FPRInfo::returnValueFPR, result);
2683 void branchDouble(JITCompiler::DoubleCondition cond, FPRReg left, FPRReg right, BasicBlock* destination)
2685 return addBranch(m_jit.branchDouble(cond, left, right), destination);
2688 void branchDoubleNonZero(FPRReg value, FPRReg scratch, BasicBlock* destination)
2690 return addBranch(m_jit.branchDoubleNonZero(value, scratch), destination);
2693 template<typename T, typename U>
2694 void branch32(JITCompiler::RelationalCondition cond, T left, U right, BasicBlock* destination)
2696 return addBranch(m_jit.branch32(cond, left, right), destination);
2699 template<typename T, typename U>
2700 void branchTest32(JITCompiler::ResultCondition cond, T value, U mask, BasicBlock* destination)
2702 return addBranch(m_jit.branchTest32(cond, value, mask), destination);
2705 template<typename T>
2706 void branchTest32(JITCompiler::ResultCondition cond, T value, BasicBlock* destination)
2708 return addBranch(m_jit.branchTest32(cond, value), destination);
2712 template<typename T, typename U>
2713 void branch64(JITCompiler::RelationalCondition cond, T left, U right, BasicBlock* destination)
2715 return addBranch(m_jit.branch64(cond, left, right), destination);
2719 template<typename T, typename U>
2720 void branch8(JITCompiler::RelationalCondition cond, T left, U right, BasicBlock* destination)
2722 return addBranch(m_jit.branch8(cond, left, right), destination);
2725 template<typename T, typename U>
2726 void branchPtr(JITCompiler::RelationalCondition cond, T left, U right, BasicBlock* destination)
2728 return addBranch(m_jit.branchPtr(cond, left, right), destination);
2731 template<typename T, typename U>
2732 void branchTestPtr(JITCompiler::ResultCondition cond, T value, U mask, BasicBlock* destination)
2734 return addBranch(m_jit.branchTestPtr(cond, value, mask), destination);
2737 template<typename T>
2738 void branchTestPtr(JITCompiler::ResultCondition cond, T value, BasicBlock* destination)
2740 return addBranch(m_jit.branchTestPtr(cond, value), destination);
2743 template<typename T, typename U>
2744 void branchTest8(JITCompiler::ResultCondition cond, T value, U mask, BasicBlock* destination)
2746 return addBranch(m_jit.branchTest8(cond, value, mask), destination);
2749 template<typename T>
2750 void branchTest8(JITCompiler::ResultCondition cond, T value, BasicBlock* destination)
2752 return addBranch(m_jit.branchTest8(cond, value), destination);
2755 enum FallThroughMode {
2759 void jump(BasicBlock* destination, FallThroughMode fallThroughMode = AtFallThroughPoint)
2761 if (destination == nextBlock()
2762 && fallThroughMode == AtFallThroughPoint)
2764 addBranch(m_jit.jump(), destination);
2767 void addBranch(const MacroAssembler::Jump& jump, BasicBlock* destination)
2769 m_branches.append(BranchRecord(jump, destination));
2771 void addBranch(const MacroAssembler::JumpList& jump, BasicBlock* destination);
2773 void linkBranches();
2775 void dump(const char* label = 0);
2777 bool betterUseStrictInt52(Node* node)
2779 return !generationInfo(node).isInt52();
2781 bool betterUseStrictInt52(Edge edge)
2783 return betterUseStrictInt52(edge.node());
2786 bool compare(Node*, MacroAssembler::RelationalCondition, MacroAssembler::DoubleCondition, S_JITOperation_EJJ);
2787 void compileCompareUnsigned(Node*, MacroAssembler::RelationalCondition);
2788 bool compilePeepHoleBranch(Node*, MacroAssembler::RelationalCondition, MacroAssembler::DoubleCondition, S_JITOperation_EJJ);
2789 void compilePeepHoleInt32Branch(Node*, Node* branchNode, JITCompiler::RelationalCondition);
2790 void compilePeepHoleInt52Branch(Node*, Node* branchNode, JITCompiler::RelationalCondition);
2791 void compilePeepHoleBooleanBranch(Node*, Node* branchNode, JITCompiler::RelationalCondition);
2792 void compilePeepHoleDoubleBranch(Node*, Node* branchNode, JITCompiler::DoubleCondition);
2793 void compilePeepHoleObjectEquality(Node*, Node* branchNode);
2794 void compilePeepHoleObjectStrictEquality(Edge objectChild, Edge otherChild, Node* branchNode);
2795 void compilePeepHoleObjectToObjectOrOtherEquality(Edge leftChild, Edge rightChild, Node* branchNode);
2796 void compileObjectEquality(Node*);
2797 void compileObjectStrictEquality(Edge objectChild, Edge otherChild);
2798 void compileObjectToObjectOrOtherEquality(Edge leftChild, Edge rightChild);
2799 void compileObjectOrOtherLogicalNot(Edge value);
2800 void compileLogicalNot(Node*);
2801 void compileLogicalNotStringOrOther(Node*);
2802 void compileStringEquality(
2803 Node*, GPRReg leftGPR, GPRReg rightGPR, GPRReg lengthGPR,
2804 GPRReg leftTempGPR, GPRReg rightTempGPR, GPRReg leftTemp2GPR,
2805 GPRReg rightTemp2GPR, JITCompiler::JumpList fastTrue,
2806 JITCompiler::JumpList fastSlow);
2807 void compileStringEquality(Node*);
2808 void compileStringIdentEquality(Node*);
2809 void compileStringToUntypedEquality(Node*, Edge stringEdge, Edge untypedEdge);
2810 void compileStringIdentToNotStringVarEquality(Node*, Edge stringEdge, Edge notStringVarEdge);
2811 void compileStringZeroLength(Node*);
2812 void compileMiscStrictEq(Node*);
2814 void compileSymbolEquality(Node*);
2815 void compilePeepHoleSymbolEquality(Node*, Node* branchNode);
2816 void compileSymbolUntypedEquality(Node*, Edge symbolEdge, Edge untypedEdge);
2818 void emitObjectOrOtherBranch(Edge value, BasicBlock* taken, BasicBlock* notTaken);
2819 void emitStringBranch(Edge value, BasicBlock* taken, BasicBlock* notTaken);
2820 void emitStringOrOtherBranch(Edge value, BasicBlock* taken, BasicBlock* notTaken);
2821 void emitBranch(Node*);
2823 struct StringSwitchCase {
2824 StringSwitchCase() { }
2826 StringSwitchCase(StringImpl* string, BasicBlock* target)
2832 bool operator<(const StringSwitchCase& other) const
2834 return stringLessThan(*string, *other.string);
2841 void emitSwitchIntJump(SwitchData*, GPRReg value, GPRReg scratch);
2842 void emitSwitchImm(Node*, SwitchData*);
2843 void emitSwitchCharStringJump(SwitchData*, GPRReg value, GPRReg scratch);
2844 void emitSwitchChar(Node*, SwitchData*);
2845 void emitBinarySwitchStringRecurse(
2846 SwitchData*, const Vector<StringSwitchCase>&, unsigned numChecked,
2847 unsigned begin, unsigned end, GPRReg buffer, GPRReg length, GPRReg temp,
2848 unsigned alreadyCheckedLength, bool checkedExactLength);
2849 void emitSwitchStringOnString(SwitchData*, GPRReg string);
2850 void emitSwitchString(Node*, SwitchData*);
2851 void emitSwitch(Node*);
2853 void compileToStringOrCallStringConstructor(Node*);
2854 void compileNumberToStringWithRadix(Node*);
2855 void compileNumberToStringWithValidRadixConstant(Node*);
2856 void compileNumberToStringWithValidRadixConstant(Node*, int32_t radix);
2857 void compileNewStringObject(Node*);
2859 void compileNewTypedArray(Node*);
2861 void compileInt32Compare(Node*, MacroAssembler::RelationalCondition);
2862 void compileInt52Compare(Node*, MacroAssembler::RelationalCondition);
2863 void compileBooleanCompare(Node*, MacroAssembler::RelationalCondition);
2864 void compileDoubleCompare(Node*, MacroAssembler::DoubleCondition);
2865 void compileStringCompare(Node*, MacroAssembler::RelationalCondition);
2866 void compileStringIdentCompare(Node*, MacroAssembler::RelationalCondition);
2868 bool compileStrictEq(Node*);
2870 void compileAllocatePropertyStorage(Node*);
2871 void compileReallocatePropertyStorage(Node*);
2872 void compileNukeStructureAndSetButterfly(Node*);
2873 void compileGetButterfly(Node*);
2874 void compileCallDOMGetter(Node*);
2875 void compileCallDOM(Node*);
2876 void compileCheckSubClass(Node*);
2877 void compileGetMapBucketHead(Node*);
2878 void compileGetMapBucketNext(Node*);
2879 void compileWeakMapGet(Node*);
2880 void compileLoadKeyFromMapBucket(Node*);
2881 void compileLoadValueFromMapBucket(Node*);
2882 void compileGetPrototypeOf(Node*);
2884 #if USE(JSVALUE32_64)
2885 template<typename BaseOperandType, typename PropertyOperandType, typename ValueOperandType, typename TagType>
2886 void compileContiguousPutByVal(Node*, BaseOperandType&, PropertyOperandType&, ValueOperandType&, GPRReg valuePayloadReg, TagType valueTag);
2888 void compileDoublePutByVal(Node*, SpeculateCellOperand& base, SpeculateStrictInt32Operand& property);
2889 bool putByValWillNeedExtraRegister(ArrayMode arrayMode)
2891 return arrayMode.mayStoreToHole();
2893 GPRReg temporaryRegisterForPutByVal(GPRTemporary&, ArrayMode);
2894 GPRReg temporaryRegisterForPutByVal(GPRTemporary& temporary, Node* node)
2896 return temporaryRegisterForPutByVal(temporary, node->arrayMode());
2899 void compileGetCharCodeAt(Node*);
2900 void compileGetByValOnString(Node*);
2901 void compileFromCharCode(Node*);
2903 void compileGetByValOnDirectArguments(Node*);
2904 void compileGetByValOnScopedArguments(Node*);
2906 void compileGetScope(Node*);
2907 void compileSkipScope(Node*);
2908 void compileGetGlobalObject(Node*);
2909 void compileGetGlobalThis(Node*);
2911 void compileGetArrayLength(Node*);
2913 void compileCheckTypeInfoFlags(Node*);
2914 void compileCheckStringIdent(Node*);
2916 void compileParseInt(Node*);
2918 void compileValueRep(Node*);
2919 void compileDoubleRep(Node*);
2921 void compileValueToInt32(Node*);
2922 void compileUInt32ToNumber(Node*);
2923 void compileDoubleAsInt32(Node*);
2925 template<typename SnippetGenerator, J_JITOperation_EJJ slowPathFunction>
2926 void emitUntypedBitOp(Node*);
2927 void compileBitwiseOp(Node*);
2929 void emitUntypedRightShiftBitOp(Node*);
2930 void compileShiftOp(Node*);
2932 template <typename Generator, typename RepatchingFunction, typename NonRepatchingFunction>
2933 void compileMathIC(Node*, JITBinaryMathIC<Generator>*, bool needsScratchGPRReg, bool needsScratchFPRReg, RepatchingFunction, NonRepatchingFunction);
2934 template <typename Generator, typename RepatchingFunction, typename NonRepatchingFunction>
2935 void compileMathIC(Node*, JITUnaryMathIC<Generator>*, bool needsScratchGPRReg, RepatchingFunction, NonRepatchingFunction);
2937 void compileArithDoubleUnaryOp(Node*, double (*doubleFunction)(double), double (*operation)(ExecState*, EncodedJSValue));
2938 void compileValueAdd(Node*);
2939 void compileArithAdd(Node*);
2940 void compileMakeRope(Node*);
2941 void compileArithAbs(Node*);
2942 void compileArithClz32(Node*);
2943 void compileArithSub(Node*);
2944 void compileArithNegate(Node*);
2945 void compileArithMul(Node*);
2946 void compileArithDiv(Node*);
2947 void compileArithFRound(Node*);
2948 void compileArithMod(Node*);
2949 void compileArithPow(Node*);
2950 void compileArithRounding(Node*);
2951 void compileArithRandom(Node*);
2952 void compileArithUnary(Node*);
2953 void compileArithSqrt(Node*);
2954 void compileConstantStoragePointer(Node*);
2955 void compileGetIndexedPropertyStorage(Node*);
2956 JITCompiler::Jump jumpForTypedArrayOutOfBounds(Node*, GPRReg baseGPR, GPRReg indexGPR);
2957 JITCompiler::Jump jumpForTypedArrayIsNeuteredIfOutOfBounds(Node*, GPRReg baseGPR, JITCompiler::Jump outOfBounds);
2958 void emitTypedArrayBoundsCheck(Node*, GPRReg baseGPR, GPRReg indexGPR);
2959 void compileGetTypedArrayByteOffset(Node*);
2960 void compileGetByValOnIntTypedArray(Node*, TypedArrayType);
2961 void compilePutByValForIntTypedArray(GPRReg base, GPRReg property, Node*, TypedArrayType);
2962 void compileGetByValOnFloatTypedArray(Node*, TypedArrayType);
2963 void compilePutByValForFloatTypedArray(GPRReg base, GPRReg property, Node*, TypedArrayType);
2964 void compileGetByValForObjectWithString(Node*);
2965 void compileGetByValForObjectWithSymbol(Node*);
2966 void compilePutByValForCellWithString(Node*, Edge& child1, Edge& child2, Edge& child3);
2967 void compilePutByValForCellWithSymbol(Node*, Edge& child1, Edge& child2, Edge& child3);
2968 // If this returns false it means that we terminated speculative execution.
2969 bool getIntTypedArrayStoreOperand(
2970 GPRTemporary& value,
2972 #if USE(JSVALUE32_64)
2973 GPRTemporary& propertyTag,
2974 GPRTemporary& valueTag,
2976 Edge valueUse, JITCompiler::JumpList& slowPathCases, bool isClamped = false);
2977 void loadFromIntTypedArray(GPRReg storageReg, GPRReg propertyReg, GPRReg resultReg, TypedArrayType);
2978 void setIntTypedArrayLoadResult(Node*, GPRReg resultReg, TypedArrayType, bool canSpeculate = false);
2979 template <typename ClassType> void compileNewFunctionCommon(GPRReg, RegisteredStructure, GPRReg, GPRReg, GPRReg, MacroAssembler::JumpList&, size_t, FunctionExecutable*, ptrdiff_t, ptrdiff_t, ptrdiff_t);
2980 void compileNewFunction(Node*);
2981 void compileSetFunctionName(Node*);
2982 void compileForwardVarargs(Node*);
2983 void compileCreateActivation(Node*);
2984 void compileCreateDirectArguments(Node*);
2985 void compileGetFromArguments(Node*);
2986 void compilePutToArguments(Node*);
2987 void compileGetArgument(Node*);
2988 void compileCreateScopedArguments(Node*);
2989 void compileCreateClonedArguments(Node*);
2990 void compileCreateRest(Node*);
2991 void compileSpread(Node*);
2992 void compileNewArrayWithSpread(Node*);
2993 void compileGetRestLength(Node*);
2994 void compileArraySlice(Node*);
2995 void compileArrayIndexOf(Node*);
2996 void compileArrayPush(Node*);
2997 void compileNotifyWrite(Node*);
2998 bool compileRegExpExec(Node*);
2999 void compileIsObjectOrNull(Node*);
3000 void compileIsFunction(Node*);
3001 void compileTypeOf(Node*);
3002 void compileCheckStructure(Node*);
3003 void emitStructureCheck(Node*, GPRReg cellGPR, GPRReg tempGPR);
3004 void compilePutAccessorById(Node*);
3005 void compilePutGetterSetterById(Node*);
3006 void compilePutAccessorByVal(Node*);
3007 void compileGetRegExpObjectLastIndex(Node*);
3008 void compileSetRegExpObjectLastIndex(Node*);
3009 void compileLazyJSConstant(Node*);
3010 void compileMaterializeNewObject(Node*);
3011 void compileRecordRegExpCachedResult(Node*);
3012 void compileToObjectOrCallObjectConstructor(Node*);
3013 void compileResolveScope(Node*);
3014 void compileResolveScopeForHoistingFuncDeclInEval(Node*);
3015 void compileGetDynamicVar(Node*);
3016 void compilePutDynamicVar(Node*);
3017 void compileCompareEqPtr(Node*);
3018 void compileDefineDataProperty(Node*);
3019 void compileDefineAccessorProperty(Node*);
3020 void compileStringSlice(Node*);
3021 void compileToLowerCase(Node*);
3022 void compileThrow(Node*);
3023 void compileThrowStaticError(Node*);
3025 void moveTrueTo(GPRReg);
3026 void moveFalseTo(GPRReg);
3027 void blessBoolean(GPRReg);
3029 // Allocator for a cell of a specific size.
3030 template <typename StructureType> // StructureType can be GPR or ImmPtr.
3031 void emitAllocateJSCell(
3032 GPRReg resultGPR, MarkedAllocator* allocator, GPRReg allocatorGPR, StructureType structure,
3033 GPRReg scratchGPR, MacroAssembler::JumpList& slowPath)
3035 m_jit.emitAllocateJSCell(resultGPR, allocator, allocatorGPR, structure, scratchGPR, slowPath);
3038 // Allocator for an object of a specific size.
3039 template <typename StructureType, typename StorageType> // StructureType and StorageType can be GPR or ImmPtr.
3040 void emitAllocateJSObject(
3041 GPRReg resultGPR, MarkedAllocator* allocator, GPRReg allocatorGPR, StructureType structure,
3042 StorageType storage, GPRReg scratchGPR, MacroAssembler::JumpList& slowPath)
3044 m_jit.emitAllocateJSObject(
3045 resultGPR, allocator, allocatorGPR, structure, storage, scratchGPR, slowPath);
3048 template <typename ClassType, typename StructureType, typename StorageType> // StructureType and StorageType can be GPR or ImmPtr.
3049 void emitAllocateJSObjectWithKnownSize(
3050 GPRReg resultGPR, StructureType structure, StorageType storage, GPRReg scratchGPR1,
3051 GPRReg scratchGPR2, MacroAssembler::JumpList& slowPath, size_t size)
3053 m_jit.emitAllocateJSObjectWithKnownSize<ClassType>(*m_jit.vm(), resultGPR, structure, storage, scratchGPR1, scratchGPR2, slowPath, size);
3056 // Convenience allocator for a built-in object.
3057 template <typename ClassType, typename StructureType, typename StorageType> // StructureType and StorageType can be GPR or ImmPtr.
3058 void emitAllocateJSObject(GPRReg resultGPR, StructureType structure, StorageType storage,
3059 GPRReg scratchGPR1, GPRReg scratchGPR2, MacroAssembler::JumpList& slowPath)
3061 m_jit.emitAllocateJSObject<ClassType>(*m_jit.vm(), resultGPR, structure, storage, scratchGPR1, scratchGPR2, slowPath);
3064 template <typename ClassType, typename StructureType> // StructureType and StorageType can be GPR or ImmPtr.
3065 void emitAllocateVariableSizedJSObject(GPRReg resultGPR, StructureType structure, GPRReg allocationSize, GPRReg scratchGPR1, GPRReg scratchGPR2, MacroAssembler::JumpList& slowPath)
3067 m_jit.emitAllocateVariableSizedJSObject<ClassType>(*m_jit.vm(), resultGPR, structure, allocationSize, scratchGPR1, scratchGPR2, slowPath);
3070 template<typename ClassType>
3071 void emitAllocateDestructibleObject(GPRReg resultGPR, RegisteredStructure structure,
3072 GPRReg scratchGPR1, GPRReg scratchGPR2, MacroAssembler::JumpList& slowPath)
3074 m_jit.emitAllocateDestructibleObject<ClassType>(*m_jit.vm(), resultGPR, structure.get(), scratchGPR1, scratchGPR2, slowPath);
3077 void emitAllocateRawObject(GPRReg resultGPR, RegisteredStructure, GPRReg storageGPR, unsigned numElements, unsigned vectorLength);
3079 void emitGetLength(InlineCallFrame*, GPRReg lengthGPR, bool includeThis = false);
3080 void emitGetLength(CodeOrigin, GPRReg lengthGPR, bool includeThis = false);
3081 void emitGetCallee(CodeOrigin, GPRReg calleeGPR);
3082 void emitGetArgumentStart(CodeOrigin, GPRReg startGPR);
3083 void emitPopulateSliceIndex(Edge&, GPRReg length, GPRReg result);
3085 // Generate an OSR exit fuzz check. Returns Jump() if OSR exit fuzz is not enabled, or if
3086 // it's in training mode.
3087 MacroAssembler::Jump emitOSRExitFuzzCheck();
3089 // Add a speculation check.
3090 void speculationCheck(ExitKind, JSValueSource, Node*, MacroAssembler::Jump jumpToFail);
3091 void speculationCheck(ExitKind, JSValueSource, Node*, const MacroAssembler::JumpList& jumpsToFail);
3093 // Add a speculation check without additional recovery, and with a promise to supply a jump later.
3094 OSRExitJumpPlaceholder speculationCheck(ExitKind, JSValueSource, Node*);
3095 OSRExitJumpPlaceholder speculationCheck(ExitKind, JSValueSource, Edge);
3096 void speculationCheck(ExitKind, JSValueSource, Edge, MacroAssembler::Jump jumpToFail);
3097 void speculationCheck(ExitKind, JSValueSource, Edge, const MacroAssembler::JumpList& jumpsToFail);
3098 // Add a speculation check with additional recovery.
3099 void speculationCheck(ExitKind, JSValueSource, Node*, MacroAssembler::Jump jumpToFail, const SpeculationRecovery&);
3100 void speculationCheck(ExitKind, JSValueSource, Edge, MacroAssembler::Jump jumpToFail, const SpeculationRecovery&);
3102 void emitInvalidationPoint(Node*);
3104 void unreachable(Node*);
3106 // Called when we statically determine that a speculation will fail.
3107 void terminateSpeculativeExecution(ExitKind, JSValueRegs, Node*);
3108 void terminateSpeculativeExecution(ExitKind, JSValueRegs, Edge);
3110 // Helpers for performing type checks on an edge stored in the given registers.
3111 bool needsTypeCheck(Edge edge, SpeculatedType typesPassedThrough) { return m_interpreter.needsTypeCheck(edge, typesPassedThrough); }
3112 void typeCheck(JSValueSource, Edge, SpeculatedType typesPassedThrough, MacroAssembler::Jump jumpToFail, ExitKind = BadType);
3114 void speculateCellTypeWithoutTypeFiltering(Edge, GPRReg cellGPR, JSType);
3115 void speculateCellType(Edge, GPRReg cellGPR, SpeculatedType, JSType);
3117 void speculateInt32(Edge);
3119 void convertAnyInt(Edge, GPRReg resultGPR);
3120 void speculateAnyInt(Edge);
3121 void speculateInt32(Edge, JSValueRegs);
3122 void speculateDoubleRepAnyInt(Edge);
3123 #endif // USE(JSVALUE64)
3124 void speculateNumber(Edge);
3125 void speculateRealNumber(Edge);
3126 void speculateDoubleRepReal(Edge);
3127 void speculateBoolean(Edge);
3128 void speculateCell(Edge);
3129 void speculateCellOrOther(Edge);
3130 void speculateObject(Edge, GPRReg cell);
3131 void speculateObject(Edge);
3132 void speculateArray(Edge, GPRReg cell);
3133 void speculateArray(Edge);
3134 void speculateFunction(Edge, GPRReg cell);
3135 void speculateFunction(Edge);
3136 void speculateFinalObject(Edge, GPRReg cell);
3137 void speculateFinalObject(Edge);
3138 void speculateRegExpObject(Edge, GPRReg cell);
3139 void speculateRegExpObject(Edge);
3140 void speculateProxyObject(Edge, GPRReg cell);
3141 void speculateProxyObject(Edge);
3142 void speculateDerivedArray(Edge, GPRReg cell);
3143 void speculateDerivedArray(Edge);
3144 void speculateMapObject(Edge);
3145 void speculateMapObject(Edge, GPRReg cell);
3146 void speculateSetObject(Edge);
3147 void speculateSetObject(Edge, GPRReg cell);
3148 void speculateWeakMapObject(Edge);
3149 void speculateWeakMapObject(Edge, GPRReg cell);
3150 void speculateWeakSetObject(Edge);
3151 void speculateWeakSetObject(Edge, GPRReg cell);
3152 void speculateObjectOrOther(Edge);
3153 void speculateString(Edge edge, GPRReg cell);
3154 void speculateStringIdentAndLoadStorage(Edge edge, GPRReg string, GPRReg storage);
3155 void speculateStringIdent(Edge edge, GPRReg string);
3156 void speculateStringIdent(Edge);
3157 void speculateString(Edge);
3158 void speculateStringOrOther(Edge, JSValueRegs, GPRReg scratch);
3159 void speculateStringOrOther(Edge);
3160 void speculateNotStringVar(Edge);
3161 void speculateNotSymbol(Edge);
3162 template<typename StructureLocationType>
3163 void speculateStringObjectForStructure(Edge, StructureLocationType);
3164 void speculateStringObject(Edge, GPRReg);
3165 void speculateStringObject(Edge);
3166 void speculateStringOrStringObject(Edge);
3167 void speculateSymbol(Edge, GPRReg cell);
3168 void speculateSymbol(Edge);
3169 void speculateNotCell(Edge, JSValueRegs);
3170 void speculateNotCell(Edge);
3171 void speculateOther(Edge, JSValueRegs, GPRReg temp);
3172 void speculateOther(Edge, JSValueRegs);
3173 void speculateOther(Edge);
3174 void speculateMisc(Edge, JSValueRegs);
3175 void speculateMisc(Edge);
3176 void speculate(Node*, Edge);
3178 JITCompiler::Jump jumpSlowForUnwantedArrayMode(GPRReg tempWithIndexingTypeReg, ArrayMode, IndexingType);
3179 JITCompiler::JumpList jumpSlowForUnwantedArrayMode(GPRReg tempWithIndexingTypeReg, ArrayMode);
3180 void checkArray(Node*);
3181 void arrayify(Node*, GPRReg baseReg, GPRReg propertyReg);
3182 void arrayify(Node*);
3184 template<bool strict>
3185 GPRReg fillSpeculateInt32Internal(Edge, DataFormat& returnFormat);
3187 void cageTypedArrayStorage(GPRReg);
3189 // It is possible, during speculative generation, to reach a situation in which we
3190 // can statically determine a speculation will fail (for example, when two nodes
3191 // will make conflicting speculations about the same operand). In such cases this
3192 // flag is cleared, indicating no further code generation should take place.
3195 void recordSetLocal(
3196 VirtualRegister bytecodeReg, VirtualRegister machineReg, DataFormat format)
3198 m_stream->appendAndLog(VariableEvent::setLocal(bytecodeReg, machineReg, format));
3201 void recordSetLocal(DataFormat format)
3203 VariableAccessData* variable = m_currentNode->variableAccessData();
3204 recordSetLocal(variable->local(), variable->machineLocal(), format);
3207 GenerationInfo& generationInfoFromVirtualRegister(VirtualRegister virtualRegister)
3209 return m_generationInfo[virtualRegister.toLocal()];
3212 GenerationInfo& generationInfo(Node* node)
3214 return generationInfoFromVirtualRegister(node->virtualRegister());
3217 GenerationInfo& generationInfo(Edge edge)
3219 return generationInfo(edge.node());
3222 // The JIT, while also provides MacroAssembler functionality.
3225 // The current node being generated.
3226 BasicBlock* m_block;
3227 Node* m_currentNode;
3228 NodeType m_lastGeneratedNode;
3229 unsigned m_indexInBlock;
3230 // Virtual and physical register maps.
3231 Vector<GenerationInfo, 32> m_generationInfo;
3232 RegisterBank<GPRInfo> m_gprs;
3233 RegisterBank<FPRInfo> m_fprs;
3235 Vector<MacroAssembler::Label> m_osrEntryHeads;
3237 struct BranchRecord {
3238 BranchRecord(MacroAssembler::Jump jump, BasicBlock* destination)
3240 , destination(destination)
3244 MacroAssembler::Jump jump;
3245 BasicBlock* destination;
3247 Vector<BranchRecord, 8> m_branches;
3249 NodeOrigin m_origin;
3251 InPlaceAbstractState m_state;
3252 AbstractInterpreter<InPlaceAbstractState> m_interpreter;
3254 VariableEventStream* m_stream;
3255 MinifiedGraph* m_minifiedGraph;
3257 Vector<std::unique_ptr<SlowPathGenerator>, 8> m_slowPathGenerators;
3258 struct SlowPathLambda {
3259 std::function<void()> generator;
3261 unsigned streamIndex;
3263 Vector<SlowPathLambda> m_slowPathLambdas;
3264 Vector<SilentRegisterSavePlan> m_plans;
3265 std::optional<unsigned> m_outOfLineStreamIndex;
3269 // === Operand types ===
3271 // These classes are used to lock the operands to a node into machine
3272 // registers. These classes implement of pattern of locking a value
3273 // into register at the point of construction only if it is already in
3274 // registers, and otherwise loading it lazily at the point it is first
3275 // used. We do so in order to attempt to avoid spilling one operand
3276 // in order to make space available for another.
3278 class JSValueOperand {
3280 explicit JSValueOperand(SpeculativeJIT* jit, Edge edge, OperandSpeculationMode mode = AutomaticOperandSpeculation)
3284 , m_gprOrInvalid(InvalidGPRReg)
3285 #elif USE(JSVALUE32_64)
3292 ASSERT_UNUSED(mode, mode == ManualOperandSpeculation || edge.useKind() == UntypedUse);
3294 if (jit->isFilled(node()))
3296 #elif USE(JSVALUE32_64)
3297 m_register.pair.tagGPR = InvalidGPRReg;
3298 m_register.pair.payloadGPR = InvalidGPRReg;
3299 if (jit->isFilled(node()))
3304 explicit JSValueOperand(JSValueOperand&& other)
3305 : m_jit(other.m_jit)
3306 , m_edge(other.m_edge)
3309 m_gprOrInvalid = other.m_gprOrInvalid;
3310 #elif USE(JSVALUE32_64)
3311 m_register.pair.tagGPR = InvalidGPRReg;
3312 m_register.pair.payloadGPR = InvalidGPRReg;
3313 m_isDouble = other.m_isDouble;
3317 m_register.fpr = other.m_register.fpr;
3319 m_register.pair = other.m_register.pair;
3322 other.m_edge = Edge();
3324 other.m_gprOrInvalid = InvalidGPRReg;
3325 #elif USE(JSVALUE32_64)
3326 other.m_isDouble = false;
3335 ASSERT(m_gprOrInvalid != InvalidGPRReg);
3336 m_jit->unlock(m_gprOrInvalid);
3337 #elif USE(JSVALUE32_64)
3339 ASSERT(m_register.fpr != InvalidFPRReg);
3340 m_jit->unlock(m_register.fpr);
3342 ASSERT(m_register.pair.tagGPR != InvalidGPRReg && m_register.pair.payloadGPR != InvalidGPRReg);
3343 m_jit->unlock(m_register.pair.tagGPR);
3344 m_jit->unlock(m_register.pair.payloadGPR);
3356 return edge().node();
3362 if (m_gprOrInvalid == InvalidGPRReg)
3363 m_gprOrInvalid = m_jit->fillJSValue(m_edge);
3364 return m_gprOrInvalid;
3366 JSValueRegs jsValueRegs()
3368 return JSValueRegs(gpr());
3370 #elif USE(JSVALUE32_64)
3371 bool isDouble() { return m_isDouble; }
3375 if (m_register.pair.tagGPR == InvalidGPRReg && m_register.pair.payloadGPR == InvalidGPRReg)
3376 m_isDouble = !m_jit->fillJSValue(m_edge, m_register.pair.tagGPR, m_register.pair.payloadGPR, m_register.fpr);
3382 ASSERT(!m_isDouble);
3383 return m_register.pair.tagGPR;
3389 ASSERT(!m_isDouble);
3390 return m_register.pair.payloadGPR;
3393 JSValueRegs jsValueRegs()
3395 return JSValueRegs(tagGPR(), payloadGPR());
3398 GPRReg gpr(WhichValueWord which)
3400 return jsValueRegs().gpr(which);
3407 return m_register.fpr;
3417 SpeculativeJIT* m_jit;
3420 GPRReg m_gprOrInvalid;
3421 #elif USE(JSVALUE32_64)
3433 class StorageOperand {
3435 explicit StorageOperand(SpeculativeJIT* jit, Edge edge)
3438 , m_gprOrInvalid(InvalidGPRReg)
3441 ASSERT(edge.useKind() == UntypedUse || edge.useKind() == KnownCellUse);
3442 if (jit->isFilled(node()))
3448 ASSERT(m_gprOrInvalid != InvalidGPRReg);
3449 m_jit->unlock(m_gprOrInvalid);
3459 return edge().node();
3464 if (m_gprOrInvalid == InvalidGPRReg)
3465 m_gprOrInvalid = m_jit->fillStorage(edge());
3466 return m_gprOrInvalid;
3475 SpeculativeJIT* m_jit;
3477 GPRReg m_gprOrInvalid;
3481 // === Temporaries ===
3483 // These classes are used to allocate temporary registers.
3484 // A mechanism is provided to attempt to reuse the registers
3485 // currently allocated to child nodes whose value is consumed
3486 // by, and not live after, this operation.
3488 enum ReuseTag { Reuse };
3490 class GPRTemporary {
3493 GPRTemporary(SpeculativeJIT*);
3494 GPRTemporary(SpeculativeJIT*, GPRReg specific);
3495 template<typename T>
3496 GPRTemporary(SpeculativeJIT* jit, ReuseTag, T& operand)
3498 , m_gpr(InvalidGPRReg)
3500 if (m_jit->canReuse(operand.node()))
3501 m_gpr = m_jit->reuse(operand.gpr());
3503 m_gpr = m_jit->allocate();
3505 template<typename T1, typename T2>
3506 GPRTemporary(SpeculativeJIT* jit, ReuseTag, T1& op1, T2& op2)
3508 , m_gpr(InvalidGPRReg)
3510 if (m_jit->canReuse(op1.node()))
3511 m_gpr = m_jit->reuse(op1.gpr());
3512 else if (m_jit->canReuse(op2.node()))
3513 m_gpr = m_jit->reuse(op2.gpr());
3514 else if (m_jit->canReuse(op1.node(), op2.node()) && op1.gpr() == op2.gpr())
3515 m_gpr = m_jit->reuse(op1.gpr());
3517 m_gpr = m_jit->allocate();
3519 #if USE(JSVALUE32_64)
3520 GPRTemporary(SpeculativeJIT*, ReuseTag, JSValueOperand&, WhichValueWord);
3523 GPRTemporary(GPRTemporary& other) = delete;
3525 GPRTemporary(GPRTemporary&& other)
3527 ASSERT(other.m_jit);
3528 ASSERT(other.m_gpr != InvalidGPRReg);
3529 m_jit = other.m_jit;
3530 m_gpr = other.m_gpr;
3531 other.m_jit = nullptr;
3532 other.m_gpr = InvalidGPRReg;
3535 GPRTemporary& operator=(GPRTemporary&& other)
3538 ASSERT(m_gpr == InvalidGPRReg);
3539 std::swap(m_jit, other.m_jit);
3540 std::swap(m_gpr, other.m_gpr);
3544 void adopt(GPRTemporary&);
3548 if (m_jit && m_gpr != InvalidGPRReg)
3549 m_jit->unlock(gpr());
3558 SpeculativeJIT* m_jit;
3562 class JSValueRegsTemporary {
3564 JSValueRegsTemporary();
3565 JSValueRegsTemporary(SpeculativeJIT*);
3566 template<typename T>
3567 JSValueRegsTemporary(SpeculativeJIT*, ReuseTag, T& operand, WhichValueWord resultRegWord = PayloadWord);
3568 JSValueRegsTemporary(SpeculativeJIT*, ReuseTag, JSValueOperand&);
3569 ~JSValueRegsTemporary();
3577 GPRTemporary m_payloadGPR;
3578 GPRTemporary m_tagGPR;
3582 class FPRTemporary {
3583 WTF_MAKE_NONCOPYABLE(FPRTemporary);
3585 FPRTemporary(FPRTemporary&&);
3586 FPRTemporary(SpeculativeJIT*);
3587 FPRTemporary(SpeculativeJIT*, SpeculateDoubleOperand&);
3588 FPRTemporary(SpeculativeJIT*, SpeculateDoubleOperand&, SpeculateDoubleOperand&);
3589 #if USE(JSVALUE32_64)
3590 FPRTemporary(SpeculativeJIT*, JSValueOperand&);
3596 m_jit->unlock(fpr());
3602 ASSERT(m_fpr != InvalidFPRReg);
3607 FPRTemporary(SpeculativeJIT* jit, FPRReg lockedFPR)
3614 SpeculativeJIT* m_jit;
3621 // These classes lock the result of a call to a C++ helper function.
3623 class GPRFlushedCallResult : public GPRTemporary {
3625 GPRFlushedCallResult(SpeculativeJIT* jit)
3626 : GPRTemporary(jit, GPRInfo::returnValueGPR)
3631 #if USE(JSVALUE32_64)
3632 class GPRFlushedCallResult2 : public GPRTemporary {
3634 GPRFlushedCallResult2(SpeculativeJIT* jit)
3635 : GPRTemporary(jit, GPRInfo::returnValueGPR2)
3641 class FPRResult : public FPRTemporary {
3643 FPRResult(SpeculativeJIT* jit)
3644 : FPRTemporary(jit, lockedResult(jit))
3649 static FPRReg lockedResult(SpeculativeJIT* jit)
3651 jit->lock(FPRInfo::returnValueFPR);
3652 return FPRInfo::returnValueFPR;
3657 // === Speculative Operand types ===
3659 // SpeculateInt32Operand, SpeculateStrictInt32Operand and SpeculateCellOperand.
3661 // These are used to lock the operands to a node into machine registers within the
3662 // SpeculativeJIT. The classes operate like those above, however these will
3663 // perform a speculative check for a more restrictive type than we can statically
3664 // determine the operand to have. If the operand does not have the requested type,
3665 // a bail-out to the non-speculative path will be taken.
3667 class SpeculateInt32Operand {
3669 explicit SpeculateInt32Operand(SpeculativeJIT* jit, Edge edge, OperandSpeculationMode mode = AutomaticOperandSpeculation)
3672 , m_gprOrInvalid(InvalidGPRReg)
3674 , m_format(DataFormatNone)
3678 ASSERT_UNUSED(mode, mode == ManualOperandSpeculation || (edge.useKind() == Int32Use || edge.useKind() == KnownInt32Use));
3679 if (jit->isFilled(node()))
3683 ~SpeculateInt32Operand()
3685 ASSERT(m_gprOrInvalid != InvalidGPRReg);
3686 m_jit->unlock(m_gprOrInvalid);
3696 return edge().node();
3701 gpr(); // m_format is set when m_gpr is locked.
3702 ASSERT(m_format == DataFormatInt32 || m_format == DataFormatJSInt32);
3708 if (m_gprOrInvalid == InvalidGPRReg)
3709 m_gprOrInvalid = m_jit->fillSpeculateInt32(edge(), m_format);
3710 return m_gprOrInvalid;
3719 SpeculativeJIT* m_jit;
3721 GPRReg m_gprOrInvalid;
3722 DataFormat m_format;
3725 class SpeculateStrictInt32Operand {
3727 explicit SpeculateStrictInt32Operand(SpeculativeJIT* jit, Edge edge, OperandSpeculationMode mode = AutomaticOperandSpeculation)
3730 , m_gprOrInvalid(InvalidGPRReg)
3733 ASSERT_UNUSED(mode, mode == ManualOperandSpeculation || (edge.useKind() == Int32Use || edge.useKind() == KnownInt32Use));
3734 if (jit->isFilled(node()))
3738 ~SpeculateStrictInt32Operand()
3740 ASSERT(m_gprOrInvalid != InvalidGPRReg);
3741 m_jit->unlock(m_gprOrInvalid);
3751 return edge().node();
3756 if (m_gprOrInvalid == InvalidGPRReg)
3757 m_gprOrInvalid = m_jit->fillSpeculateInt32Strict(edge());
3758 return m_gprOrInvalid;
3767 SpeculativeJIT* m_jit;
3769 GPRReg m_gprOrInvalid;
3772 // Gives you a canonical Int52 (i.e. it's left-shifted by 16, low bits zero).
3773 class SpeculateInt52Operand {
3775 explicit SpeculateInt52Operand(SpeculativeJIT* jit, Edge edge)
3778 , m_gprOrInvalid(InvalidGPRReg)
3780 RELEASE_ASSERT(edge.useKind() == Int52RepUse);
3781 if (jit->isFilled(node()))
3785 ~SpeculateInt52Operand()
3787 ASSERT(m_gprOrInvalid != InvalidGPRReg);
3788 m_jit->unlock(m_gprOrInvalid);
3798 return edge().node();
3803 if (m_gprOrInvalid == InvalidGPRReg)
3804 m_gprOrInvalid = m_jit->fillSpeculateInt52(edge(), DataFormatInt52);
3805 return m_gprOrInvalid;
3814 SpeculativeJIT* m_jit;
3816 GPRReg m_gprOrInvalid;
3819 // Gives you a strict Int52 (i.e. the payload is in the low 48 bits, high 16 bits are sign-extended).
3820 class SpeculateStrictInt52Operand {
3822 explicit SpeculateStrictInt52Operand(SpeculativeJIT* jit, Edge edge)
3825 , m_gprOrInvalid(InvalidGPRReg)
3827 RELEASE_ASSERT(edge.useKind() == Int52RepUse);
3828 if (jit->isFilled(node()))
3832 ~SpeculateStrictInt52Operand()
3834 ASSERT(m_gprOrInvalid != InvalidGPRReg);
3835 m_jit->unlock(m_gprOrInvalid);