Source/JavaScriptCore/ChangeLog

 12019-01-17 Mark Lam <mark.lam@apple.com>
 2
 3 Audit bytecode fields and ensure that LLInt instructions for accessing them are appropriate.
 4 https://bugs.webkit.org/show_bug.cgi?id=193557
 5 <rdar://problem/47369125>
 6
 7 Reviewed by NOBODY (OOPS!).
 8
 9 1. Rename some bytecode fields so that it's easier to discern whether the LLInt
 10 is accessing them the right way:
 11 - distinguish between targetVirtualRegister and targetLabel.
 12 - name all StructureID fields as structureID (oldStructureID, newStructureID)
 13 instead of structure (oldStructure, newStructure).
 14
 15 2. Use bitwise_cast in struct Fits when sizeof(T) == size.
 16 This prevents potential undefined behavior issues arising from doing
 17 assignments with reinterpret_cast'ed pointers.
 18
 19 3. Make Special::Pointer an unsigned type (previously int).
 20 Make ResolveType an unsigned type (previously int).
 21
 22 4. In LowLevelInterpreter*.asm:
 23
 24 - rename the op macro argument to opcodeName or opcodeStruct respectively.
 25 This makes it clearer which argument type the macro is working with.
 26
 27 - rename the name macro argument to opcodeName.
 28
 29 - fix operator types to match the field type being accessed. The following
 30 may have resulted in bugs before:
 31
 32 1. The following should be read with getu() instead of get() because they
 33 are unsigned ints:
 34 OpSwitchImm::m_tableIndex
 35 OpSwitchChar::m_tableIndex
 36 OpGetFromArguments::m_index
 37 OpPutToArguments::m_index
 38 OpGetRestLength::m_numParametersToSkip
 39
 40 OpJneqPtr::m_specialPointer should also be read with getu() though this
 41 wasn't a bug because it was previously an int by default, and is only
 42 changed to an unsigned int in this patch.
 43
 44 2.The following should be read with loadi (not loadp) because they are of
 45 unsigned type (not a pointer):
 46 OpResolveScope::Metadata::m_resolveType
 47 CodeBlock::m_numParameters (see prepareForTailCall)
 48
 49 3. OpPutToScope::Metadata::m_operand should be read with loadp (not loadis)
 50 because it is a uintptr_t.
 51
 52 4. The following should be read with loadi (not loadis) because they are
 53 unsigned ints:
 54 OpNegate::Metadata::m_arithProfile + ArithProfile::m_bits
 55 OpPutById::Metadata::m_oldStructureID
 56 OpPutToScope::Metadata::m_getPutInfo + GetPutInfo::m_operand
 57
 58 These may not have manifested in bugs because the operations that follow
 59 the load are 32-bit instructions which ignore the high word.
 60
 61 5. Give class GetPutInfo a default constructor so that we can use bitwise_cast
 62 on it. Also befriend LLIntOffsetsExtractor so that we can take the offset of
 63 m_operand in it.
 64
 65 * bytecode/ArithProfile.h:
 66 * bytecode/BytecodeList.rb:
 67 * bytecode/BytecodeUseDef.h:
 68 (JSC::computeUsesForBytecodeOffset):
 69 (JSC::computeDefsForBytecodeOffset):
 70 * bytecode/CodeBlock.cpp:
 71 (JSC::CodeBlock::propagateTransitions):
 72 (JSC::CodeBlock::finalizeLLIntInlineCaches):
 73 * bytecode/Fits.h:
 74 * bytecode/GetByIdMetadata.h:
 75 * bytecode/GetByIdStatus.cpp:
 76 (JSC::GetByIdStatus::computeFromLLInt):
 77 * bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.cpp:
 78 (JSC::LLIntPrototypeLoadAdaptiveStructureWatchpoint::clearLLIntGetByIdCache):
 79 * bytecode/PreciseJumpTargetsInlines.h:
 80 (JSC::jumpTargetForInstruction):
 81 (JSC::updateStoredJumpTargetsForInstruction):
 82 * bytecode/PutByIdStatus.cpp:
 83 (JSC::PutByIdStatus::computeFromLLInt):
 84 * bytecode/SpecialPointer.h:
 85 * bytecompiler/BytecodeGenerator.cpp:
 86 (JSC::Label::setLocation):
 87 * dfg/DFGByteCodeParser.cpp:
 88 (JSC::DFG::ByteCodeParser::parseBlock):
 89 * jit/JITArithmetic.cpp:
 90 (JSC::JIT::emit_compareAndJump):
 91 (JSC::JIT::emit_compareUnsignedAndJump):
 92 (JSC::JIT::emit_compareAndJumpSlow):
 93 * jit/JITArithmetic32_64.cpp:
 94 (JSC::JIT::emit_compareAndJump):
 95 (JSC::JIT::emit_compareUnsignedAndJump):
 96 (JSC::JIT::emit_compareAndJumpSlow):
 97 (JSC::JIT::emitBinaryDoubleOp):
 98 * jit/JITOpcodes.cpp:
 99 (JSC::JIT::emit_op_jmp):
 100 (JSC::JIT::emit_op_jfalse):
 101 (JSC::JIT::emit_op_jeq_null):
 102 (JSC::JIT::emit_op_jneq_null):
 103 (JSC::JIT::emit_op_jneq_ptr):
 104 (JSC::JIT::emit_op_jeq):
 105 (JSC::JIT::emit_op_jtrue):
 106 (JSC::JIT::emit_op_jneq):
 107 (JSC::JIT::compileOpStrictEqJump):
 108 (JSC::JIT::emitSlow_op_jstricteq):
 109 (JSC::JIT::emitSlow_op_jnstricteq):
 110 (JSC::JIT::emit_op_check_tdz):
 111 (JSC::JIT::emitSlow_op_jeq):
 112 (JSC::JIT::emitSlow_op_jneq):
 113 (JSC::JIT::emit_op_profile_type):
 114 * jit/JITOpcodes32_64.cpp:
 115 (JSC::JIT::emit_op_jmp):
 116 (JSC::JIT::emit_op_jfalse):
 117 (JSC::JIT::emit_op_jtrue):
 118 (JSC::JIT::emit_op_jeq_null):
 119 (JSC::JIT::emit_op_jneq_null):
 120 (JSC::JIT::emit_op_jneq_ptr):
 121 (JSC::JIT::emit_op_jeq):
 122 (JSC::JIT::emitSlow_op_jeq):
 123 (JSC::JIT::emit_op_jneq):
 124 (JSC::JIT::emitSlow_op_jneq):
 125 (JSC::JIT::compileOpStrictEqJump):
 126 (JSC::JIT::emitSlow_op_jstricteq):
 127 (JSC::JIT::emitSlow_op_jnstricteq):
 128 (JSC::JIT::emit_op_check_tdz):
 129 (JSC::JIT::emit_op_profile_type):
 130 * llint/LLIntSlowPaths.cpp:
 131 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
 132 (JSC::LLInt::setupGetByIdPrototypeCache):
 133 * llint/LowLevelInterpreter.asm:
 134 * llint/LowLevelInterpreter32_64.asm:
 135 * llint/LowLevelInterpreter64.asm:
 136 * runtime/CommonSlowPaths.cpp:
 137 * runtime/GetPutInfo.h:
 138
11392019-01-17 Jer Noble <jer.noble@apple.com>
2140
3141 SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
240135

Source/JavaScriptCore/bytecode/ArithProfile.h

11/*
2  * Copyright (C) 2016 Apple Inc. All rights reserved.
 2 * Copyright (C) 2016-2019 Apple Inc. All rights reserved.
33 *
44 * Redistribution and use in source and binary forms, with or without
55 * modification, are permitted provided that the following conditions

@@private:
306306 void setBit(int mask) { m_bits |= mask; }
307307
308308 uint32_t m_bits { 0 }; // We take care to update m_bits only in a single operation. We don't ever store an inconsistent bit representation to it.
 309
 310 friend class JSC::LLIntOffsetsExtractor;
309311};
310312
311313} // namespace JSC
240135

Source/JavaScriptCore/bytecode/BytecodeList.rb

1 # Copyright (C) 2018 Apple Inc. All rights reserved.
 1# Copyright (C) 2018-2019 Apple Inc. All rights reserved.
22#
33# Redistribution and use in source and binary forms, with or without
44# modification, are permitted provided that the following conditions

@@op :to_this,
142142
143143op :check_tdz,
144144 args: {
145  target: VirtualRegister,
 145 targetVirtualRegister: VirtualRegister,
146146 }
147147
148148op :new_object,

@@op :get_by_id_direct,
449449 },
450450 metadata: {
451451 profile: ValueProfile, # not used in llint
452  structure: StructureID,
 452 structureID: StructureID,
453453 offset: unsigned,
454454 }
455455

@@op :put_by_id,
471471 flags: PutByIdFlags,
472472 },
473473 metadata: {
474  oldStructure: StructureID,
 474 oldStructureID: StructureID,
475475 offset: unsigned,
476  newStructure: StructureID,
 476 newStructureID: StructureID,
477477 structureChain: WriteBarrierBase[StructureChain],
478478 }
479479

@@op :define_accessor_property,
598598
599599op :jmp,
600600 args: {
601  target: BoundLabel,
 601 targetLabel: BoundLabel,
602602 }
603603
604604op :jtrue,
605605 args: {
606606 condition: VirtualRegister,
607  target: BoundLabel,
 607 targetLabel: BoundLabel,
608608 }
609609
610610op :jfalse,
611611 args: {
612612 condition: VirtualRegister,
613  target: BoundLabel,
 613 targetLabel: BoundLabel,
614614 }
615615
616616op :jeq_null,
617617 args: {
618618 value: VirtualRegister,
619  target: BoundLabel,
 619 targetLabel: BoundLabel,
620620 }
621621
622622op :jneq_null,
623623 args: {
624624 value: VirtualRegister,
625  target: BoundLabel,
 625 targetLabel: BoundLabel,
626626 }
627627
628628op :jneq_ptr,
629629 args: {
630630 value: VirtualRegister,
631631 specialPointer: Special::Pointer,
632  target: BoundLabel,
 632 targetLabel: BoundLabel,
633633 },
634634 metadata: {
635635 hasJumped: bool,

@@op_group :BinaryJmp,
655655 args: {
656656 lhs: VirtualRegister,
657657 rhs: VirtualRegister,
658  target: BoundLabel,
 658 targetLabel: BoundLabel,
659659 }
660660
661661op :loop_hint

@@op :end,
965965
966966op :profile_type,
967967 args: {
968  target: VirtualRegister,
 968 targetVirtualRegister: VirtualRegister,
969969 symbolTableOrScopeDepth: int,
970970 flag: ProfileTypeBytecodeFlag,
971971 identifier?: unsigned,
240135

Source/JavaScriptCore/bytecode/BytecodeUseDef.h

@@void computeUsesForBytecodeOffset(Block*
9494
9595 USES(OpGetScope, dst)
9696 USES(OpToThis, srcDst)
97  USES(OpCheckTdz, target)
 97 USES(OpCheckTdz, targetVirtualRegister)
9898 USES(OpIdentityWithProfile, srcDst)
99  USES(OpProfileType, target);
 99 USES(OpProfileType, targetVirtualRegister);
100100 USES(OpThrow, value)
101101 USES(OpThrowStaticError, message)
102102 USES(OpEnd, value)

@@void computeDefsForBytecodeOffset(Block*
448448 DEFS(OpMov, dst)
449449 DEFS(OpNewObject, dst)
450450 DEFS(OpToThis, srcDst)
451  DEFS(OpCheckTdz, target)
 451 DEFS(OpCheckTdz, targetVirtualRegister)
452452 DEFS(OpGetScope, dst)
453453 DEFS(OpCreateDirectArguments, dst)
454454 DEFS(OpCreateScopedArguments, dst)
240135

Source/JavaScriptCore/bytecode/CodeBlock.cpp

@@void CodeBlock::propagateTransitions(con
10951095 auto instruction = m_instructions->at(propertyAccessInstructions[i]);
10961096 if (instruction->is<OpPutById>()) {
10971097 auto& metadata = instruction->as<OpPutById>().metadata(this);
1098  StructureID oldStructureID = metadata.m_oldStructure;
1099  StructureID newStructureID = metadata.m_newStructure;
 1098 StructureID oldStructureID = metadata.m_oldStructureID;
 1099 StructureID newStructureID = metadata.m_newStructureID;
11001100 if (!oldStructureID || !newStructureID)
11011101 continue;
11021102 Structure* oldStructure =

@@void CodeBlock::finalizeLLIntInlineCache
12261226 auto& metadata = curInstruction->as<OpGetById>().metadata(this);
12271227 if (metadata.m_mode != GetByIdMode::Default)
12281228 break;
1229  StructureID oldStructureID = metadata.m_modeMetadata.defaultMode.structure;
 1229 StructureID oldStructureID = metadata.m_modeMetadata.defaultMode.structureID;
12301230 if (!oldStructureID || Heap::isMarked(vm.heap.structureIDTable().get(oldStructureID)))
12311231 break;
12321232 if (Options::verboseOSR())

@@void CodeBlock::finalizeLLIntInlineCache
12361236 }
12371237 case op_get_by_id_direct: {
12381238 auto& metadata = curInstruction->as<OpGetByIdDirect>().metadata(this);
1239  StructureID oldStructureID = metadata.m_structure;
 1239 StructureID oldStructureID = metadata.m_structureID;
12401240 if (!oldStructureID || Heap::isMarked(vm.heap.structureIDTable().get(oldStructureID)))
12411241 break;
12421242 if (Options::verboseOSR())
12431243 dataLogF("Clearing LLInt property access.\n");
1244  metadata.m_structure = 0;
 1244 metadata.m_structureID = 0;
12451245 metadata.m_offset = 0;
12461246 break;
12471247 }
12481248 case op_put_by_id: {
12491249 auto& metadata = curInstruction->as<OpPutById>().metadata(this);
1250  StructureID oldStructureID = metadata.m_oldStructure;
1251  StructureID newStructureID = metadata.m_newStructure;
 1250 StructureID oldStructureID = metadata.m_oldStructureID;
 1251 StructureID newStructureID = metadata.m_newStructureID;
12521252 StructureChain* chain = metadata.m_structureChain.get();
12531253 if ((!oldStructureID || Heap::isMarked(vm.heap.structureIDTable().get(oldStructureID)))
12541254 && (!newStructureID || Heap::isMarked(vm.heap.structureIDTable().get(newStructureID)))

@@void CodeBlock::finalizeLLIntInlineCache
12561256 break;
12571257 if (Options::verboseOSR())
12581258 dataLogF("Clearing LLInt put transition.\n");
1259  metadata.m_oldStructure = 0;
 1259 metadata.m_oldStructureID = 0;
12601260 metadata.m_offset = 0;
1261  metadata.m_newStructure = 0;
 1261 metadata.m_newStructureID = 0;
12621262 metadata.m_structureChain.clear();
12631263 break;
12641264 }
240135

Source/JavaScriptCore/bytecode/Fits.h

11/*
2  * Copyright (C) 2018 Apple Inc. All rights reserved.
 2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
33 *
44 * Redistribution and use in source and binary forms, with or without
55 * modification, are permitted provided that the following conditions

@@template<typename T, OpcodeSize size>
5252struct Fits<T, size, std::enable_if_t<sizeof(T) == size, std::true_type>> {
5353 static bool check(T) { return true; }
5454
55  static typename TypeBySize<size>::type convert(T t) { return *reinterpret_cast<typename TypeBySize<size>::type*>(&t); }
 55 static typename TypeBySize<size>::type convert(T t) { return bitwise_cast<typename TypeBySize<size>::type>(t); }
5656
5757 template<class T1 = T, OpcodeSize size1 = size, typename = std::enable_if_t<!std::is_same<T1, typename TypeBySize<size1>::type>::value, std::true_type>>
58  static T1 convert(typename TypeBySize<size1>::type t) { return *reinterpret_cast<T1*>(&t); }
 58 static T1 convert(typename TypeBySize<size1>::type t) { return bitwise_cast<T1>(t); }
5959};
6060
6161template<typename T, OpcodeSize size>
240135

Source/JavaScriptCore/bytecode/GetByIdMetadata.h

11/*
2  * Copyright (C) 2018 Apple Inc. All rights reserved.
 2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
33 *
44 * Redistribution and use in source and binary forms, with or without
55 * modification, are permitted provided that the following conditions

@@union GetByIdModeMetadata {
3939 { }
4040
4141 struct Default {
42  StructureID structure;
 42 StructureID structureID;
4343 PropertyOffset cachedOffset;
4444 } defaultMode;
4545
4646 struct Unset {
47  StructureID structure;
 47 StructureID structureID;
4848 } unsetMode;
4949
5050 struct ProtoLoad {
51  StructureID structure;
 51 StructureID structureID;
5252 PropertyOffset cachedOffset;
5353 JSObject* cachedSlot;
5454 } protoLoadMode;
240135

Source/JavaScriptCore/bytecode/GetByIdStatus.cpp

@@GetByIdStatus GetByIdStatus::computeFrom
6666 // https://bugs.webkit.org/show_bug.cgi?id=158039
6767 if (metadata.m_mode != GetByIdMode::Default)
6868 return GetByIdStatus(NoInformation, false);
69  structureID = metadata.m_modeMetadata.defaultMode.structure;
 69 structureID = metadata.m_modeMetadata.defaultMode.structureID;
7070 break;
7171 }
7272 case op_get_by_id_direct:
73  structureID = instruction->as<OpGetByIdDirect>().metadata(profiledBlock).m_structure;
 73 structureID = instruction->as<OpGetByIdDirect>().metadata(profiledBlock).m_structureID;
7474 break;
7575 case op_try_get_by_id: {
7676 // FIXME: We should not just bail if we see a try_get_by_id.
240135

Source/JavaScriptCore/bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.cpp

@@void LLIntPrototypeLoadAdaptiveStructure
6161{
6262 metadata.m_mode = GetByIdMode::Default;
6363 metadata.m_modeMetadata.defaultMode.cachedOffset = 0;
64  metadata.m_modeMetadata.defaultMode.structure = 0;
 64 metadata.m_modeMetadata.defaultMode.structureID = 0;
6565}
6666
6767
240135

Source/JavaScriptCore/bytecode/PreciseJumpTargetsInlines.h

@@template<typename Op, typename Block>
108108inline int jumpTargetForInstruction(Block&& codeBlock, const InstructionStream::Ref& instruction)
109109{
110110 auto bytecode = instruction->as<Op>();
111  return jumpTargetForInstruction(codeBlock, instruction, bytecode.m_target);
 111 return jumpTargetForInstruction(codeBlock, instruction, bytecode.m_targetLabel);
112112}
113113
114114template<typename Block, typename Function>

@@inline void updateStoredJumpTargetsForIn
139139 case __op::opcodeID: { \
140140 int32_t target = jumpTargetForInstruction<__op>(codeBlockOrHashMap, instruction); \
141141 int32_t newTarget = function(target); \
142  instruction->cast<__op>()->setTarget(BoundLabel(newTarget), [&]() { \
 142 instruction->cast<__op>()->setTargetLabel(BoundLabel(newTarget), [&]() { \
143143 codeBlock->addOutOfLineJumpTarget(finalOffset + instruction.offset(), newTarget); \
144144 return BoundLabel(); \
145145 }); \
240135

Source/JavaScriptCore/bytecode/PutByIdStatus.cpp

@@PutByIdStatus PutByIdStatus::computeFrom
5555 auto bytecode = instruction->as<OpPutById>();
5656 auto& metadata = bytecode.metadata(profiledBlock);
5757
58  StructureID structureID = metadata.m_oldStructure;
 58 StructureID structureID = metadata.m_oldStructureID;
5959 if (!structureID)
6060 return PutByIdStatus(NoInformation);
6161
6262 Structure* structure = vm.heap.structureIDTable().get(structureID);
6363
64  StructureID newStructureID = metadata.m_newStructure;
 64 StructureID newStructureID = metadata.m_newStructureID;
6565 if (!newStructureID) {
6666 PropertyOffset offset = structure->getConcurrently(uid);
6767 if (!isValidOffset(offset))
240135

Source/JavaScriptCore/bytecode/SpecialPointer.h

11/*
2  * Copyright (C) 2012 Apple Inc. All rights reserved.
 2 * Copyright (C) 2012-2019 Apple Inc. All rights reserved.
33 *
44 * Redistribution and use in source and binary forms, with or without
55 * modification, are permitted provided that the following conditions

@@class CodeBlock;
3131class JSGlobalObject;
3232
3333namespace Special {
34 enum Pointer {
 34enum Pointer : unsigned {
3535 CallFunction,
3636 ApplyFunction,
3737 ObjectConstructor,
240135

Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp

@@void Label::setLocation(BytecodeGenerato
102102
103103#define CASE(__op) \
104104 case __op::opcodeID: \
105  instruction->cast<__op>()->setTarget(BoundLabel(target), [&]() { \
 105 instruction->cast<__op>()->setTargetLabel(BoundLabel(target), [&]() { \
106106 generator.m_codeBlock->addOutOfLineJumpTarget(instruction.offset(), target); \
107107 return BoundLabel(); \
108108 }); \
240135

Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

@@void ByteCodeParser::parseBlock(unsigned
50905090
50915091 case op_check_tdz: {
50925092 auto bytecode = currentInstruction->as<OpCheckTdz>();
5093  addToGraph(CheckNotEmpty, get(bytecode.m_target));
 5093 addToGraph(CheckNotEmpty, get(bytecode.m_targetVirtualRegister));
50945094 NEXT_OPCODE(op_check_tdz);
50955095 }
50965096

@@void ByteCodeParser::parseBlock(unsigned
55985598 case op_profile_type: {
55995599 auto bytecode = currentInstruction->as<OpProfileType>();
56005600 auto& metadata = bytecode.metadata(codeBlock);
5601  Node* valueToProfile = get(bytecode.m_target);
 5601 Node* valueToProfile = get(bytecode.m_targetVirtualRegister);
56025602 addToGraph(ProfileType, OpInfo(metadata.m_typeLocation), valueToProfile);
56035603 NEXT_OPCODE(op_profile_type);
56045604 }

@@void ByteCodeParser::parseBlock(unsigned
56155615 case op_jmp: {
56165616 ASSERT(!m_currentBlock->terminal());
56175617 auto bytecode = currentInstruction->as<OpJmp>();
5618  int relativeOffset = jumpTarget(bytecode.m_target);
 5618 int relativeOffset = jumpTarget(bytecode.m_targetLabel);
56195619 addToGraph(Jump, OpInfo(m_currentIndex + relativeOffset));
56205620 if (relativeOffset <= 0)
56215621 flushForTerminal();

@@void ByteCodeParser::parseBlock(unsigned
56245624
56255625 case op_jtrue: {
56265626 auto bytecode = currentInstruction->as<OpJtrue>();
5627  unsigned relativeOffset = jumpTarget(bytecode.m_target);
 5627 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel);
56285628 Node* condition = get(bytecode.m_condition);
56295629 addToGraph(Branch, OpInfo(branchData(m_currentIndex + relativeOffset, m_currentIndex + currentInstruction->size())), condition);
56305630 LAST_OPCODE(op_jtrue);

@@void ByteCodeParser::parseBlock(unsigned
56325632
56335633 case op_jfalse: {
56345634 auto bytecode = currentInstruction->as<OpJfalse>();
5635  unsigned relativeOffset = jumpTarget(bytecode.m_target);
 5635 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel);
56365636 Node* condition = get(bytecode.m_condition);
56375637 addToGraph(Branch, OpInfo(branchData(m_currentIndex + currentInstruction->size(), m_currentIndex + relativeOffset)), condition);
56385638 LAST_OPCODE(op_jfalse);

@@void ByteCodeParser::parseBlock(unsigned
56405640
56415641 case op_jeq_null: {
56425642 auto bytecode = currentInstruction->as<OpJeqNull>();
5643  unsigned relativeOffset = jumpTarget(bytecode.m_target);
 5643 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel);
56445644 Node* value = get(bytecode.m_value);
56455645 Node* nullConstant = addToGraph(JSConstant, OpInfo(m_constantNull));
56465646 Node* condition = addToGraph(CompareEq, value, nullConstant);

@@void ByteCodeParser::parseBlock(unsigned
56505650
56515651 case op_jneq_null: {
56525652 auto bytecode = currentInstruction->as<OpJneqNull>();
5653  unsigned relativeOffset = jumpTarget(bytecode.m_target);
 5653 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel);
56545654 Node* value = get(bytecode.m_value);
56555655 Node* nullConstant = addToGraph(JSConstant, OpInfo(m_constantNull));
56565656 Node* condition = addToGraph(CompareEq, value, nullConstant);

@@void ByteCodeParser::parseBlock(unsigned
56605660
56615661 case op_jless: {
56625662 auto bytecode = currentInstruction->as<OpJless>();
5663  unsigned relativeOffset = jumpTarget(bytecode.m_target);
 5663 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel);
56645664 Node* op1 = get(bytecode.m_lhs);
56655665 Node* op2 = get(bytecode.m_rhs);
56665666 Node* condition = addToGraph(CompareLess, op1, op2);

@@void ByteCodeParser::parseBlock(unsigned
56705670
56715671 case op_jlesseq: {
56725672 auto bytecode = currentInstruction->as<OpJlesseq>();
5673  unsigned relativeOffset = jumpTarget(bytecode.m_target);
 5673 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel);
56745674 Node* op1 = get(bytecode.m_lhs);
56755675 Node* op2 = get(bytecode.m_rhs);
56765676 Node* condition = addToGraph(CompareLessEq, op1, op2);

@@void ByteCodeParser::parseBlock(unsigned
56805680
56815681 case op_jgreater: {
56825682 auto bytecode = currentInstruction->as<OpJgreater>();
5683  unsigned relativeOffset = jumpTarget(bytecode.m_target);
 5683 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel);
56845684 Node* op1 = get(bytecode.m_lhs);
56855685 Node* op2 = get(bytecode.m_rhs);
56865686 Node* condition = addToGraph(CompareGreater, op1, op2);

@@void ByteCodeParser::parseBlock(unsigned
56905690
56915691 case op_jgreatereq: {
56925692 auto bytecode = currentInstruction->as<OpJgreatereq>();
5693  unsigned relativeOffset = jumpTarget(bytecode.m_target);
 5693 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel);
56945694 Node* op1 = get(bytecode.m_lhs);
56955695 Node* op2 = get(bytecode.m_rhs);
56965696 Node* condition = addToGraph(CompareGreaterEq, op1, op2);

@@void ByteCodeParser::parseBlock(unsigned
57005700
57015701 case op_jeq: {
57025702 auto bytecode = currentInstruction->as<OpJeq>();
5703  unsigned relativeOffset = jumpTarget(bytecode.m_target);
 5703 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel);
57045704 Node* op1 = get(bytecode.m_lhs);
57055705 Node* op2 = get(bytecode.m_rhs);
57065706 Node* condition = addToGraph(CompareEq, op1, op2);

@@void ByteCodeParser::parseBlock(unsigned
57105710
57115711 case op_jstricteq: {
57125712 auto bytecode = currentInstruction->as<OpJstricteq>();
5713  unsigned relativeOffset = jumpTarget(bytecode.m_target);
 5713 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel);
57145714 Node* op1 = get(bytecode.m_lhs);
57155715 Node* op2 = get(bytecode.m_rhs);
57165716 Node* condition = addToGraph(CompareStrictEq, op1, op2);

@@void ByteCodeParser::parseBlock(unsigned
57205720
57215721 case op_jnless: {
57225722 auto bytecode = currentInstruction->as<OpJnless>();
5723  unsigned relativeOffset = jumpTarget(bytecode.m_target);
 5723 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel);
57245724 Node* op1 = get(bytecode.m_lhs);
57255725 Node* op2 = get(bytecode.m_rhs);
57265726 Node* condition = addToGraph(CompareLess, op1, op2);

@@void ByteCodeParser::parseBlock(unsigned
57305730
57315731 case op_jnlesseq: {
57325732 auto bytecode = currentInstruction->as<OpJnlesseq>();
5733  unsigned relativeOffset = jumpTarget(bytecode.m_target);
 5733 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel);
57345734 Node* op1 = get(bytecode.m_lhs);
57355735 Node* op2 = get(bytecode.m_rhs);
57365736 Node* condition = addToGraph(CompareLessEq, op1, op2);

@@void ByteCodeParser::parseBlock(unsigned
57405740
57415741 case op_jngreater: {
57425742 auto bytecode = currentInstruction->as<OpJngreater>();
5743  unsigned relativeOffset = jumpTarget(bytecode.m_target);
 5743 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel);
57445744 Node* op1 = get(bytecode.m_lhs);
57455745 Node* op2 = get(bytecode.m_rhs);
57465746 Node* condition = addToGraph(CompareGreater, op1, op2);

@@void ByteCodeParser::parseBlock(unsigned
57505750
57515751 case op_jngreatereq: {
57525752 auto bytecode = currentInstruction->as<OpJngreatereq>();
5753  unsigned relativeOffset = jumpTarget(bytecode.m_target);
 5753 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel);
57545754 Node* op1 = get(bytecode.m_lhs);
57555755 Node* op2 = get(bytecode.m_rhs);
57565756 Node* condition = addToGraph(CompareGreaterEq, op1, op2);

@@void ByteCodeParser::parseBlock(unsigned
57605760
57615761 case op_jneq: {
57625762 auto bytecode = currentInstruction->as<OpJneq>();
5763  unsigned relativeOffset = jumpTarget(bytecode.m_target);
 5763 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel);
57645764 Node* op1 = get(bytecode.m_lhs);
57655765 Node* op2 = get(bytecode.m_rhs);
57665766 Node* condition = addToGraph(CompareEq, op1, op2);

@@void ByteCodeParser::parseBlock(unsigned
57705770
57715771 case op_jnstricteq: {
57725772 auto bytecode = currentInstruction->as<OpJnstricteq>();
5773  unsigned relativeOffset = jumpTarget(bytecode.m_target);
 5773 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel);
57745774 Node* op1 = get(bytecode.m_lhs);
57755775 Node* op2 = get(bytecode.m_rhs);
57765776 Node* condition = addToGraph(CompareStrictEq, op1, op2);

@@void ByteCodeParser::parseBlock(unsigned
57805780
57815781 case op_jbelow: {
57825782 auto bytecode = currentInstruction->as<OpJbelow>();
5783  unsigned relativeOffset = jumpTarget(bytecode.m_target);
 5783 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel);
57845784 Node* op1 = get(bytecode.m_lhs);
57855785 Node* op2 = get(bytecode.m_rhs);
57865786 Node* condition = addToGraph(CompareBelow, op1, op2);

@@void ByteCodeParser::parseBlock(unsigned
57905790
57915791 case op_jbeloweq: {
57925792 auto bytecode = currentInstruction->as<OpJbeloweq>();
5793  unsigned relativeOffset = jumpTarget(bytecode.m_target);
 5793 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel);
57945794 Node* op1 = get(bytecode.m_lhs);
57955795 Node* op2 = get(bytecode.m_rhs);
57965796 Node* condition = addToGraph(CompareBelowEq, op1, op2);

@@void ByteCodeParser::parseBlock(unsigned
61076107 JSCell* actualPointer = static_cast<JSCell*>(
61086108 actualPointerFor(m_inlineStackTop->m_codeBlock, specialPointer));
61096109 FrozenValue* frozenPointer = m_graph.freeze(actualPointer);
6110  unsigned relativeOffset = jumpTarget(bytecode.m_target);
 6110 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel);
61116111 Node* child = get(bytecode.m_value);
61126112 if (bytecode.metadata(codeBlock).m_hasJumped) {
61136113 Node* condition = addToGraph(CompareEqPtr, OpInfo(frozenPointer), child);
240135

Source/JavaScriptCore/jit/JITArithmetic32_64.cpp

@@void JIT::emit_compareAndJump(const Inst
5050 auto bytecode = instruction->as<Op>();
5151 int op1 = bytecode.m_lhs.offset();
5252 int op2 = bytecode.m_rhs.offset();
53  unsigned target = jumpTarget(instruction, bytecode.m_target);
 53 unsigned target = jumpTarget(instruction, bytecode.m_targetLabel);
5454
5555 // Character less.
5656 if (isOperandConstantChar(op1)) {

@@void JIT::emit_compareUnsignedAndJump(co
104104 auto bytecode = instruction->as<Op>();
105105 int op1 = bytecode.m_lhs.offset();
106106 int op2 = bytecode.m_rhs.offset();
107  unsigned target = jumpTarget(instruction, bytecode.m_target);
 107 unsigned target = jumpTarget(instruction, bytecode.m_targetLabel);
108108
109109 if (isOperandConstantInt(op1)) {
110110 emitLoad(op2, regT3, regT2);

@@void JIT::emit_compareAndJumpSlow(const
145145 auto bytecode = instruction->as<Op>();
146146 int op1 = bytecode.m_lhs.offset();
147147 int op2 = bytecode.m_rhs.offset();
148  unsigned target = jumpTarget(instruction, bytecode.m_target);
 148 unsigned target = jumpTarget(instruction, bytecode.m_targetLabel);
149149
150150 linkAllSlowCases(iter);
151151

@@void JIT::emitBinaryDoubleOp(const Instr
199199
200200 auto bytecode = instruction->as<Op>();
201201 int opcodeID = Op::opcodeID;
202  int target = jumpTarget(instruction, bytecode.m_target);
 202 int target = jumpTarget(instruction, bytecode.m_targetLabel);
203203 int op1 = bytecode.m_lhs.offset();
204204 int op2 = bytecode.m_rhs.offset();
205205
240135

Source/JavaScriptCore/jit/JITArithmetic.cpp

@@void JIT::emit_compareAndJump(const Inst
178178 auto bytecode = instruction->as<Op>();
179179 int op1 = bytecode.m_lhs.offset();
180180 int op2 = bytecode.m_rhs.offset();
181  unsigned target = jumpTarget(instruction, bytecode.m_target);
 181 unsigned target = jumpTarget(instruction, bytecode.m_targetLabel);
182182 if (isOperandConstantChar(op1)) {
183183 emitGetVirtualRegister(op2, regT0);
184184 addSlowCase(branchIfNotCell(regT0));

@@void JIT::emit_compareUnsignedAndJump(co
225225 auto bytecode = instruction->as<Op>();
226226 int op1 = bytecode.m_lhs.offset();
227227 int op2 = bytecode.m_rhs.offset();
228  unsigned target = jumpTarget(instruction, bytecode.m_target);
 228 unsigned target = jumpTarget(instruction, bytecode.m_targetLabel);
229229 if (isOperandConstantInt(op2)) {
230230 emitGetVirtualRegister(op1, regT0);
231231 int32_t op2imm = getOperandConstantInt(op2);

@@void JIT::emit_compareAndJumpSlow(const
269269 auto bytecode = instruction->as<Op>();
270270 int op1 = bytecode.m_lhs.offset();
271271 int op2 = bytecode.m_rhs.offset();
272  unsigned target = jumpTarget(instruction, bytecode.m_target);
 272 unsigned target = jumpTarget(instruction, bytecode.m_targetLabel);
273273
274274 // We generate inline code for the following cases in the slow path:
275275 // - floating-point number to constant int immediate
240135

Source/JavaScriptCore/jit/JITOpcodes32_64.cpp

@@void JIT::emit_op_end(const Instruction*
7474void JIT::emit_op_jmp(const Instruction* currentInstruction)
7575{
7676 auto bytecode = currentInstruction->as<OpJmp>();
77  unsigned target = jumpTarget(currentInstruction, bytecode.m_target);
 77 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel);
7878 addJump(jump(), target);
7979}
8080

@@void JIT::emit_op_jfalse(const Instructi
372372{
373373 auto bytecode = currentInstruction->as<OpJfalse>();
374374 int cond = bytecode.m_condition.offset();
375  unsigned target = jumpTarget(currentInstruction, bytecode.m_target);
 375 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel);
376376
377377 emitLoad(cond, regT1, regT0);
378378

@@void JIT::emit_op_jtrue(const Instructio
387387{
388388 auto bytecode = currentInstruction->as<OpJtrue>();
389389 int cond = bytecode.m_condition.offset();
390  unsigned target = jumpTarget(currentInstruction, bytecode.m_target);
 390 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel);
391391
392392 emitLoad(cond, regT1, regT0);
393393 bool shouldCheckMasqueradesAsUndefined = true;

@@void JIT::emit_op_jeq_null(const Instruc
401401{
402402 auto bytecode = currentInstruction->as<OpJeqNull>();
403403 int src = bytecode.m_value.offset();
404  unsigned target = jumpTarget(currentInstruction, bytecode.m_target);
 404 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel);
405405
406406 emitLoad(src, regT1, regT0);
407407

@@void JIT::emit_op_jneq_null(const Instru
427427{
428428 auto bytecode = currentInstruction->as<OpJneqNull>();
429429 int src = bytecode.m_value.offset();
430  unsigned target = jumpTarget(currentInstruction, bytecode.m_target);
 430 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel);
431431
432432 emitLoad(src, regT1, regT0);
433433

@@void JIT::emit_op_jneq_ptr(const Instruc
455455 auto& metadata = bytecode.metadata(m_codeBlock);
456456 int src = bytecode.m_value.offset();
457457 Special::Pointer ptr = bytecode.m_specialPointer;
458  unsigned target = jumpTarget(currentInstruction, bytecode.m_target);
 458 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel);
459459
460460 emitLoad(src, regT1, regT0);
461461 Jump notCell = branchIfNotCell(regT1);

@@void JIT::emitSlow_op_eq(const Instructi
514514void JIT::emit_op_jeq(const Instruction* currentInstruction)
515515{
516516 auto bytecode = currentInstruction->as<OpJeq>();
517  unsigned target = jumpTarget(currentInstruction, bytecode.m_target);
 517 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel);
518518 int src1 = bytecode.m_lhs.offset();
519519 int src2 = bytecode.m_rhs.offset();
520520

@@void JIT::compileOpEqJumpSlow(Vector<Slo
554554void JIT::emitSlow_op_jeq(const Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
555555{
556556 auto bytecode = currentInstruction->as<OpJeq>();
557  unsigned target = jumpTarget(currentInstruction, bytecode.m_target);
 557 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel);
558558 compileOpEqJumpSlow(iter, CompileOpEqType::Eq, target);
559559}
560560

@@void JIT::emitSlow_op_neq(const Instruct
606606void JIT::emit_op_jneq(const Instruction* currentInstruction)
607607{
608608 auto bytecode = currentInstruction->as<OpJneq>();
609  unsigned target = jumpTarget(currentInstruction, bytecode.m_target);
 609 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel);
610610 int src1 = bytecode.m_lhs.offset();
611611 int src2 = bytecode.m_rhs.offset();
612612

@@void JIT::emit_op_jneq(const Instruction
621621void JIT::emitSlow_op_jneq(const Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
622622{
623623 auto bytecode = currentInstruction->as<OpJneq>();
624  unsigned target = jumpTarget(currentInstruction, bytecode.m_target);
 624 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel);
625625 compileOpEqJumpSlow(iter, CompileOpEqType::NEq, target);
626626}
627627

@@template<typename Op>
669669void JIT::compileOpStrictEqJump(const Instruction* currentInstruction, CompileOpStrictEqType type)
670670{
671671 auto bytecode = currentInstruction->as<Op>();
672  int target = jumpTarget(currentInstruction, bytecode.m_target);
 672 int target = jumpTarget(currentInstruction, bytecode.m_targetLabel);
673673 int src1 = bytecode.m_lhs.offset();
674674 int src2 = bytecode.m_rhs.offset();
675675

@@void JIT::emitSlow_op_jstricteq(const In
708708 linkAllSlowCases(iter);
709709
710710 auto bytecode = currentInstruction->as<OpJstricteq>();
711  unsigned target = jumpTarget(currentInstruction, bytecode.m_target);
 711 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel);
712712 callOperation(operationCompareStrictEq, JSValueRegs(regT1, regT0), JSValueRegs(regT3, regT2));
713713 emitJumpSlowToHot(branchTest32(NonZero, returnValueGPR), target);
714714}

@@void JIT::emitSlow_op_jnstricteq(const I
718718 linkAllSlowCases(iter);
719719
720720 auto bytecode = currentInstruction->as<OpJnstricteq>();
721  unsigned target = jumpTarget(currentInstruction, bytecode.m_target);
 721 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel);
722722 callOperation(operationCompareStrictEq, JSValueRegs(regT1, regT0), JSValueRegs(regT3, regT2));
723723 emitJumpSlowToHot(branchTest32(Zero, returnValueGPR), target);
724724}

@@void JIT::emit_op_to_this(const Instruct
10581058void JIT::emit_op_check_tdz(const Instruction* currentInstruction)
10591059{
10601060 auto bytecode = currentInstruction->as<OpCheckTdz>();
1061  emitLoadTag(bytecode.m_target.offset(), regT0);
 1061 emitLoadTag(bytecode.m_targetVirtualRegister.offset(), regT0);
10621062 addSlowCase(branchIfEmpty(regT0));
10631063}
10641064

@@void JIT::emit_op_profile_type(const Ins
12711271 auto bytecode = currentInstruction->as<OpProfileType>();
12721272 auto& metadata = bytecode.metadata(m_codeBlock);
12731273 TypeLocation* cachedTypeLocation = metadata.m_typeLocation;
1274  int valueToProfile = bytecode.m_target.offset();
 1274 int valueToProfile = bytecode.m_targetVirtualRegister.offset();
12751275
12761276 // Load payload in T0. Load tag in T3.
12771277 emitLoadPayload(valueToProfile, regT0);
240135

Source/JavaScriptCore/jit/JITOpcodes.cpp

@@void JIT::emit_op_end(const Instruction*
8686void JIT::emit_op_jmp(const Instruction* currentInstruction)
8787{
8888 auto bytecode = currentInstruction->as<OpJmp>();
89  unsigned target = jumpTarget(currentInstruction, bytecode.m_target);
 89 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel);
9090 addJump(jump(), target);
9191}
9292

@@void JIT::emit_op_not(const Instruction*
383383void JIT::emit_op_jfalse(const Instruction* currentInstruction)
384384{
385385 auto bytecode = currentInstruction->as<OpJfalse>();
386  unsigned target = jumpTarget(currentInstruction, bytecode.m_target);
 386 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel);
387387
388388 GPRReg value = regT0;
389389 GPRReg scratch1 = regT1;

@@void JIT::emit_op_jeq_null(const Instruc
398398{
399399 auto bytecode = currentInstruction->as<OpJeqNull>();
400400 int src = bytecode.m_value.offset();
401  unsigned target = jumpTarget(currentInstruction, bytecode.m_target);
 401 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel);
402402
403403 emitGetVirtualRegister(src, regT0);
404404 Jump isImmediate = branchIfNotCell(regT0);

@@void JIT::emit_op_jneq_null(const Instru
422422{
423423 auto bytecode = currentInstruction->as<OpJneqNull>();
424424 int src = bytecode.m_value.offset();
425  unsigned target = jumpTarget(currentInstruction, bytecode.m_target);
 425 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel);
426426
427427 emitGetVirtualRegister(src, regT0);
428428 Jump isImmediate = branchIfNotCell(regT0);

@@void JIT::emit_op_jneq_ptr(const Instruc
448448 auto& metadata = bytecode.metadata(m_codeBlock);
449449 int src = bytecode.m_value.offset();
450450 Special::Pointer ptr = bytecode.m_specialPointer;
451  unsigned target = jumpTarget(currentInstruction, bytecode.m_target);
 451 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel);
452452
453453 emitGetVirtualRegister(src, regT0);
454454 CCallHelpers::Jump equal = branchPtr(Equal, regT0, TrustedImmPtr(actualPointerFor(m_codeBlock, ptr)));

@@void JIT::emit_op_eq(const Instruction*
470470void JIT::emit_op_jeq(const Instruction* currentInstruction)
471471{
472472 auto bytecode = currentInstruction->as<OpJeq>();
473  unsigned target = jumpTarget(currentInstruction, bytecode.m_target);
 473 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel);
474474 emitGetVirtualRegisters(bytecode.m_lhs.offset(), regT0, bytecode.m_rhs.offset(), regT1);
475475 emitJumpSlowCaseIfNotInt(regT0, regT1, regT2);
476476 addJump(branch32(Equal, regT0, regT1), target);

@@void JIT::emit_op_jeq(const Instruction*
479479void JIT::emit_op_jtrue(const Instruction* currentInstruction)
480480{
481481 auto bytecode = currentInstruction->as<OpJtrue>();
482  unsigned target = jumpTarget(currentInstruction, bytecode.m_target);
 482 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel);
483483
484484 GPRReg value = regT0;
485485 GPRReg scratch1 = regT1;

@@void JIT::emit_op_neq(const Instruction*
503503void JIT::emit_op_jneq(const Instruction* currentInstruction)
504504{
505505 auto bytecode = currentInstruction->as<OpJneq>();
506  unsigned target = jumpTarget(currentInstruction, bytecode.m_target);
 506 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel);
507507 emitGetVirtualRegisters(bytecode.m_lhs.offset(), regT0, bytecode.m_rhs.offset(), regT1);
508508 emitJumpSlowCaseIfNotInt(regT0, regT1, regT2);
509509 addJump(branch32(NotEqual, regT0, regT1), target);

@@template<typename Op>
566566void JIT::compileOpStrictEqJump(const Instruction* currentInstruction, CompileOpStrictEqType type)
567567{
568568 auto bytecode = currentInstruction->as<Op>();
569  int target = jumpTarget(currentInstruction, bytecode.m_target);
 569 int target = jumpTarget(currentInstruction, bytecode.m_targetLabel);
570570 int src1 = bytecode.m_lhs.offset();
571571 int src2 = bytecode.m_rhs.offset();
572572

@@void JIT::emitSlow_op_jstricteq(const In
607607 linkAllSlowCases(iter);
608608
609609 auto bytecode = currentInstruction->as<OpJstricteq>();
610  unsigned target = jumpTarget(currentInstruction, bytecode.m_target);
 610 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel);
611611 callOperation(operationCompareStrictEq, regT0, regT1);
612612 emitJumpSlowToHot(branchTest32(NonZero, returnValueGPR), target);
613613}

@@void JIT::emitSlow_op_jnstricteq(const I
617617 linkAllSlowCases(iter);
618618
619619 auto bytecode = currentInstruction->as<OpJnstricteq>();
620  unsigned target = jumpTarget(currentInstruction, bytecode.m_target);
 620 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel);
621621 callOperation(operationCompareStrictEq, regT0, regT1);
622622 emitJumpSlowToHot(branchTest32(Zero, returnValueGPR), target);
623623}

@@void JIT::emit_op_create_this(const Inst
932932void JIT::emit_op_check_tdz(const Instruction* currentInstruction)
933933{
934934 auto bytecode = currentInstruction->as<OpCheckTdz>();
935  emitGetVirtualRegister(bytecode.m_target.offset(), regT0);
 935 emitGetVirtualRegister(bytecode.m_targetVirtualRegister.offset(), regT0);
936936 addSlowCase(branchIfEmpty(regT0));
937937}
938938

@@void JIT::emitSlow_op_jeq(const Instruct
965965 linkAllSlowCases(iter);
966966
967967 auto bytecode = currentInstruction->as<OpJeq>();
968  unsigned target = jumpTarget(currentInstruction, bytecode.m_target);
 968 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel);
969969 callOperation(operationCompareEq, regT0, regT1);
970970 emitJumpSlowToHot(branchTest32(NonZero, returnValueGPR), target);
971971}

@@void JIT::emitSlow_op_jneq(const Instruc
975975 linkAllSlowCases(iter);
976976
977977 auto bytecode = currentInstruction->as<OpJneq>();
978  unsigned target = jumpTarget(currentInstruction, bytecode.m_target);
 978 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel);
979979 callOperation(operationCompareEq, regT0, regT1);
980980 emitJumpSlowToHot(branchTest32(Zero, returnValueGPR), target);
981981}

@@void JIT::emit_op_profile_type(const Ins
13991399 auto bytecode = currentInstruction->as<OpProfileType>();
14001400 auto& metadata = bytecode.metadata(m_codeBlock);
14011401 TypeLocation* cachedTypeLocation = metadata.m_typeLocation;
1402  int valueToProfile = bytecode.m_target.offset();
 1402 int valueToProfile = bytecode.m_targetVirtualRegister.offset();
14031403
14041404 emitGetVirtualRegister(valueToProfile, regT0);
14051405
240135

Source/JavaScriptCore/llint/LLIntSlowPaths.cpp

@@namespace JSC { namespace LLInt {
122122 LLINT_END_IMPL(); \
123123 } while (false)
124124
125 #define JUMP_OFFSET(target) \
126  ((target) ? (target) : exec->codeBlock()->outOfLineJumpOffset(pc))
 125#define JUMP_OFFSET(targetOffset) \
 126 ((targetOffset) ? (targetOffset) : exec->codeBlock()->outOfLineJumpOffset(pc))
127127
128128#define JUMP_TO(target) do { \
129129 pc = reinterpret_cast<const Instruction*>(reinterpret_cast<const uint8_t*>(pc) + (target)); \

@@namespace JSC { namespace LLInt {
133133 bool __b_condition = (condition); \
134134 LLINT_CHECK_EXCEPTION(); \
135135 if (__b_condition) \
136  JUMP_TO(JUMP_OFFSET(bytecode.m_target)); \
 136 JUMP_TO(JUMP_OFFSET(bytecode.m_targetLabel)); \
137137 else \
138138 JUMP_TO(pc->size()); \
139139 LLINT_END_IMPL(); \

@@LLINT_SLOW_PATH_DECL(slow_path_get_by_id
656656 if (!LLINT_ALWAYS_ACCESS_SLOW && slot.isCacheable()) {
657657 auto& metadata = bytecode.metadata(exec);
658658 {
659  StructureID oldStructureID = metadata.m_structure;
 659 StructureID oldStructureID = metadata.m_structureID;
660660 if (oldStructureID) {
661661 Structure* a = vm.heap.structureIDTable().get(oldStructureID);
662662 Structure* b = baseValue.asCell()->structure(vm);

@@LLINT_SLOW_PATH_DECL(slow_path_get_by_id
672672 Structure* structure = baseCell->structure(vm);
673673 if (slot.isValue()) {
674674 // Start out by clearing out the old cache.
675  metadata.m_structure = 0;
 675 metadata.m_structureID = 0;
676676 metadata.m_offset = 0;
677677
678678 if (structure->propertyAccessesAreCacheable()

@@LLINT_SLOW_PATH_DECL(slow_path_get_by_id
681681
682682 ConcurrentJSLocker locker(codeBlock->m_lock);
683683
684  metadata.m_structure = structure->id();
 684 metadata.m_structureID = structure->id();
685685 metadata.m_offset = slot.cachedOffset();
686686 }
687687 }

@@static void setupGetByIdPrototypeCache(E
736736
737737 if (slot.isUnset()) {
738738 metadata.m_mode = GetByIdMode::Unset;
739  metadata.m_modeMetadata.unsetMode.structure = structure->id();
 739 metadata.m_modeMetadata.unsetMode.structureID = structure->id();
740740 return;
741741 }
742742 ASSERT(slot.isValue());
743743
744744 metadata.m_mode = GetByIdMode::ProtoLoad;
745  metadata.m_modeMetadata.protoLoadMode.structure = structure->id();
 745 metadata.m_modeMetadata.protoLoadMode.structureID = structure->id();
746746 metadata.m_modeMetadata.protoLoadMode.cachedOffset = offset;
747747 metadata.m_modeMetadata.protoLoadMode.cachedSlot = slot.slotBase();
748748 // We know that this pointer will remain valid because it will be cleared by either a watchpoint fire or

@@LLINT_SLOW_PATH_DECL(slow_path_get_by_id
773773 auto mode = metadata.m_mode;
774774 switch (mode) {
775775 case GetByIdMode::Default:
776  oldStructureID = metadata.m_modeMetadata.defaultMode.structure;
 776 oldStructureID = metadata.m_modeMetadata.defaultMode.structureID;
777777 break;
778778 case GetByIdMode::Unset:
779  oldStructureID = metadata.m_modeMetadata.unsetMode.structure;
 779 oldStructureID = metadata.m_modeMetadata.unsetMode.structureID;
780780 break;
781781 case GetByIdMode::ProtoLoad:
782  oldStructureID = metadata.m_modeMetadata.protoLoadMode.structure;
 782 oldStructureID = metadata.m_modeMetadata.protoLoadMode.structureID;
783783 break;
784784 default:
785785 oldStructureID = 0;

@@LLINT_SLOW_PATH_DECL(slow_path_get_by_id
800800 if (slot.isValue() && slot.slotBase() == baseValue) {
801801 // Start out by clearing out the old cache.
802802 metadata.m_mode = GetByIdMode::Default;
803  metadata.m_modeMetadata.defaultMode.structure = 0;
 803 metadata.m_modeMetadata.defaultMode.structureID = 0;
804804 metadata.m_modeMetadata.defaultMode.cachedOffset = 0;
805805
806806 // Prevent the prototype cache from ever happening.

@@LLINT_SLOW_PATH_DECL(slow_path_get_by_id
812812
813813 ConcurrentJSLocker locker(codeBlock->m_lock);
814814
815  metadata.m_modeMetadata.defaultMode.structure = structure->id();
 815 metadata.m_modeMetadata.defaultMode.structureID = structure->id();
816816 metadata.m_modeMetadata.defaultMode.cachedOffset = slot.cachedOffset();
817817 }
818818 } else if (UNLIKELY(metadata.m_hitCountForLLIntCaching && (slot.isValue() || slot.isUnset()))) {

@@LLINT_SLOW_PATH_DECL(slow_path_put_by_id
857857 && slot.isCacheablePut()) {
858858
859859 {
860  StructureID oldStructureID = metadata.m_oldStructure;
 860 StructureID oldStructureID = metadata.m_oldStructureID;
861861 if (oldStructureID) {
862862 Structure* a = vm.heap.structureIDTable().get(oldStructureID);
863863 Structure* b = baseValue.asCell()->structure(vm);

@@LLINT_SLOW_PATH_DECL(slow_path_put_by_id
872872 }
873873
874874 // Start out by clearing out the old cache.
875  metadata.m_oldStructure = 0;
 875 metadata.m_oldStructureID = 0;
876876 metadata.m_offset = 0;
877  metadata.m_newStructure = 0;
 877 metadata.m_newStructureID = 0;
878878 metadata.m_structureChain.clear();
879879
880880 JSCell* baseCell = baseValue.asCell();

@@LLINT_SLOW_PATH_DECL(slow_path_put_by_id
896896 auto result = normalizePrototypeChain(exec, baseCell, sawPolyProto);
897897 if (result != InvalidPrototypeChain && !sawPolyProto) {
898898 ASSERT(structure->previousID()->isObject());
899  metadata.m_oldStructure = structure->previousID()->id();
 899 metadata.m_oldStructureID = structure->previousID()->id();
900900 metadata.m_offset = slot.cachedOffset();
901  metadata.m_newStructure = structure->id();
 901 metadata.m_newStructureID = structure->id();
902902 if (!(bytecode.m_flags & PutByIdIsDirect)) {
903903 StructureChain* chain = structure->prototypeChain(exec, asObject(baseCell));
904904 ASSERT(chain);

@@LLINT_SLOW_PATH_DECL(slow_path_put_by_id
908908 }
909909 } else {
910910 structure->didCachePropertyReplacement(vm, slot.cachedOffset());
911  metadata.m_oldStructure = structure->id();
 911 metadata.m_oldStructureID = structure->id();
912912 metadata.m_offset = slot.cachedOffset();
913913 }
914914 }
240135

Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm

@@macro nextInstructionWide()
3535 jmp [t1, t0, 4], BytecodePtrTag
3636end
3737
38 macro getuOperandNarrow(op, fieldName, dst)
39  loadb constexpr %op%_%fieldName%_index[PC], dst
 38macro getuOperandNarrow(opcodeStruct, fieldName, dst)
 39 loadb constexpr %opcodeStruct%_%fieldName%_index[PC], dst
4040end
4141
42 macro getOperandNarrow(op, fieldName, dst)
43  loadbsp constexpr %op%_%fieldName%_index[PC], dst
 42macro getOperandNarrow(opcodeStruct, fieldName, dst)
 43 loadbsp constexpr %opcodeStruct%_%fieldName%_index[PC], dst
4444end
4545
46 macro getuOperandWide(op, fieldName, dst)
47  loadi constexpr %op%_%fieldName%_index * 4 + 1[PC], dst
 46macro getuOperandWide(opcodeStruct, fieldName, dst)
 47 loadi constexpr %opcodeStruct%_%fieldName%_index * 4 + 1[PC], dst
4848end
4949
50 macro getOperandWide(op, fieldName, dst)
51  loadis constexpr %op%_%fieldName%_index * 4 + 1[PC], dst
 50macro getOperandWide(opcodeStruct, fieldName, dst)
 51 loadis constexpr %opcodeStruct%_%fieldName%_index * 4 + 1[PC], dst
5252end
5353
5454macro makeReturn(get, dispatch, fn)

@@macro makeReturn(get, dispatch, fn)
6262 end)
6363end
6464
65 macro makeReturnProfiled(op, get, metadata, dispatch, fn)
 65macro makeReturnProfiled(opcodeStruct, get, metadata, dispatch, fn)
6666 fn(macro (tag, payload)
6767 move tag, t1
6868 move payload, t0
6969
7070 metadata(t5, t2)
71  valueProfile(op, t5, t1, t0)
 71 valueProfile(opcodeStruct, t5, t1, t0)
7272 get(m_dst, t2)
7373 storei t1, TagOffset[cfr, t2, 8]
7474 storei t0, PayloadOffset[cfr, t2, 8]

@@macro makeReturnProfiled(op, get, metada
7777end
7878
7979
80 macro dispatchAfterCall(size, op, dispatch)
 80macro dispatchAfterCall(size, opcodeStruct, dispatch)
8181 loadi ArgumentCount + TagOffset[cfr], PC
82  get(size, op, m_dst, t3)
 82 get(size, opcodeStruct, m_dst, t3)
8383 storei r1, TagOffset[cfr, t3, 8]
8484 storei r0, PayloadOffset[cfr, t3, 8]
85  metadata(size, op, t2, t3)
86  valueProfile(op, t2, r1, r0)
 85 metadata(size, opcodeStruct, t2, t3)
 86 valueProfile(opcodeStruct, t2, r1, r0)
8787 dispatch()
8888end
8989

@@macro writeBarrierOnGlobalLexicalEnviron
598598 end)
599599end
600600
601 macro valueProfile(op, metadata, tag, payload)
602  storei tag, %op%::Metadata::m_profile.m_buckets + TagOffset[metadata]
603  storei payload, %op%::Metadata::m_profile.m_buckets + PayloadOffset[metadata]
 601macro valueProfile(opcodeStruct, metadata, tag, payload)
 602 storei tag, %opcodeStruct%::Metadata::m_profile.m_buckets + TagOffset[metadata]
 603 storei payload, %opcodeStruct%::Metadata::m_profile.m_buckets + PayloadOffset[metadata]
604604end
605605
606606

@@macro branchIfException(label)
682682 loadp Callee + PayloadOffset[cfr], t3
683683 andp MarkedBlockMask, t3
684684 loadp MarkedBlockFooterOffset + MarkedBlock::Footer::m_vm[t3], t3
685  btiz VM::m_exception[t3], .noException
 685 btpz VM::m_exception[t3], .noException
686686 jmp label
687687.noException:
688688end

@@end)
734734
735735llintOpWithReturn(op_get_scope, OpGetScope, macro (size, get, dispatch, return)
736736 loadi Callee + PayloadOffset[cfr], t0
737  loadi JSCallee::m_scope[t0], t0
 737 loadp JSCallee::m_scope[t0], t0
738738 return (CellTag, t0)
739739end)
740740

@@end)
756756
757757
758758llintOp(op_check_tdz, OpCheckTdz, macro (size, get, dispatch)
759  get(m_target, t0)
 759 get(m_targetVirtualRegister, t0)
760760 loadConstantOrVariableTag(size, t0, t1)
761761 bineq t1, EmptyValueTag, .opNotTDZ
762762 callSlowPath(_slow_path_throw_tdz_error)

@@llintOpWithReturn(op_not, OpNot, macro (
786786end)
787787
788788
789 macro equalityComparisonOp(name, op, integerComparison)
790  llintOpWithReturn(op_%name%, op, macro (size, get, dispatch, return)
 789macro equalityComparisonOp(opcodeName, opcodeStruct, integerComparison)
 790 llintOpWithReturn(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch, return)
791791 get(m_rhs, t2)
792792 get(m_lhs, t0)
793793 loadConstantOrVariable(size, t2, t3, t1)

@@macro equalityComparisonOp(name, op, int
799799 return(BooleanTag, t0)
800800
801801 .opEqSlow:
802  callSlowPath(_slow_path_%name%)
 802 callSlowPath(_slow_path_%opcodeName%)
803803 dispatch()
804804 end)
805805end
806806
807807
808 macro equalityJumpOp(name, op, integerComparison)
809  llintOpWithJump(op_%name%, op, macro (size, get, jump, dispatch)
 808macro equalityJumpOp(opcodeName, opcodeStruct, integerComparison)
 809 llintOpWithJump(op_%opcodeName%, opcodeStruct, macro (size, get, jump, dispatch)
810810 get(m_rhs, t2)
811811 get(m_lhs, t0)
812812 loadConstantOrVariable(size, t2, t3, t1)

@@macro equalityJumpOp(name, op, integerCo
818818 dispatch()
819819
820820 .jumpTarget:
821  jump(m_target)
 821 jump(m_targetLabel)
822822
823823 .slow:
824  callSlowPath(_llint_slow_path_%name%)
 824 callSlowPath(_llint_slow_path_%opcodeName%)
825825 nextInstruction()
826826 end)
827827end
828828
829829
830 macro equalNullComparisonOp(name, op, fn)
831  llintOpWithReturn(name, op, macro (size, get, dispatch, return)
 830macro equalNullComparisonOp(opcodeName, opcodeStruct, fn)
 831 llintOpWithReturn(opcodeName, opcodeStruct, macro (size, get, dispatch, return)
832832 get(m_operand, t0)
833833 assertNotConstant(size, t0)
834834 loadi TagOffset[cfr, t0, 8], t1

@@llintOpWithReturn(op_is_undefined_or_nul
869869end)
870870
871871
872 macro strictEqOp(name, op, equalityOperation)
873  llintOpWithReturn(op_%name%, op, macro (size, get, dispatch, return)
 872macro strictEqOp(opcodeName, opcodeStruct, equalityOperation)
 873 llintOpWithReturn(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch, return)
874874 get(m_rhs, t2)
875875 get(m_lhs, t0)
876876 loadConstantOrVariable(size, t2, t3, t1)

@@macro strictEqOp(name, op, equalityOpera
885885 return(BooleanTag, t0)
886886
887887 .slow:
888  callSlowPath(_slow_path_%name%)
 888 callSlowPath(_slow_path_%opcodeName%)
889889 dispatch()
890890 end)
891891end
892892
893893
894 macro strictEqualityJumpOp(name, op, equalityOperation)
895  llintOpWithJump(op_%name%, op, macro (size, get, jump, dispatch)
 894macro strictEqualityJumpOp(opcodeName, opcodeStruct, equalityOperation)
 895 llintOpWithJump(op_%opcodeName%, opcodeStruct, macro (size, get, jump, dispatch)
896896 get(m_rhs, t2)
897897 get(m_lhs, t0)
898898 loadConstantOrVariable(size, t2, t3, t1)

@@macro strictEqualityJumpOp(name, op, equ
907907 dispatch()
908908
909909 .jumpTarget:
910  jump(m_target)
 910 jump(m_targetLabel)
911911
912912 .slow:
913  callSlowPath(_llint_slow_path_%name%)
 913 callSlowPath(_llint_slow_path_%opcodeName%)
914914 nextInstruction()
915915 end)
916916end

@@strictEqualityJumpOp(jnstricteq, OpJnstr
932932 macro (left, right, target) bineq left, right, target end)
933933
934934
935 macro preOp(name, op, operation)
936  llintOp(op_%name%, op, macro (size, get, dispatch)
 935macro preOp(opcodeName, opcodeStruct, operation)
 936 llintOp(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch)
937937 get(m_srcDst, t0)
938938 bineq TagOffset[cfr, t0, 8], Int32Tag, .slow
939939 loadi PayloadOffset[cfr, t0, 8], t1

@@macro preOp(name, op, operation)
942942 dispatch()
943943
944944 .slow:
945  callSlowPath(_slow_path_%name%)
 945 callSlowPath(_slow_path_%opcodeName%)
946946 dispatch()
947947 end)
948948end

@@end)
992992llintOpWithMetadata(op_negate, OpNegate, macro (size, get, dispatch, metadata, return)
993993
994994 macro arithProfile(type)
995  ori type, OpNegate::Metadata::m_arithProfile[t5]
 995 ori type, OpNegate::Metadata::m_arithProfile + ArithProfile::m_bits[t5]
996996 end
997997
998998 metadata(t5, t0)

@@llintOpWithMetadata(op_negate, OpNegate,
10151015end)
10161016
10171017
1018 macro binaryOpCustomStore(name, op, integerOperationAndStore, doubleOperation)
1019  llintOpWithMetadata(op_%name%, op, macro (size, get, dispatch, metadata, return)
 1018macro binaryOpCustomStore(opcodeName, opcodeStruct, integerOperationAndStore, doubleOperation)
 1019 llintOpWithMetadata(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch, metadata, return)
10201020 macro arithProfile(type)
1021  ori type, %op%::Metadata::m_arithProfile[t5]
 1021 ori type, %opcodeStruct%::Metadata::m_arithProfile + ArithProfile::m_bits[t5]
10221022 end
10231023
10241024 metadata(t5, t2)

@@macro binaryOpCustomStore(name, op, inte
10631063 dispatch()
10641064
10651065 .slow:
1066  callSlowPath(_slow_path_%name%)
 1066 callSlowPath(_slow_path_%opcodeName%)
10671067 dispatch()
10681068 end)
10691069end
10701070
1071 macro binaryOp(name, op, integerOperation, doubleOperation)
1072  binaryOpCustomStore(name, op,
 1071macro binaryOp(opcodeName, opcodeStruct, integerOperation, doubleOperation)
 1072 binaryOpCustomStore(opcodeName, opcodeStruct,
10731073 macro (int32Tag, left, right, slow, index)
10741074 integerOperation(left, right, slow)
10751075 storei int32Tag, TagOffset[cfr, index, 8]

@@llintOpWithReturn(op_unsigned, OpUnsigne
11301130end)
11311131
11321132
1133 macro commonBitOp(opKind, name, op, operation)
1134  opKind(op_%name%, op, macro (size, get, dispatch, return)
 1133macro commonBitOp(opKind, opcodeName, opcodeStruct, operation)
 1134 opKind(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch, return)
11351135 get(m_rhs, t2)
11361136 get(m_lhs, t0)
11371137 loadConstantOrVariable(size, t2, t3, t1)

@@macro commonBitOp(opKind, name, op, oper
11421142 return (t3, t0)
11431143
11441144 .slow:
1145  callSlowPath(_slow_path_%name%)
 1145 callSlowPath(_slow_path_%opcodeName%)
11461146 dispatch()
11471147 end)
11481148end
11491149
1150 macro bitOp(name, op, operation)
1151  commonBitOp(llintOpWithReturn, name, op, operation)
 1150macro bitOp(opcodeName, opcodeStruct, operation)
 1151 commonBitOp(llintOpWithReturn, opcodeName, opcodeStruct, operation)
11521152end
11531153
1154 macro bitOpProfiled(name, op, operation)
1155  commonBitOp(llintOpWithProfile, name, op, operation)
 1154macro bitOpProfiled(opcodeName, opcodeStruct, operation)
 1155 commonBitOp(llintOpWithProfile, opcodeName, opcodeStruct, operation)
11561156end
11571157
11581158

@@end
13281328llintOpWithMetadata(op_get_by_id_direct, OpGetByIdDirect, macro (size, get, dispatch, metadata, return)
13291329 metadata(t5, t0)
13301330 get(m_base, t0)
1331  loadi OpGetByIdDirect::Metadata::m_structure[t5], t1
 1331 loadp OpGetByIdDirect::Metadata::m_structureID[t5], t1
13321332 loadConstantOrVariablePayload(size, t0, CellTag, t3, .opGetByIdDirectSlow)
13331333 loadi OpGetByIdDirect::Metadata::m_offset[t5], t2
1334  bineq JSCell::m_structureID[t3], t1, .opGetByIdDirectSlow
 1334 bpneq JSCell::m_structureID[t3], t1, .opGetByIdDirectSlow
13351335 loadPropertyAtVariableOffset(t2, t3, t0, t1)
13361336 valueProfile(OpGetByIdDirect, t5, t0, t1)
13371337 return(t0, t1)

@@llintOpWithMetadata(op_get_by_id, OpGetB
13491349
13501350.opGetByIdProtoLoad:
13511351 bbneq t1, constexpr GetByIdMode::ProtoLoad, .opGetByIdArrayLength
1352  loadi OpGetById::Metadata::m_modeMetadata.protoLoadMode.structure[t5], t1
 1352 loadp OpGetById::Metadata::m_modeMetadata.protoLoadMode.structureID[t5], t1
13531353 loadConstantOrVariablePayload(size, t0, CellTag, t3, .opGetByIdSlow)
13541354 loadis OpGetById::Metadata::m_modeMetadata.protoLoadMode.cachedOffset[t5], t2
1355  bineq JSCell::m_structureID[t3], t1, .opGetByIdSlow
 1355 bpneq JSCell::m_structureID[t3], t1, .opGetByIdSlow
13561356 loadp OpGetById::Metadata::m_modeMetadata.protoLoadMode.cachedSlot[t5], t3
13571357 loadPropertyAtVariableOffset(t2, t3, t0, t1)
13581358 valueProfile(OpGetById, t5, t0, t1)

@@llintOpWithMetadata(op_get_by_id, OpGetB
13731373
13741374.opGetByIdUnset:
13751375 bbneq t1, constexpr GetByIdMode::Unset, .opGetByIdDefault
1376  loadi OpGetById::Metadata::m_modeMetadata.unsetMode.structure[t5], t1
 1376 loadp OpGetById::Metadata::m_modeMetadata.unsetMode.structureID[t5], t1
13771377 loadConstantOrVariablePayload(size, t0, CellTag, t3, .opGetByIdSlow)
1378  bineq JSCell::m_structureID[t3], t1, .opGetByIdSlow
 1378 bpneq JSCell::m_structureID[t3], t1, .opGetByIdSlow
13791379 valueProfile(OpGetById, t5, UndefinedTag, 0)
13801380 return(UndefinedTag, 0)
13811381
13821382.opGetByIdDefault:
1383  loadi OpGetById::Metadata::m_modeMetadata.defaultMode.structure[t5], t1
 1383 loadp OpGetById::Metadata::m_modeMetadata.defaultMode.structureID[t5], t1
13841384 loadConstantOrVariablePayload(size, t0, CellTag, t3, .opGetByIdSlow)
13851385 loadis OpGetById::Metadata::m_modeMetadata.defaultMode.cachedOffset[t5], t2
1386  bineq JSCell::m_structureID[t3], t1, .opGetByIdSlow
 1386 bpneq JSCell::m_structureID[t3], t1, .opGetByIdSlow
13871387 loadPropertyAtVariableOffset(t2, t3, t0, t1)
13881388 valueProfile(OpGetById, t5, t0, t1)
13891389 return(t0, t1)

@@llintOpWithMetadata(op_put_by_id, OpPutB
13991399 metadata(t5, t3)
14001400 get(m_base, t3)
14011401 loadConstantOrVariablePayload(size, t3, CellTag, t0, .opPutByIdSlow)
1402  loadi JSCell::m_structureID[t0], t2
1403  bineq t2, OpPutById::Metadata::m_oldStructure[t5], .opPutByIdSlow
 1402 loadp JSCell::m_structureID[t0], t2
 1403 bpneq t2, OpPutById::Metadata::m_oldStructureID[t5], .opPutByIdSlow
14041404
14051405 # At this point, we have:
14061406 # t5 -> metadata

@@llintOpWithMetadata(op_put_by_id, OpPutB
14081408 # t0 -> object base
14091409 # We will lose currentStructureID in the shenanigans below.
14101410
1411  loadi OpPutById::Metadata::m_newStructure[t5], t1
 1411 loadp OpPutById::Metadata::m_newStructureID[t5], t1
14121412
14131413 btiz t1, .opPutByIdNotTransition
14141414

@@llintOpWithMetadata(op_put_by_id, OpPutB
14171417 loadp OpPutById::Metadata::m_structureChain[t5], t3
14181418 btpz t3, .opPutByIdTransitionDirect
14191419
1420  loadi OpPutById::Metadata::m_oldStructure[t5], t2 # Need old structure again.
 1420 loadp OpPutById::Metadata::m_oldStructureID[t5], t2 # Need old structure again.
14211421 loadp StructureChain::m_vector[t3], t3
14221422 assert(macro (ok) btpnz t3, ok end)
14231423

@@llintOpWithMetadata(op_put_by_id, OpPutB
14311431 btpnz t2, .opPutByIdTransitionChainLoop
14321432
14331433.opPutByIdTransitionChainDone:
1434  loadi OpPutById::Metadata::m_newStructure[t5], t1
 1434 loadp OpPutById::Metadata::m_newStructureID[t5], t1
14351435
14361436.opPutByIdTransitionDirect:
1437  storei t1, JSCell::m_structureID[t0]
 1437 storep t1, JSCell::m_structureID[t0]
14381438 get(m_value, t1)
14391439 loadConstantOrVariable(size, t1, t2, t3)
14401440 loadi OpPutById::Metadata::m_offset[t5], t1

@@llintOpWithMetadata(op_get_by_val, OpGet
15071507end)
15081508
15091509
1510 macro putByValOp(name, op)
1511  llintOpWithMetadata(op_%name%, op, macro (size, get, dispatch, metadata, return)
 1510macro putByValOp(opcodeName, opcodeStruct)
 1511 llintOpWithMetadata(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch, metadata, return)
15121512 macro contiguousPutByVal(storeCallback)
15131513 biaeq t3, -sizeof IndexingHeader + IndexingHeader::u.lengths.publicLength[t0], .outOfBounds
15141514 .storeResult:

@@macro putByValOp(name, op)
15181518
15191519 .outOfBounds:
15201520 biaeq t3, -sizeof IndexingHeader + IndexingHeader::u.lengths.vectorLength[t0], .opPutByValOutOfBounds
1521  storeb 1, %op%::Metadata::m_arrayProfile.m_mayStoreToHole[t5]
 1521 storeb 1, %opcodeStruct%::Metadata::m_arrayProfile.m_mayStoreToHole[t5]
15221522 addi 1, t3, t2
15231523 storei t2, -sizeof IndexingHeader + IndexingHeader::u.lengths.publicLength[t0]
15241524 jmp .storeResult

@@macro putByValOp(name, op)
15291529 get(m_base, t0)
15301530 loadConstantOrVariablePayload(size, t0, CellTag, t1, .opPutByValSlow)
15311531 move t1, t2
1532  arrayProfile(%op%::Metadata::m_arrayProfile, t2, t5, t0)
 1532 arrayProfile(%opcodeStruct%::Metadata::m_arrayProfile, t2, t5, t0)
15331533 get(m_property, t0)
15341534 loadConstantOrVariablePayload(size, t0, Int32Tag, t3, .opPutByValSlow)
15351535 loadp JSObject::m_butterfly[t1], t0

@@macro putByValOp(name, op)
15831583 dispatch()
15841584
15851585 .opPutByValArrayStorageEmpty:
1586  storeb 1, %op%::Metadata::m_arrayProfile.m_mayStoreToHole[t5]
 1586 storeb 1, %opcodeStruct%::Metadata::m_arrayProfile.m_mayStoreToHole[t5]
15871587 addi 1, ArrayStorage::m_numValuesInVector[t0]
15881588 bib t3, -sizeof IndexingHeader + IndexingHeader::u.lengths.publicLength[t0], .opPutByValArrayStorageStoreResult
15891589 addi 1, t3, t1

@@macro putByValOp(name, op)
15911591 jmp .opPutByValArrayStorageStoreResult
15921592
15931593 .opPutByValOutOfBounds:
1594  storeb 1, %op%::Metadata::m_arrayProfile.m_outOfBounds[t5]
 1594 storeb 1, %opcodeStruct%::Metadata::m_arrayProfile.m_outOfBounds[t5]
15951595 .opPutByValSlow:
1596  callSlowPath(_llint_slow_path_%name%)
 1596 callSlowPath(_llint_slow_path_%opcodeName%)
15971597 dispatch()
15981598 end)
15991599end

@@putByValOp(put_by_val, OpPutByVal)
16041604putByValOp(put_by_val_direct, OpPutByValDirect)
16051605
16061606
1607 macro llintJumpTrueOrFalseOp(name, op, conditionOp)
1608  llintOpWithJump(op_%name%, op, macro (size, get, jump, dispatch)
 1607macro llintJumpTrueOrFalseOp(opcodeName, opcodeStruct, conditionOp)
 1608 llintOpWithJump(op_%opcodeName%, opcodeStruct, macro (size, get, jump, dispatch)
16091609 get(m_condition, t1)
16101610 loadConstantOrVariablePayload(size, t1, BooleanTag, t0, .slow)
16111611 conditionOp(t0, .target)
16121612 dispatch()
16131613
16141614 .target:
1615  jump(m_target)
 1615 jump(m_targetLabel)
16161616
16171617 .slow:
1618  callSlowPath(_llint_slow_path_%name%)
 1618 callSlowPath(_llint_slow_path_%opcodeName%)
16191619 nextInstruction()
16201620 end)
16211621end
16221622
16231623
1624 macro equalNullJumpOp(name, op, cellHandler, immediateHandler)
1625  llintOpWithJump(op_%name%, op, macro (size, get, jump, dispatch)
 1624macro equalNullJumpOp(opcodeName, opcodeStruct, cellHandler, immediateHandler)
 1625 llintOpWithJump(op_%opcodeName%, opcodeStruct, macro (size, get, jump, dispatch)
16261626 get(m_value, t0)
16271627 assertNotConstant(size, t0)
16281628 loadi TagOffset[cfr, t0, 8], t1

@@macro equalNullJumpOp(name, op, cellHand
16331633 dispatch()
16341634
16351635 .target:
1636  jump(m_target)
 1636 jump(m_targetLabel)
16371637
16381638 .immediate:
16391639 ori 1, t1

@@equalNullJumpOp(jneq_null, OpJneqNull,
16651665
16661666llintOpWithMetadata(op_jneq_ptr, OpJneqPtr, macro (size, get, dispatch, metadata, return)
16671667 get(m_value, t0)
1668  get(m_specialPointer, t1)
 1668 getu(size, OpJneqPtr, m_specialPointer, t1)
16691669 loadp CodeBlock[cfr], t2
16701670 loadp CodeBlock::m_globalObject[t2], t2
16711671 bineq TagOffset[cfr, t0, 8], CellTag, .opJneqPtrBranch

@@llintOpWithMetadata(op_jneq_ptr, OpJneqP
16741674.opJneqPtrBranch:
16751675 metadata(t5, t2)
16761676 storeb 1, OpJneqPtr::Metadata::m_hasJumped[t5]
1677  get(m_target, t0)
 1677 get(m_targetLabel, t0)
16781678 jumpImpl(t0)
16791679.opJneqPtrFallThrough:
16801680 dispatch()
16811681end)
16821682
16831683
1684 macro compareUnsignedJumpOp(name, op, integerCompare)
1685  llintOpWithJump(op_%name%, op, macro (size, get, jump, dispatch)
 1684macro compareUnsignedJumpOp(opcodeName, opcodeStruct, integerCompare)
 1685 llintOpWithJump(op_%opcodeName%, opcodeStruct, macro (size, get, jump, dispatch)
16861686 get(m_lhs, t2)
16871687 get(m_rhs, t3)
16881688 loadConstantOrVariable(size, t2, t0, t1)

@@macro compareUnsignedJumpOp(name, op, in
16911691 dispatch()
16921692
16931693 .jumpTarget:
1694  jump(m_target)
 1694 jump(m_targetLabel)
16951695 end)
16961696end
16971697
16981698
1699 macro compareUnsignedOp(name, op, integerCompareAndSet)
1700  llintOpWithReturn(op_%name%, op, macro (size, get, dispatch, return)
 1699macro compareUnsignedOp(opcodeName, opcodeStruct, integerCompareAndSet)
 1700 llintOpWithReturn(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch, return)
17011701 get(m_rhs, t2)
17021702 get(m_lhs, t0)
17031703 loadConstantOrVariable(size, t2, t3, t1)

@@macro compareUnsignedOp(name, op, intege
17081708end
17091709
17101710
1711 macro compareJumpOp(name, op, integerCompare, doubleCompare)
1712  llintOpWithJump(op_%name%, op, macro (size, get, jump, dispatch)
 1711macro compareJumpOp(opcodeName, opcodeStruct, integerCompare, doubleCompare)
 1712 llintOpWithJump(op_%opcodeName%, opcodeStruct, macro (size, get, jump, dispatch)
17131713 get(m_lhs, t2)
17141714 get(m_rhs, t3)
17151715 loadConstantOrVariable(size, t2, t0, t1)

@@macro compareJumpOp(name, op, integerCom
17401740 dispatch()
17411741
17421742 .jumpTarget:
1743  jump(m_target)
 1743 jump(m_targetLabel)
17441744
17451745 .slow:
1746  callSlowPath(_llint_slow_path_%name%)
 1746 callSlowPath(_llint_slow_path_%opcodeName%)
17471747 nextInstruction()
17481748 end)
17491749end

@@end
17511751
17521752llintOpWithJump(op_switch_imm, OpSwitchImm, macro (size, get, jump, dispatch)
17531753 get(m_scrutinee, t2)
1754  get(m_tableIndex, t3)
 1754 getu(size, OpSwitchImm, m_tableIndex, t3)
17551755 loadConstantOrVariable(size, t2, t1, t0)
17561756 loadp CodeBlock[cfr], t2
17571757 loadp CodeBlock::m_rareData[t2], t2

@@end)
17791779
17801780llintOpWithJump(op_switch_char, OpSwitchChar, macro (size, get, jump, dispatch)
17811781 get(m_scrutinee, t2)
1782  get(m_tableIndex, t3)
 1782 getu(size, OpSwitchChar, m_tableIndex, t3)
17831783 loadConstantOrVariable(size, t2, t1, t0)
17841784 loadp CodeBlock[cfr], t2
17851785 loadp CodeBlock::m_rareData[t2], t2

@@llintOpWithJump(op_switch_char, OpSwitch
18141814end)
18151815
18161816
1817 macro arrayProfileForCall(op, getu)
 1817macro arrayProfileForCall(opcodeStruct, getu)
18181818 getu(m_argv, t3)
18191819 negi t3
18201820 bineq ThisArgumentOffset + TagOffset[cfr, t3, 8], CellTag, .done
18211821 loadi ThisArgumentOffset + PayloadOffset[cfr, t3, 8], t0
18221822 loadp JSCell::m_structureID[t0], t0
1823  storep t0, %op%::Metadata::m_arrayProfile.m_lastSeenStructureID[t5]
 1823 storep t0, %opcodeStruct%::Metadata::m_arrayProfile.m_lastSeenStructureID[t5]
18241824.done:
18251825end
18261826
1827 macro commonCallOp(name, slowPath, op, prepareCall, prologue)
1828  llintOpWithMetadata(name, op, macro (size, get, dispatch, metadata, return)
 1827macro commonCallOp(opcodeName, slowPath, opcodeStruct, prepareCall, prologue)
 1828 llintOpWithMetadata(opcodeName, opcodeStruct, macro (size, get, dispatch, metadata, return)
18291829 metadata(t5, t0)
18301830
18311831 prologue(macro (fieldName, dst)
1832  getu(size, op, fieldName, dst)
 1832 getu(size, opcodeStruct, fieldName, dst)
18331833 end, metadata)
18341834
18351835 get(m_callee, t0)
1836  loadp %op%::Metadata::m_callLinkInfo.callee[t5], t2
 1836 loadp %opcodeStruct%::Metadata::m_callLinkInfo.callee[t5], t2
18371837 loadConstantOrVariablePayload(size, t0, CellTag, t3, .opCallSlow)
18381838 bineq t3, t2, .opCallSlow
1839  getu(size, op, m_argv, t3)
 1839 getu(size, opcodeStruct, m_argv, t3)
18401840 lshifti 3, t3
18411841 negi t3
18421842 addp cfr, t3 # t3 contains the new value of cfr
18431843 storei t2, Callee + PayloadOffset[t3]
1844  getu(size, op, m_argc, t2)
 1844 getu(size, opcodeStruct, m_argc, t2)
18451845 storei PC, ArgumentCount + TagOffset[cfr]
18461846 storei t2, ArgumentCount + PayloadOffset[t3]
18471847 storei CellTag, Callee + TagOffset[t3]
18481848 move t3, sp
1849  prepareCall(%op%::Metadata::m_callLinkInfo.machineCodeTarget[t5], t2, t3, t4, JSEntryPtrTag)
1850  callTargetFunction(size, op, dispatch, %op%::Metadata::m_callLinkInfo.machineCodeTarget[t5], JSEntryPtrTag)
 1849 prepareCall(%opcodeStruct%::Metadata::m_callLinkInfo.machineCodeTarget[t5], t2, t3, t4, JSEntryPtrTag)
 1850 callTargetFunction(size, opcodeStruct, dispatch, %opcodeStruct%::Metadata::m_callLinkInfo.machineCodeTarget[t5], JSEntryPtrTag)
18511851
18521852 .opCallSlow:
1853  slowPathForCall(size, op, dispatch, slowPath, prepareCall)
 1853 slowPathForCall(size, opcodeStruct, dispatch, slowPath, prepareCall)
18541854 end)
18551855end
18561856

@@commonOp(llint_op_catch, macro() end, ma
19051905 andp MarkedBlockMask, t3
19061906 loadp MarkedBlockFooterOffset + MarkedBlock::Footer::m_vm[t3], t3
19071907
1908  loadi VM::m_exception[t3], t0
1909  storei 0, VM::m_exception[t3]
 1908 loadp VM::m_exception[t3], t0
 1909 storep 0, VM::m_exception[t3]
19101910 get(size, OpCatch, m_exception, t2)
19111911 storei t0, PayloadOffset[cfr, t2, 8]
19121912 storei CellTag, TagOffset[cfr, t2, 8]

@@macro nativeCallTrampoline(executableOff
20132013 error
20142014 end
20152015
2016  btinz VM::m_exception[t3], .handleException
 2016 btpnz VM::m_exception[t3], .handleException
20172017
20182018 functionEpilogue()
20192019 ret

@@macro internalFunctionCallTrampoline(off
20682068 error
20692069 end
20702070
2071  btinz VM::m_exception[t3], .handleException
 2071 btpnz VM::m_exception[t3], .handleException
20722072
20732073 functionEpilogue()
20742074 ret

@@llintOpWithMetadata(op_resolve_scope, Op
21132113 end
21142114
21152115 metadata(t5, t0)
2116  loadp OpResolveScope::Metadata::m_resolveType[t5], t0
 2116 loadi OpResolveScope::Metadata::m_resolveType[t5], t0
21172117
21182118#rGlobalProperty:
21192119 bineq t0, GlobalProperty, .rGlobalVar

@@llintOpWithMetadata(op_resolve_scope, Op
21612161end)
21622162
21632163
2164 macro loadWithStructureCheck(op, get, operand, slowPath)
 2164macro loadWithStructureCheck(opcodeStruct, get, operand, slowPath)
21652165 get(m_scope, t0)
21662166 loadp PayloadOffset[cfr, t0, 8], t0
2167  loadp %op%::Metadata::m_structure[t5], t1
 2167 loadp %opcodeStruct%::Metadata::m_structure[t5], t1
21682168 bpneq JSCell::m_structureID[t0], t1, slowPath
21692169end
21702170

@@llintOpWithMetadata(op_get_from_scope, O
21952195 end
21962196
21972197 metadata(t5, t0)
2198  loadi OpGetFromScope::Metadata::m_getPutInfo[t5], t0
 2198 loadi OpGetFromScope::Metadata::m_getPutInfo + GetPutInfo::m_operand[t5], t0
21992199 andi ResolveTypeMask, t0
22002200
22012201#gGlobalProperty:

@@llintOpWithMetadata(op_put_to_scope, OpP
22532253 macro putProperty()
22542254 get(m_value, t1)
22552255 loadConstantOrVariable(size, t1, t2, t3)
2256  loadis OpPutToScope::Metadata::m_operand[t5], t1
 2256 loadp OpPutToScope::Metadata::m_operand[t5], t1
22572257 storePropertyAtVariableOffset(t1, t0, t2, t3)
22582258 end
22592259

@@llintOpWithMetadata(op_put_to_scope, OpP
22702270 macro putClosureVar()
22712271 get(m_value, t1)
22722272 loadConstantOrVariable(size, t1, t2, t3)
2273  loadis OpPutToScope::Metadata::m_operand[t5], t1
 2273 loadp OpPutToScope::Metadata::m_operand[t5], t1
22742274 storei t2, JSLexicalEnvironment_variables + TagOffset[t0, t1, 8]
22752275 storei t3, JSLexicalEnvironment_variables + PayloadOffset[t0, t1, 8]
22762276 end

@@llintOpWithMetadata(op_put_to_scope, OpP
22822282 btpz t1, .noVariableWatchpointSet
22832283 notifyWrite(t1, .pDynamic)
22842284 .noVariableWatchpointSet:
2285  loadis OpPutToScope::Metadata::m_operand[t5], t1
 2285 loadp OpPutToScope::Metadata::m_operand[t5], t1
22862286 storei t2, JSLexicalEnvironment_variables + TagOffset[t0, t1, 8]
22872287 storei t3, JSLexicalEnvironment_variables + PayloadOffset[t0, t1, 8]
22882288 end
22892289
22902290
22912291 metadata(t5, t0)
2292  loadi OpPutToScope::Metadata::m_getPutInfo[t5], t0
 2292 loadi OpPutToScope::Metadata::m_getPutInfo + GetPutInfo::m_operand[t5], t0
22932293 andi ResolveTypeMask, t0
22942294
22952295#pLocalClosureVar:

@@end)
23682368llintOpWithProfile(op_get_from_arguments, OpGetFromArguments, macro (size, get, dispatch, return)
23692369 get(m_arguments, t0)
23702370 loadi PayloadOffset[cfr, t0, 8], t0
2371  get(m_index, t1)
 2371 getu(size, OpGetFromArguments, m_index, t1)
23722372 loadi DirectArguments_storage + TagOffset[t0, t1, 8], t2
23732373 loadi DirectArguments_storage + PayloadOffset[t0, t1, 8], t3
23742374 return(t2, t3)

@@llintOp(op_put_to_arguments, OpPutToArgu
23812381 loadi PayloadOffset[cfr, t0, 8], t0
23822382 get(m_value, t1)
23832383 loadConstantOrVariable(size, t1, t2, t3)
2384  get(m_index, t1)
 2384 getu(size, OpPutToArguments, m_index, t1)
23852385 storei t2, DirectArguments_storage + TagOffset[t0, t1, 8]
23862386 storei t3, DirectArguments_storage + PayloadOffset[t0, t1, 8]
23872387 dispatch()

@@llintOpWithMetadata(op_profile_type, OpP
24042404 loadp VM::m_typeProfilerLog[t1], t1
24052405
24062406 # t0 is holding the payload, t5 is holding the tag.
2407  get(m_target, t2)
 2407 get(m_targetVirtualRegister, t2)
24082408 loadConstantOrVariable(size, t2, t5, t0)
24092409
24102410 bieq t5, EmptyValueTag, .opProfileTypeDone

@@llintOpWithMetadata(op_profile_type, OpP
24252425 storei 0, TypeProfilerLog::LogEntry::structureID[t2]
24262426 jmp .opProfileTypeSkipIsCell
24272427.opProfileTypeIsCell:
2428  loadi JSCell::m_structureID[t0], t3
 2428 loadp JSCell::m_structureID[t0], t3
24292429 storei t3, TypeProfilerLog::LogEntry::structureID[t2]
24302430.opProfileTypeSkipIsCell:
24312431

@@end)
24562456llintOpWithReturn(op_get_rest_length, OpGetRestLength, macro (size, get, dispatch, return)
24572457 loadi PayloadOffset + ArgumentCount[cfr], t0
24582458 subi 1, t0
2459  get(m_numParametersToSkip, t1)
 2459 getu(size, OpGetRestLength, m_numParametersToSkip, t1)
24602460 bilteq t0, t1, .storeZero
24612461 subi t1, t0
24622462 jmp .finish
240135

Source/JavaScriptCore/llint/LowLevelInterpreter64.asm

@@macro nextInstructionWide()
3636 jmp [t1, t0, PtrSize], BytecodePtrTag
3737end
3838
39 macro getuOperandNarrow(op, fieldName, dst)
40  loadb constexpr %op%_%fieldName%_index[PB, PC, 1], dst
 39macro getuOperandNarrow(opcodeStruct, fieldName, dst)
 40 loadb constexpr %opcodeStruct%_%fieldName%_index[PB, PC, 1], dst
4141end
4242
43 macro getOperandNarrow(op, fieldName, dst)
44  loadbsp constexpr %op%_%fieldName%_index[PB, PC, 1], dst
 43macro getOperandNarrow(opcodeStruct, fieldName, dst)
 44 loadbsp constexpr %opcodeStruct%_%fieldName%_index[PB, PC, 1], dst
4545end
4646
47 macro getuOperandWide(op, fieldName, dst)
48  loadi constexpr %op%_%fieldName%_index * 4 + 1[PB, PC, 1], dst
 47macro getuOperandWide(opcodeStruct, fieldName, dst)
 48 loadi constexpr %opcodeStruct%_%fieldName%_index * 4 + 1[PB, PC, 1], dst
4949end
5050
51 macro getOperandWide(op, fieldName, dst)
52  loadis constexpr %op%_%fieldName%_index * 4 + 1[PB, PC, 1], dst
 51macro getOperandWide(opcodeStruct, fieldName, dst)
 52 loadis constexpr %opcodeStruct%_%fieldName%_index * 4 + 1[PB, PC, 1], dst
5353end
5454
5555macro makeReturn(get, dispatch, fn)

@@macro makeReturn(get, dispatch, fn)
6161 end)
6262end
6363
64 macro makeReturnProfiled(op, get, metadata, dispatch, fn)
 64macro makeReturnProfiled(opcodeStruct, get, metadata, dispatch, fn)
6565 fn(macro (value)
6666 move value, t3
6767 metadata(t1, t2)
68  valueProfile(op, t1, t3)
 68 valueProfile(opcodeStruct, t1, t3)
6969 get(m_dst, t1)
7070 storeq t3, [cfr, t1, 8]
7171 dispatch()
7272 end)
7373end
7474
75 macro valueProfile(op, metadata, value)
76  storeq value, %op%::Metadata::m_profile.m_buckets[metadata]
 75macro valueProfile(opcodeStruct, metadata, value)
 76 storeq value, %opcodeStruct%::Metadata::m_profile.m_buckets[metadata]
7777end
7878
79 macro dispatchAfterCall(size, op, dispatch)
 79macro dispatchAfterCall(size, opcodeStruct, dispatch)
8080 loadi ArgumentCount + TagOffset[cfr], PC
8181 loadp CodeBlock[cfr], PB
8282 loadp CodeBlock::m_instructionsRawPointer[PB], PB
8383 unpoison(_g_CodeBlockPoison, PB, t1)
84  get(size, op, m_dst, t1)
 84 get(size, opcodeStruct, m_dst, t1)
8585 storeq r0, [cfr, t1, 8]
86  metadata(size, op, t2, t1)
87  valueProfile(op, t2, r0)
 86 metadata(size, opcodeStruct, t2, t1)
 87 valueProfile(opcodeStruct, t2, r0)
8888 dispatch()
8989end
9090

@@end)
710710
711711
712712llintOp(op_check_tdz, OpCheckTdz, macro (size, get, dispatch)
713  get(m_target, t0)
 713 get(m_targetVirtualRegister, t0)
714714 loadConstantOrVariable(size, t0, t1)
715715 bqneq t1, ValueEmpty, .opNotTDZ
716716 callSlowPath(_slow_path_throw_tdz_error)

@@llintOpWithReturn(op_not, OpNot, macro (
741741end)
742742
743743
744 macro equalityComparisonOp(name, op, integerComparison)
745  llintOpWithReturn(op_%name%, op, macro (size, get, dispatch, return)
 744macro equalityComparisonOp(opcodeName, opcodeStruct, integerComparison)
 745 llintOpWithReturn(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch, return)
746746 get(m_rhs, t0)
747747 get(m_lhs, t2)
748748 loadConstantOrVariableInt32(size, t0, t1, .slow)

@@macro equalityComparisonOp(name, op, int
752752 return(t0)
753753
754754 .slow:
755  callSlowPath(_slow_path_%name%)
 755 callSlowPath(_slow_path_%opcodeName%)
756756 dispatch()
757757 end)
758758end
759759
760760
761 macro equalNullComparisonOp(name, op, fn)
762  llintOpWithReturn(name, op, macro (size, get, dispatch, return)
 761macro equalNullComparisonOp(opcodeName, opcodeStruct, fn)
 762 llintOpWithReturn(opcodeName, opcodeStruct, macro (size, get, dispatch, return)
763763 get(m_operand, t0)
764764 loadq [cfr, t0, 8], t0
765765 btqnz t0, tagMask, .immediate

@@llintOpWithReturn(op_is_undefined_or_nul
799799end)
800800
801801
802 macro strictEqOp(name, op, equalityOperation)
803  llintOpWithReturn(op_%name%, op, macro (size, get, dispatch, return)
 802macro strictEqOp(opcodeName, opcodeStruct, equalityOperation)
 803 llintOpWithReturn(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch, return)
804804 get(m_rhs, t0)
805805 get(m_lhs, t2)
806806 loadConstantOrVariable(size, t0, t1)

@@macro strictEqOp(name, op, equalityOpera
819819 return(t0)
820820
821821 .slow:
822  callSlowPath(_slow_path_%name%)
 822 callSlowPath(_slow_path_%opcodeName%)
823823 dispatch()
824824 end)
825825end

@@strictEqOp(nstricteq, OpNstricteq,
833833 macro (left, right, result) cqneq left, right, result end)
834834
835835
836 macro strictEqualityJumpOp(name, op, equalityOperation)
837  llintOpWithJump(op_%name%, op, macro (size, get, jump, dispatch)
 836macro strictEqualityJumpOp(opcodeName, opcodeStruct, equalityOperation)
 837 llintOpWithJump(op_%opcodeName%, opcodeStruct, macro (size, get, jump, dispatch)
838838 get(m_lhs, t2)
839839 get(m_rhs, t3)
840840 loadConstantOrVariable(size, t2, t0)

@@macro strictEqualityJumpOp(name, op, equ
852852 dispatch()
853853
854854 .jumpTarget:
855  jump(m_target)
 855 jump(m_targetLabel)
856856
857857 .slow:
858  callSlowPath(_llint_slow_path_%name%)
 858 callSlowPath(_llint_slow_path_%opcodeName%)
859859 nextInstruction()
860860 end)
861861end

@@strictEqualityJumpOp(jnstricteq, OpJnstr
869869 macro (left, right, target) bqneq left, right, target end)
870870
871871
872 macro preOp(name, op, arithmeticOperation)
873  llintOp(op_%name%, op, macro (size, get, dispatch)
 872macro preOp(opcodeName, opcodeStruct, arithmeticOperation)
 873 llintOp(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch)
874874 get(m_srcDst, t0)
875875 loadq [cfr, t0, 8], t1
876876 bqb t1, tagTypeNumber, .slow

@@macro preOp(name, op, arithmeticOperatio
879879 storeq t1, [cfr, t0, 8]
880880 dispatch()
881881 .slow:
882  callSlowPath(_slow_path_%name%)
 882 callSlowPath(_slow_path_%opcodeName%)
883883 dispatch()
884884 end)
885885end

@@llintOpWithMetadata(op_negate, OpNegate,
929929 get(m_operand, t0)
930930 loadConstantOrVariable(size, t0, t3)
931931 metadata(t1, t2)
932  loadis OpNegate::Metadata::m_arithProfile[t1], t2
 932 loadi OpNegate::Metadata::m_arithProfile + ArithProfile::m_bits[t1], t2
933933 bqb t3, tagTypeNumber, .opNegateNotInt
934934 btiz t3, 0x7fffffff, .opNegateSlow
935935 negi t3
936936 orq tagTypeNumber, t3
937937 ori ArithProfileInt, t2
938  storei t2, OpNegate::Metadata::m_arithProfile[t1]
 938 storei t2, OpNegate::Metadata::m_arithProfile + ArithProfile::m_bits[t1]
939939 return(t3)
940940.opNegateNotInt:
941941 btqz t3, tagTypeNumber, .opNegateSlow
942942 xorq 0x8000000000000000, t3
943943 ori ArithProfileNumber, t2
944  storei t2, OpNegate::Metadata::m_arithProfile[t1]
 944 storei t2, OpNegate::Metadata::m_arithProfile + ArithProfile::m_bits[t1]
945945 return(t3)
946946
947947.opNegateSlow:

@@llintOpWithMetadata(op_negate, OpNegate,
950950end)
951951
952952
953 macro binaryOpCustomStore(name, op, integerOperationAndStore, doubleOperation)
954  llintOpWithMetadata(op_%name%, op, macro (size, get, dispatch, metadata, return)
 953macro binaryOpCustomStore(opcodeName, opcodeStruct, integerOperationAndStore, doubleOperation)
 954 llintOpWithMetadata(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch, metadata, return)
955955 metadata(t5, t0)
956956
957957 macro profile(type)
958  ori type, %op%::Metadata::m_arithProfile[t5]
 958 ori type, %opcodeStruct%::Metadata::m_arithProfile + ArithProfile::m_bits[t5]
959959 end
960960
961961 get(m_rhs, t0)

@@macro binaryOpCustomStore(name, op, inte
10071007 dispatch()
10081008
10091009 .slow:
1010  callSlowPath(_slow_path_%name%)
 1010 callSlowPath(_slow_path_%opcodeName%)
10111011 dispatch()
10121012 end)
10131013end

@@binaryOpCustomStore(mul, OpMul,
10521052 macro (left, right) muld left, right end)
10531053
10541054
1055 macro binaryOp(name, op, integerOperation, doubleOperation)
1056  binaryOpCustomStore(name, op,
 1055macro binaryOp(opcodeName, opcodeStruct, integerOperation, doubleOperation)
 1056 binaryOpCustomStore(opcodeName, opcodeStruct,
10571057 macro (left, right, slow, index)
10581058 integerOperation(left, right, slow)
10591059 orq tagTypeNumber, right

@@llintOpWithReturn(op_unsigned, OpUnsigne
10831083end)
10841084
10851085
1086 macro commonBitOp(opKind, name, op, operation)
1087  opKind(op_%name%, op, macro (size, get, dispatch, return)
 1086macro commonBitOp(opKind, opcodeName, opcodeStruct, operation)
 1087 opKind(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch, return)
10881088 get(m_rhs, t0)
10891089 get(m_lhs, t2)
10901090 loadConstantOrVariable(size, t0, t1)

@@macro commonBitOp(opKind, name, op, oper
10961096 return(t0)
10971097
10981098 .slow:
1099  callSlowPath(_slow_path_%name%)
 1099 callSlowPath(_slow_path_%opcodeName%)
11001100 dispatch()
11011101 end)
11021102end
11031103
1104 macro bitOp(name, op, operation)
1105  commonBitOp(llintOpWithReturn, name, op, operation)
 1104macro bitOp(opcodeName, opcodeStruct, operation)
 1105 commonBitOp(llintOpWithReturn, opcodeName, opcodeStruct, operation)
11061106end
11071107
1108 macro bitOpProfiled(name, op, operation)
1109  commonBitOp(llintOpWithProfile, name, op, operation)
 1108macro bitOpProfiled(opcodeName, opcodeStruct, operation)
 1109 commonBitOp(llintOpWithProfile, opcodeName, opcodeStruct, operation)
11101110end
11111111
11121112bitOp(lshift, OpLshift,

@@llintOpWithMetadata(op_get_by_id_direct,
12691269 get(m_base, t0)
12701270 loadConstantOrVariableCell(size, t0, t3, .opGetByIdDirectSlow)
12711271 loadi JSCell::m_structureID[t3], t1
1272  loadi OpGetByIdDirect::Metadata::m_structure[t2], t0
 1272 loadi OpGetByIdDirect::Metadata::m_structureID[t2], t0
12731273 bineq t0, t1, .opGetByIdDirectSlow
12741274 loadi OpGetByIdDirect::Metadata::m_offset[t2], t1
12751275 loadPropertyAtVariableOffset(t1, t3, t0)

@@llintOpWithMetadata(op_get_by_id, OpGetB
12911291.opGetByIdDefault:
12921292 bbneq t1, constexpr GetByIdMode::Default, .opGetByIdProtoLoad
12931293 loadi JSCell::m_structureID[t3], t1
1294  loadi OpGetById::Metadata::m_modeMetadata.defaultMode.structure[t2], t0
 1294 loadi OpGetById::Metadata::m_modeMetadata.defaultMode.structureID[t2], t0
12951295 bineq t0, t1, .opGetByIdSlow
12961296 loadis OpGetById::Metadata::m_modeMetadata.defaultMode.cachedOffset[t2], t1
12971297 loadPropertyAtVariableOffset(t1, t3, t0)

@@llintOpWithMetadata(op_get_by_id, OpGetB
13011301.opGetByIdProtoLoad:
13021302 bbneq t1, constexpr GetByIdMode::ProtoLoad, .opGetByIdArrayLength
13031303 loadi JSCell::m_structureID[t3], t1
1304  loadi OpGetById::Metadata::m_modeMetadata.protoLoadMode.structure[t2], t3
 1304 loadi OpGetById::Metadata::m_modeMetadata.protoLoadMode.structureID[t2], t3
13051305 bineq t3, t1, .opGetByIdSlow
13061306 loadis OpGetById::Metadata::m_modeMetadata.protoLoadMode.cachedOffset[t2], t1
13071307 loadp OpGetById::Metadata::m_modeMetadata.protoLoadMode.cachedSlot[t2], t3

@@llintOpWithMetadata(op_get_by_id, OpGetB
13241324
13251325.opGetByIdUnset:
13261326 loadi JSCell::m_structureID[t3], t1
1327  loadi OpGetById::Metadata::m_modeMetadata.unsetMode.structure[t2], t0
 1327 loadi OpGetById::Metadata::m_modeMetadata.unsetMode.structureID[t2], t0
13281328 bineq t0, t1, .opGetByIdSlow
13291329 valueProfile(OpGetById, t2, ValueUndefined)
13301330 return(ValueUndefined)

@@llintOpWithMetadata(op_put_by_id, OpPutB
13391339 get(m_base, t3)
13401340 loadConstantOrVariableCell(size, t3, t0, .opPutByIdSlow)
13411341 metadata(t5, t2)
1342  loadis OpPutById::Metadata::m_oldStructure[t5], t2
 1342 loadi OpPutById::Metadata::m_oldStructureID[t5], t2
13431343 bineq t2, JSCell::m_structureID[t0], .opPutByIdSlow
13441344
13451345 # At this point, we have:

@@llintOpWithMetadata(op_put_by_id, OpPutB
13471347 # t2 -> current structure ID
13481348 # t5 -> metadata
13491349
1350  loadi OpPutById::Metadata::m_newStructure[t5], t1
 1350 loadi OpPutById::Metadata::m_newStructureID[t5], t1
13511351 btiz t1, .opPutByIdNotTransition
13521352
13531353 # This is the transition case. t1 holds the new structureID. t2 holds the old structure ID.

@@llintOpWithMetadata(op_put_by_id, OpPutB
13801380
13811381.opPutByIdTransitionChainDone:
13821382 # Reload the new structure, since we clobbered it above.
1383  loadi OpPutById::Metadata::m_newStructure[t5], t1
 1383 loadi OpPutById::Metadata::m_newStructureID[t5], t1
13841384
13851385.opPutByIdTransitionDirect:
13861386 storei t1, JSCell::m_structureID[t0]

@@llintOpWithMetadata(op_get_by_val, OpGet
15741574end)
15751575
15761576
1577 macro putByValOp(name, op)
1578  llintOpWithMetadata(op_%name%, op, macro (size, get, dispatch, metadata, return)
 1577macro putByValOp(opcodeName, opcodeStruct)
 1578 llintOpWithMetadata(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch, metadata, return)
15791579 macro contiguousPutByVal(storeCallback)
15801580 biaeq t3, -sizeof IndexingHeader + IndexingHeader::u.lengths.publicLength[t0], .outOfBounds
15811581 .storeResult:

@@macro putByValOp(name, op)
15851585
15861586 .outOfBounds:
15871587 biaeq t3, -sizeof IndexingHeader + IndexingHeader::u.lengths.vectorLength[t0], .opPutByValOutOfBounds
1588  storeb 1, %op%::Metadata::m_arrayProfile.m_mayStoreToHole[t5]
 1588 storeb 1, %opcodeStruct%::Metadata::m_arrayProfile.m_mayStoreToHole[t5]
15891589 addi 1, t3, t2
15901590 storei t2, -sizeof IndexingHeader + IndexingHeader::u.lengths.publicLength[t0]
15911591 jmp .storeResult

@@macro putByValOp(name, op)
15951595 loadConstantOrVariableCell(size, t0, t1, .opPutByValSlow)
15961596 move t1, t2
15971597 metadata(t5, t0)
1598  arrayProfile(%op%::Metadata::m_arrayProfile, t2, t5, t0)
 1598 arrayProfile(%opcodeStruct%::Metadata::m_arrayProfile, t2, t5, t0)
15991599 get(m_property, t0)
16001600 loadConstantOrVariableInt32(size, t0, t3, .opPutByValSlow)
16011601 sxi2q t3, t3

@@macro putByValOp(name, op)
16501650 dispatch()
16511651
16521652 .opPutByValArrayStorageEmpty:
1653  storeb 1, %op%::Metadata::m_arrayProfile.m_mayStoreToHole[t5]
 1653 storeb 1, %opcodeStruct%::Metadata::m_arrayProfile.m_mayStoreToHole[t5]
16541654 addi 1, ArrayStorage::m_numValuesInVector[t0]
16551655 bib t3, -sizeof IndexingHeader + IndexingHeader::u.lengths.publicLength[t0], .opPutByValArrayStorageStoreResult
16561656 addi 1, t3, t1

@@macro putByValOp(name, op)
16581658 jmp .opPutByValArrayStorageStoreResult
16591659
16601660 .opPutByValOutOfBounds:
1661  storeb 1, %op%::Metadata::m_arrayProfile.m_outOfBounds[t5]
 1661 storeb 1, %opcodeStruct%::Metadata::m_arrayProfile.m_outOfBounds[t5]
16621662 .opPutByValSlow:
1663  callSlowPath(_llint_slow_path_%name%)
 1663 callSlowPath(_llint_slow_path_%opcodeName%)
16641664 dispatch()
16651665 end)
16661666end

@@putByValOp(put_by_val, OpPutByVal)
16701670putByValOp(put_by_val_direct, OpPutByValDirect)
16711671
16721672
1673 macro llintJumpTrueOrFalseOp(name, op, conditionOp)
1674  llintOpWithJump(op_%name%, op, macro (size, get, jump, dispatch)
 1673macro llintJumpTrueOrFalseOp(opcodeName, opcodeStruct, conditionOp)
 1674 llintOpWithJump(op_%opcodeName%, opcodeStruct, macro (size, get, jump, dispatch)
16751675 get(m_condition, t1)
16761676 loadConstantOrVariable(size, t1, t0)
16771677 btqnz t0, ~0xf, .slow

@@macro llintJumpTrueOrFalseOp(name, op, c
16791679 dispatch()
16801680
16811681 .target:
1682  jump(m_target)
 1682 jump(m_targetLabel)
16831683
16841684 .slow:
1685  callSlowPath(_llint_slow_path_%name%)
 1685 callSlowPath(_llint_slow_path_%opcodeName%)
16861686 nextInstruction()
16871687 end)
16881688end
16891689
16901690
1691 macro equalNullJumpOp(name, op, cellHandler, immediateHandler)
1692  llintOpWithJump(op_%name%, op, macro (size, get, jump, dispatch)
 1691macro equalNullJumpOp(opcodeName, opcodeStruct, cellHandler, immediateHandler)
 1692 llintOpWithJump(op_%opcodeName%, opcodeStruct, macro (size, get, jump, dispatch)
16931693 get(m_value, t0)
16941694 assertNotConstant(size, t0)
16951695 loadq [cfr, t0, 8], t0

@@macro equalNullJumpOp(name, op, cellHand
16991699 dispatch()
17001700
17011701 .target:
1702  jump(m_target)
 1702 jump(m_targetLabel)
17031703
17041704 .immediate:
17051705 andq ~TagBitUndefined, t0

@@equalNullJumpOp(jneq_null, OpJneqNull,
17311731
17321732llintOpWithMetadata(op_jneq_ptr, OpJneqPtr, macro (size, get, dispatch, metadata, return)
17331733 get(m_value, t0)
1734  get(m_specialPointer, t1)
 1734 getu(size, OpJneqPtr, m_specialPointer, t1)
17351735 loadp CodeBlock[cfr], t2
17361736 loadp CodeBlock::m_globalObject[t2], t2
17371737 loadp JSGlobalObject::m_specialPointers[t2, t1, PtrSize], t1

@@llintOpWithMetadata(op_jneq_ptr, OpJneqP
17411741.opJneqPtrTarget:
17421742 metadata(t5, t0)
17431743 storeb 1, OpJneqPtr::Metadata::m_hasJumped[t5]
1744  get(m_target, t0)
 1744 get(m_targetLabel, t0)
17451745 jumpImpl(t0)
17461746end)
17471747
17481748
1749 macro compareJumpOp(name, op, integerCompare, doubleCompare)
1750  llintOpWithJump(op_%name%, op, macro (size, get, jump, dispatch)
 1749macro compareJumpOp(opcodeName, opcodeStruct, integerCompare, doubleCompare)
 1750 llintOpWithJump(op_%opcodeName%, opcodeStruct, macro (size, get, jump, dispatch)
17511751 get(m_lhs, t2)
17521752 get(m_rhs, t3)
17531753 loadConstantOrVariable(size, t2, t0)

@@macro compareJumpOp(name, op, integerCom
17811781 dispatch()
17821782
17831783 .jumpTarget:
1784  jump(m_target)
 1784 jump(m_targetLabel)
17851785
17861786 .slow:
1787  callSlowPath(_llint_slow_path_%name%)
 1787 callSlowPath(_llint_slow_path_%opcodeName%)
17881788 nextInstruction()
17891789 end)
17901790end
17911791
17921792
1793 macro equalityJumpOp(name, op, integerComparison)
1794  llintOpWithJump(op_%name%, op, macro (size, get, jump, dispatch)
 1793macro equalityJumpOp(opcodeName, opcodeStruct, integerComparison)
 1794 llintOpWithJump(op_%opcodeName%, opcodeStruct, macro (size, get, jump, dispatch)
17951795 get(m_lhs, t2)
17961796 get(m_rhs, t3)
17971797 loadConstantOrVariableInt32(size, t2, t0, .slow)

@@macro equalityJumpOp(name, op, integerCo
18001800 dispatch()
18011801
18021802 .jumpTarget:
1803  jump(m_target)
 1803 jump(m_targetLabel)
18041804
18051805 .slow:
1806  callSlowPath(_llint_slow_path_%name%)
 1806 callSlowPath(_llint_slow_path_%opcodeName%)
18071807 nextInstruction()
18081808 end)
18091809end
18101810
18111811
1812 macro compareUnsignedJumpOp(name, op, integerCompareMacro)
1813  llintOpWithJump(op_%name%, op, macro (size, get, jump, dispatch)
 1812macro compareUnsignedJumpOp(opcodeName, opcodeStruct, integerCompareMacro)
 1813 llintOpWithJump(op_%opcodeName%, opcodeStruct, macro (size, get, jump, dispatch)
18141814 get(m_lhs, t2)
18151815 get(m_rhs, t3)
18161816 loadConstantOrVariable(size, t2, t0)

@@macro compareUnsignedJumpOp(name, op, in
18191819 dispatch()
18201820
18211821 .jumpTarget:
1822  jump(m_target)
 1822 jump(m_targetLabel)
18231823 end)
18241824end
18251825
18261826
1827 macro compareUnsignedOp(name, op, integerCompareAndSet)
1828  llintOpWithReturn(op_%name%, op, macro (size, get, dispatch, return)
 1827macro compareUnsignedOp(opcodeName, opcodeStruct, integerCompareAndSet)
 1828 llintOpWithReturn(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch, return)
18291829 get(m_lhs, t2)
18301830 get(m_rhs, t0)
18311831 loadConstantOrVariable(size, t0, t1)

@@end
18391839
18401840llintOpWithJump(op_switch_imm, OpSwitchImm, macro (size, get, jump, dispatch)
18411841 get(m_scrutinee, t2)
1842  get(m_tableIndex, t3)
 1842 getu(size, OpSwitchImm, m_tableIndex, t3)
18431843 loadConstantOrVariable(size, t2, t1)
18441844 loadp CodeBlock[cfr], t2
18451845 loadp CodeBlock::m_rareData[t2], t2

@@end)
18671867
18681868llintOpWithJump(op_switch_char, OpSwitchChar, macro (size, get, jump, dispatch)
18691869 get(m_scrutinee, t2)
1870  get(m_tableIndex, t3)
 1870 getu(size, OpSwitchChar, m_tableIndex, t3)
18711871 loadConstantOrVariable(size, t2, t1)
18721872 loadp CodeBlock[cfr], t2
18731873 loadp CodeBlock::m_rareData[t2], t2

@@end)
19031903
19041904
19051905# we assume t5 contains the metadata, and we should not scratch that
1906 macro arrayProfileForCall(op, getu)
 1906macro arrayProfileForCall(opcodeStruct, getu)
19071907 getu(m_argv, t3)
19081908 negp t3
19091909 loadq ThisArgumentOffset[cfr, t3, 8], t0
19101910 btqnz t0, tagMask, .done
19111911 loadi JSCell::m_structureID[t0], t3
1912  storei t3, %op%::Metadata::m_arrayProfile.m_lastSeenStructureID[t5]
 1912 storei t3, %opcodeStruct%::Metadata::m_arrayProfile.m_lastSeenStructureID[t5]
19131913.done:
19141914end
19151915
1916 macro commonCallOp(name, slowPath, op, prepareCall, prologue)
1917  llintOpWithMetadata(name, op, macro (size, get, dispatch, metadata, return)
 1916macro commonCallOp(opcodeName, slowPath, opcodeStruct, prepareCall, prologue)
 1917 llintOpWithMetadata(opcodeName, opcodeStruct, macro (size, get, dispatch, metadata, return)
19181918 metadata(t5, t0)
19191919
19201920 prologue(macro (fieldName, dst)
1921  getu(size, op, fieldName, dst)
 1921 getu(size, opcodeStruct, fieldName, dst)
19221922 end, metadata)
19231923
19241924 get(m_callee, t0)
1925  loadp %op%::Metadata::m_callLinkInfo.callee[t5], t2
 1925 loadp %opcodeStruct%::Metadata::m_callLinkInfo.callee[t5], t2
19261926 loadConstantOrVariable(size, t0, t3)
19271927 bqneq t3, t2, .opCallSlow
1928  getu(size, op, m_argv, t3)
 1928 getu(size, opcodeStruct, m_argv, t3)
19291929 lshifti 3, t3
19301930 negp t3
19311931 addp cfr, t3
19321932 storeq t2, Callee[t3]
1933  getu(size, op, m_argc, t2)
 1933 getu(size, opcodeStruct, m_argc, t2)
19341934 storei PC, ArgumentCount + TagOffset[cfr]
19351935 storei t2, ArgumentCount + PayloadOffset[t3]
19361936 move t3, sp
19371937 if POISON
19381938 loadp _g_JITCodePoison, t2
1939  xorp %op%::Metadata::m_callLinkInfo.machineCodeTarget[t5], t2
 1939 xorp %opcodeStruct%::Metadata::m_callLinkInfo.machineCodeTarget[t5], t2
19401940 prepareCall(t2, t1, t3, t4, JSEntryPtrTag)
1941  callTargetFunction(size, op, dispatch, t2, JSEntryPtrTag)
 1941 callTargetFunction(size, opcodeStruct, dispatch, t2, JSEntryPtrTag)
19421942 else
1943  prepareCall(%op%::Metadata::m_callLinkInfo.machineCodeTarget[t5], t2, t3, t4, JSEntryPtrTag)
1944  callTargetFunction(size, op, dispatch, %op%::Metadata::m_callLinkInfo.machineCodeTarget[t5], JSEntryPtrTag)
 1943 prepareCall(%opcodeStruct%::Metadata::m_callLinkInfo.machineCodeTarget[t5], t2, t3, t4, JSEntryPtrTag)
 1944 callTargetFunction(size, opcodeStruct, dispatch, %opcodeStruct%::Metadata::m_callLinkInfo.machineCodeTarget[t5], JSEntryPtrTag)
19451945 end
19461946
19471947 .opCallSlow:
1948  slowPathForCall(size, op, dispatch, slowPath, prepareCall)
 1948 slowPathForCall(size, opcodeStruct, dispatch, slowPath, prepareCall)
19491949 end)
19501950end
19511951

@@llintOpWithMetadata(op_resolve_scope, Op
21702170 return(t0)
21712171 end
21722172
2173  loadp OpResolveScope::Metadata::m_resolveType[t5], t0
 2173 loadi OpResolveScope::Metadata::m_resolveType[t5], t0
21742174
21752175#rGlobalProperty:
21762176 bineq t0, GlobalProperty, .rGlobalVar

@@llintOpWithMetadata(op_resolve_scope, Op
22182218end)
22192219
22202220
2221 macro loadWithStructureCheck(op, get, slowPath)
 2221macro loadWithStructureCheck(opcodeStruct, get, slowPath)
22222222 get(m_scope, t0)
22232223 loadq [cfr, t0, 8], t0
22242224 loadStructureWithScratch(t0, t2, t1, t3)
2225  loadp %op%::Metadata::m_structure[t5], t1
 2225 loadp %opcodeStruct%::Metadata::m_structure[t5], t1
22262226 bpneq t2, t1, slowPath
22272227end
22282228

@@llintOpWithMetadata(op_get_from_scope, O
22512251 return(t0)
22522252 end
22532253
2254  loadi OpGetFromScope::Metadata::m_getPutInfo[t5], t0
 2254 loadi OpGetFromScope::Metadata::m_getPutInfo + GetPutInfo::m_operand[t5], t0
22552255 andi ResolveTypeMask, t0
22562256
22572257#gGlobalProperty:

@@llintOpWithMetadata(op_put_to_scope, OpP
23092309 macro putProperty()
23102310 get(m_value, t1)
23112311 loadConstantOrVariable(size, t1, t2)
2312  loadis OpPutToScope::Metadata::m_operand[t5], t1
 2312 loadp OpPutToScope::Metadata::m_operand[t5], t1
23132313 storePropertyAtVariableOffset(t1, t0, t2)
23142314 end
23152315

@@llintOpWithMetadata(op_put_to_scope, OpP
23252325 macro putClosureVar()
23262326 get(m_value, t1)
23272327 loadConstantOrVariable(size, t1, t2)
2328  loadis OpPutToScope::Metadata::m_operand[t5], t1
 2328 loadp OpPutToScope::Metadata::m_operand[t5], t1
23292329 storeq t2, JSLexicalEnvironment_variables[t0, t1, 8]
23302330 end
23312331

@@llintOpWithMetadata(op_put_to_scope, OpP
23362336 btpz t3, .noVariableWatchpointSet
23372337 notifyWrite(t3, .pDynamic)
23382338 .noVariableWatchpointSet:
2339  loadis OpPutToScope::Metadata::m_operand[t5], t1
 2339 loadp OpPutToScope::Metadata::m_operand[t5], t1
23402340 storeq t2, JSLexicalEnvironment_variables[t0, t1, 8]
23412341 end
23422342
23432343 macro checkTDZInGlobalPutToScopeIfNecessary()
2344  loadis OpPutToScope::Metadata::m_getPutInfo[t5], t0
 2344 loadi OpPutToScope::Metadata::m_getPutInfo + GetPutInfo::m_operand[t5], t0
23452345 andi InitializationModeMask, t0
23462346 rshifti InitializationModeShift, t0
23472347 bineq t0, NotInitialization, .noNeedForTDZCheck

@@llintOpWithMetadata(op_put_to_scope, OpP
23522352 end
23532353
23542354 metadata(t5, t0)
2355  loadi OpPutToScope::Metadata::m_getPutInfo[t5], t0
 2355 loadi OpPutToScope::Metadata::m_getPutInfo + GetPutInfo::m_operand[t5], t0
23562356 andi ResolveTypeMask, t0
23572357
23582358#pLocalClosureVar:

@@llintOpWithMetadata(op_profile_type, OpP
24662466 loadp TypeProfilerLog::m_currentLogEntryPtr[t1], t2
24672467
24682468 # t0 is holding the JSValue argument.
2469  get(m_target, t3)
 2469 get(m_targetVirtualRegister, t3)
24702470 loadConstantOrVariable(size, t3, t0)
24712471
24722472 bqeq t0, ValueEmpty, .opProfileTypeDone
240135

Source/JavaScriptCore/llint/LowLevelInterpreter.asm

@@else
285285 end
286286end
287287
288 macro dispatch(advance)
289  addp advance, PC
 288macro dispatch(advanceReg)
 289 addp advanceReg, PC
290290 nextInstruction()
291291end
292292
293 macro dispatchIndirect(offset)
294  dispatch(offset)
 293macro dispatchIndirect(offsetReg)
 294 dispatch(offsetReg)
295295end
296296
297 macro dispatchOp(size, op)
 297macro dispatchOp(size, opcodeName)
298298 macro dispatchNarrow()
299  dispatch(constexpr %op%_length)
 299 dispatch(constexpr %opcodeName%_length)
300300 end
301301
302302 macro dispatchWide()
303  dispatch(constexpr %op%_length * 4 + 1)
 303 dispatch(constexpr %opcodeName%_length * 4 + 1)
304304 end
305305
306306 size(dispatchNarrow, dispatchWide, macro (dispatch) dispatch() end)
307307end
308308
309 macro getu(size, op, fieldName, dst)
 309macro getu(size, opcodeStruct, fieldName, dst)
310310 size(getuOperandNarrow, getuOperandWide, macro (getu)
311  getu(op, fieldName, dst)
 311 getu(opcodeStruct, fieldName, dst)
312312 end)
313313end
314314
315 macro get(size, op, fieldName, dst)
 315macro get(size, opcodeStruct, fieldName, dst)
316316 size(getOperandNarrow, getOperandWide, macro (get)
317  get(op, fieldName, dst)
 317 get(opcodeStruct, fieldName, dst)
318318 end)
319319end
320320

@@macro metadata(size, opcode, dst, scratc
334334 addp metadataTable, dst # return &metadataTable[offset]
335335end
336336
337 macro jumpImpl(target)
338  btiz target, .outOfLineJumpTarget
339  dispatchIndirect(target)
 337macro jumpImpl(targetOffsetReg)
 338 btiz targetOffsetReg, .outOfLineJumpTarget
 339 dispatchIndirect(targetOffsetReg)
340340.outOfLineJumpTarget:
341341 callSlowPath(_llint_slow_path_out_of_line_jump_target)
342342 nextInstruction()

@@macro op(l, fn)
358358 end)
359359end
360360
361 macro llintOp(name, op, fn)
362  commonOp(llint_%name%, traceExecution, macro(size)
 361macro llintOp(opcodeName, opcodeStruct, fn)
 362 commonOp(llint_%opcodeName%, traceExecution, macro(size)
363363 macro getImpl(fieldName, dst)
364  get(size, op, fieldName, dst)
 364 get(size, opcodeStruct, fieldName, dst)
365365 end
366366
367367 macro dispatchImpl()
368  dispatchOp(size, name)
 368 dispatchOp(size, opcodeName)
369369 end
370370
371371 fn(size, getImpl, dispatchImpl)
372372 end)
373373end
374374
375 macro llintOpWithReturn(name, op, fn)
376  llintOp(name, op, macro(size, get, dispatch)
 375macro llintOpWithReturn(opcodeName, opcodeStruct, fn)
 376 llintOp(opcodeName, opcodeStruct, macro(size, get, dispatch)
377377 makeReturn(get, dispatch, macro (return)
378378 fn(size, get, dispatch, return)
379379 end)
380380 end)
381381end
382382
383 macro llintOpWithMetadata(name, op, fn)
384  llintOpWithReturn(name, op, macro (size, get, dispatch, return)
 383macro llintOpWithMetadata(opcodeName, opcodeStruct, fn)
 384 llintOpWithReturn(opcodeName, opcodeStruct, macro (size, get, dispatch, return)
385385 macro meta(dst, scratch)
386  metadata(size, op, dst, scratch)
 386 metadata(size, opcodeStruct, dst, scratch)
387387 end
388388 fn(size, get, dispatch, meta, return)
389389 end)
390390end
391391
392 macro llintOpWithJump(name, op, impl)
393  llintOpWithMetadata(name, op, macro(size, get, dispatch, metadata, return)
 392macro llintOpWithJump(opcodeName, opcodeStruct, impl)
 393 llintOpWithMetadata(opcodeName, opcodeStruct, macro(size, get, dispatch, metadata, return)
394394 macro jump(fieldName)
395395 get(fieldName, t0)
396396 jumpImpl(t0)

@@macro llintOpWithJump(name, op, impl)
400400 end)
401401end
402402
403 macro llintOpWithProfile(name, op, fn)
404  llintOpWithMetadata(name, op, macro(size, get, dispatch, metadata, return)
405  makeReturnProfiled(op, get, metadata, dispatch, macro (returnProfiled)
 403macro llintOpWithProfile(opcodeName, opcodeStruct, fn)
 404 llintOpWithMetadata(opcodeName, opcodeStruct, macro(size, get, dispatch, metadata, return)
 405 makeReturnProfiled(opcodeStruct, get, metadata, dispatch, macro (returnProfiled)
406406 fn(size, get, dispatch, returnProfiled)
407407 end)
408408 end)

@@macro traceExecution()
895895 end
896896end
897897
898 macro callTargetFunction(size, op, dispatch, callee, callPtrTag)
 898macro callTargetFunction(size, opcodeStruct, dispatch, callee, callPtrTag)
899899 if C_LOOP
900900 cloopCallJSFunction callee
901901 else
902902 call callee, callPtrTag
903903 end
904904 restoreStackPointerAfterCall()
905  dispatchAfterCall(size, op, dispatch)
 905 dispatchAfterCall(size, opcodeStruct, dispatch)
906906end
907907
908908macro prepareForRegularCall(callee, temp1, temp2, temp3, callPtrTag)

@@macro prepareForTailCall(callee, temp1,
915915
916916 loadi PayloadOffset + ArgumentCount[cfr], temp2
917917 loadp CodeBlock[cfr], temp1
918  loadp CodeBlock::m_numParameters[temp1], temp1
 918 loadi CodeBlock::m_numParameters[temp1], temp1
919919 bilteq temp1, temp2, .noArityFixup
920920 move temp1, temp2
921921

@@macro prepareForTailCall(callee, temp1,
970970 jmp callee, callPtrTag
971971end
972972
973 macro slowPathForCall(size, op, dispatch, slowPath, prepareCall)
 973macro slowPathForCall(size, opcodeStruct, dispatch, slowPath, prepareCall)
974974 callCallSlowPath(
975975 slowPath,
976976 # Those are r0 and r1

@@macro slowPathForCall(size, op, dispatch
979979 move calleeFramePtr, sp
980980 prepareCall(callee, t2, t3, t4, SlowPathPtrTag)
981981 .dontUpdateSP:
982  callTargetFunction(size, op, dispatch, callee, SlowPathPtrTag)
 982 callTargetFunction(size, opcodeStruct, dispatch, callee, SlowPathPtrTag)
983983 end)
984984end
985985

@@macro functionInitialization(profileArgS
11921192 loadp CodeBlock::m_argumentValueProfiles + RefCountedArray::m_data[t1], t3
11931193 btpz t3, .argumentProfileDone # When we can't JIT, we don't allocate any argument value profiles.
11941194 mulp sizeof ValueProfile, t0, t2 # Aaaaahhhh! Need strength reduction!
1195  lshiftp 3, t0
1196  addp t2, t3
 1195 lshiftp 3, t0 # offset of last JSValue arguments on the stack.
 1196 addp t2, t3 # pointer to end of ValueProfile array in CodeBlock::m_argumentValueProfiles.
11971197.argumentProfileLoop:
11981198 if JSVALUE64
11991199 loadq ThisArgumentOffset - 8 + profileArgSkip * 8[cfr, t0], t2

@@end
14331433
14341434
14351435# Value-representation-agnostic code.
1436 macro slowPathOp(op)
1437  llintOp(op_%op%, unused, macro (unused, unused, dispatch)
1438  callSlowPath(_slow_path_%op%)
 1436macro slowPathOp(opcodeName)
 1437 llintOp(op_%opcodeName%, unused, macro (unused, unused, dispatch)
 1438 callSlowPath(_slow_path_%opcodeName%)
14391439 dispatch()
14401440 end)
14411441end

@@slowPathOp(to_index_string)
14811481slowPathOp(typeof)
14821482slowPathOp(unreachable)
14831483
1484 macro llintSlowPathOp(op)
1485  llintOp(op_%op%, unused, macro (unused, unused, dispatch)
1486  callSlowPath(_llint_slow_path_%op%)
 1484macro llintSlowPathOp(opcodeName)
 1485 llintOp(op_%opcodeName%, unused, macro (unused, unused, dispatch)
 1486 callSlowPath(_llint_slow_path_%opcodeName%)
14871487 dispatch()
14881488 end)
14891489end

@@compareUnsignedOp(beloweq, OpBeloweq,
15381538
15391539
15401540llintOpWithJump(op_jmp, OpJmp, macro (size, get, jump, dispatch)
1541  jump(m_target)
 1541 jump(m_targetLabel)
15421542end)
15431543
15441544

@@commonCallOp(op_call, _llint_slow_path_c
16741674end)
16751675
16761676
1677 macro callOp(name, op, prepareCall, fn)
1678  commonCallOp(op_%name%, _llint_slow_path_%name%, op, prepareCall, fn)
 1677macro callOp(opcodeName, opcodeStruct, prepareCall, fn)
 1678 commonCallOp(op_%opcodeName%, _llint_slow_path_%opcodeName%, opcodeStruct, prepareCall, fn)
16791679end
16801680
16811681

@@end)
16901690callOp(construct, OpConstruct, prepareForRegularCall, macro (getu, metadata) end)
16911691
16921692
1693 macro doCallVarargs(size, op, dispatch, frameSlowPath, slowPath, prepareCall)
 1693macro doCallVarargs(size, opcodeStruct, dispatch, frameSlowPath, slowPath, prepareCall)
16941694 callSlowPath(frameSlowPath)
16951695 branchIfException(_llint_throw_from_slow_path_trampoline)
16961696 # calleeFrame in r1

@@macro doCallVarargs(size, op, dispatch,
17051705 subp r1, CallerFrameAndPCSize, sp
17061706 end
17071707 end
1708  slowPathForCall(size, op, dispatch, slowPath, prepareCall)
 1708 slowPathForCall(size, opcodeStruct, dispatch, slowPath, prepareCall)
17091709end
17101710
17111711
240135

Source/JavaScriptCore/runtime/CommonSlowPaths.cpp

@@namespace JSC {
125125 bool bCondition = (condition); \
126126 CHECK_EXCEPTION(); \
127127 if (bCondition) \
128  pc = bytecode.m_target \
129  ? reinterpret_cast<const Instruction*>(reinterpret_cast<const uint8_t*>(pc) + bytecode.m_target) \
 128 pc = bytecode.m_targetLabel \
 129 ? reinterpret_cast<const Instruction*>(reinterpret_cast<const uint8_t*>(pc) + bytecode.m_targetLabel) \
130130 : exec->codeBlock()->outOfLineJumpTarget(pc); \
131131 else \
132132 pc = reinterpret_cast<const Instruction*>(reinterpret_cast<const uint8_t*>(pc) + pc->size()); \
240135

Source/JavaScriptCore/runtime/GetPutInfo.h

11/*
2  * Copyright (C) 2015-2018 Apple Inc. All Rights Reserved.
 2 * Copyright (C) 2015-2019 Apple Inc. All Rights Reserved.
33 *
44 * Redistribution and use in source and binary forms, with or without
55 * modification, are permitted provided that the following conditions

@@enum ResolveMode {
3838 DoNotThrowIfNotFound
3939};
4040
41 enum ResolveType {
 41enum ResolveType : unsigned {
4242 // Lexical scope guaranteed a certain type of variable access.
4343 GlobalProperty,
4444 GlobalVar,

@@public:
210210 static const unsigned modeBits = ((1 << 30) - 1) & ~initializationBits & ~typeBits;
211211 static_assert((modeBits & initializationBits & typeBits) == 0x0, "There should be no intersection between ResolveMode ResolveType and InitializationMode");
212212
 213 GetPutInfo() = default;
 214
213215 GetPutInfo(ResolveMode resolveMode, ResolveType resolveType, InitializationMode initializationMode)
214216 : m_operand((resolveMode << modeShift) | (static_cast<unsigned>(initializationMode) << initializationShift) | resolveType)
215217 {

@@public:
228230 void dump(PrintStream&) const;
229231
230232private:
231  Operand m_operand;
 233 Operand m_operand { 0 };
 234
 235 friend class JSC::LLIntOffsetsExtractor;
232236};
233237
234238enum GetOrPut { Get, Put };
240135