Changeset 192605 in webkit
- Timestamp:
- Nov 18, 2015 6:48:48 PM (8 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r192603 r192605 1 2015-11-18 Filip Pizlo <fpizlo@apple.com> and Benjamin Poulain <bpoulain@apple.com> 2 3 FTL should be able to compile a small function with B3 4 https://bugs.webkit.org/show_bug.cgi?id=151423 5 6 Reviewed by Filip Pizlo. 7 8 * b3/B3LowerToAir.cpp: 9 (JSC::B3::Air::LowerToAir::lower): 10 * dfg/DFGPlan.cpp: 11 (JSC::DFG::Plan::compileInThreadImpl): 12 * ftl/FTLAbbreviatedTypes.h: 13 * ftl/FTLB3Output.cpp: 14 (JSC::FTL::Output::Output): 15 (JSC::FTL::Output::~Output): 16 (JSC::FTL::Output::initialize): 17 (JSC::FTL::Output::appendTo): 18 (JSC::FTL::Output::lockedStackSlot): 19 (JSC::FTL::Output::load): 20 (JSC::FTL::Output::store): 21 (JSC::FTL::Output::branch): 22 * ftl/FTLB3Output.h: 23 (JSC::FTL::Output::newBlock): 24 (JSC::FTL::Output::setOrigin): 25 (JSC::FTL::Output::origin): 26 (JSC::FTL::Output::framePointer): 27 (JSC::FTL::Output::constBool): 28 (JSC::FTL::Output::constInt32): 29 (JSC::FTL::Output::constIntPtr): 30 (JSC::FTL::Output::constInt64): 31 (JSC::FTL::Output::constDouble): 32 (JSC::FTL::Output::upsilon): 33 (JSC::FTL::Output::phi): 34 (JSC::FTL::Output::add): 35 (JSC::FTL::Output::sub): 36 (JSC::FTL::Output::mul): 37 (JSC::FTL::Output::neg): 38 (JSC::FTL::Output::doubleAdd): 39 (JSC::FTL::Output::doubleSub): 40 (JSC::FTL::Output::doubleMul): 41 (JSC::FTL::Output::doubleDiv): 42 (JSC::FTL::Output::doubleNeg): 43 (JSC::FTL::Output::bitAnd): 44 (JSC::FTL::Output::bitOr): 45 (JSC::FTL::Output::bitXor): 46 (JSC::FTL::Output::shl): 47 (JSC::FTL::Output::aShr): 48 (JSC::FTL::Output::lShr): 49 (JSC::FTL::Output::load64): 50 (JSC::FTL::Output::store32): 51 (JSC::FTL::Output::store64): 52 (JSC::FTL::Output::storePtr): 53 (JSC::FTL::Output::storeDouble): 54 (JSC::FTL::Output::addPtr): 55 (JSC::FTL::Output::address): 56 (JSC::FTL::Output::below): 57 (JSC::FTL::Output::isZero32): 58 (JSC::FTL::Output::notZero32): 59 (JSC::FTL::Output::isZero64): 60 (JSC::FTL::Output::notZero64): 61 (JSC::FTL::Output::isNull): 62 (JSC::FTL::Output::notNull): 63 (JSC::FTL::Output::testIsZero32): 64 (JSC::FTL::Output::testNonZero32): 65 (JSC::FTL::Output::testIsZero64): 66 (JSC::FTL::Output::testNonZero64): 67 (JSC::FTL::Output::testIsZeroPtr): 68 (JSC::FTL::Output::testNonZeroPtr): 69 (JSC::FTL::Output::call): 70 (JSC::FTL::Output::operation): 71 (JSC::FTL::Output::jump): 72 (JSC::FTL::Output::branch): 73 (JSC::FTL::Output::ret): 74 (JSC::FTL::Output::unreachable): 75 (JSC::FTL::Output::check): 76 (JSC::FTL::Output::anchor): 77 (JSC::FTL::Output::addIncomingToPhi): 78 (JSC::FTL::Output::~Output): Deleted. 79 (JSC::FTL::Output::appendTo): Deleted. 80 (JSC::FTL::Output::param): Deleted. 81 (JSC::FTL::Output::load): Deleted. 82 (JSC::FTL::Output::store): Deleted. 83 (JSC::FTL::Output::store16): Deleted. 84 * ftl/FTLCommonValues.cpp: 85 (JSC::FTL::CommonValues::CommonValues): 86 (JSC::FTL::CommonValues::initializeConstants): 87 * ftl/FTLCommonValues.h: 88 * ftl/FTLJITFinalizer.cpp: 89 (JSC::FTL::JITFinalizer::finalizeFunction): 90 * ftl/FTLLink.cpp: 91 (JSC::FTL::link): 92 * ftl/FTLLowerDFGToLLVM.cpp: 93 (JSC::FTL::DFG::LowerDFGToLLVM::LowerDFGToLLVM): 94 (JSC::FTL::DFG::LowerDFGToLLVM::lower): 95 (JSC::FTL::DFG::LowerDFGToLLVM::createPhiVariables): 96 (JSC::FTL::DFG::LowerDFGToLLVM::compileBlock): 97 (JSC::FTL::DFG::LowerDFGToLLVM::safelyInvalidateAfterTermination): 98 (JSC::FTL::DFG::LowerDFGToLLVM::compileNode): 99 (JSC::FTL::DFG::LowerDFGToLLVM::compileUpsilon): 100 (JSC::FTL::DFG::LowerDFGToLLVM::compilePhi): 101 (JSC::FTL::DFG::LowerDFGToLLVM::compileToThis): 102 (JSC::FTL::DFG::LowerDFGToLLVM::compileValueAdd): 103 (JSC::FTL::DFG::LowerDFGToLLVM::compileStrCat): 104 (JSC::FTL::DFG::LowerDFGToLLVM::compileArithAddOrSub): 105 (JSC::FTL::DFG::LowerDFGToLLVM::compileArrayifyToStructure): 106 (JSC::FTL::DFG::LowerDFGToLLVM::compileGetById): 107 (JSC::FTL::DFG::LowerDFGToLLVM::compilePutById): 108 (JSC::FTL::DFG::LowerDFGToLLVM::compileGetIndexedPropertyStorage): 109 (JSC::FTL::DFG::LowerDFGToLLVM::compileGetByVal): 110 (JSC::FTL::DFG::LowerDFGToLLVM::compilePutByVal): 111 (JSC::FTL::DFG::LowerDFGToLLVM::compilePutAccessorById): 112 (JSC::FTL::DFG::LowerDFGToLLVM::compilePutGetterSetterById): 113 (JSC::FTL::DFG::LowerDFGToLLVM::compilePutAccessorByVal): 114 (JSC::FTL::DFG::LowerDFGToLLVM::compileArrayPush): 115 (JSC::FTL::DFG::LowerDFGToLLVM::compileArrayPop): 116 (JSC::FTL::DFG::LowerDFGToLLVM::compileCreateActivation): 117 (JSC::FTL::DFG::LowerDFGToLLVM::compileNewFunction): 118 (JSC::FTL::DFG::LowerDFGToLLVM::compileCreateScopedArguments): 119 (JSC::FTL::DFG::LowerDFGToLLVM::compileCreateClonedArguments): 120 (JSC::FTL::DFG::LowerDFGToLLVM::compileNewArray): 121 (JSC::FTL::DFG::LowerDFGToLLVM::compileNewArrayBuffer): 122 (JSC::FTL::DFG::LowerDFGToLLVM::compileNewArrayWithSize): 123 (JSC::FTL::DFG::LowerDFGToLLVM::compileToStringOrCallStringConstructor): 124 (JSC::FTL::DFG::LowerDFGToLLVM::compileToPrimitive): 125 (JSC::FTL::DFG::LowerDFGToLLVM::compileStringCharAt): 126 (JSC::FTL::DFG::LowerDFGToLLVM::compileCallOrConstruct): 127 (JSC::FTL::DFG::LowerDFGToLLVM::compileTailCall): 128 (JSC::FTL::DFG::LowerDFGToLLVM::compileCallOrConstructVarargs): 129 (JSC::FTL::DFG::LowerDFGToLLVM::compileLoadVarargs): 130 (JSC::FTL::DFG::LowerDFGToLLVM::compileSwitch): 131 (JSC::FTL::DFG::LowerDFGToLLVM::compileInvalidationPoint): 132 (JSC::FTL::DFG::LowerDFGToLLVM::compileIn): 133 (JSC::FTL::DFG::LowerDFGToLLVM::compileHasIndexedProperty): 134 (JSC::FTL::DFG::LowerDFGToLLVM::compileHasGenericProperty): 135 (JSC::FTL::DFG::LowerDFGToLLVM::compileHasStructureProperty): 136 (JSC::FTL::DFG::LowerDFGToLLVM::compileGetDirectPname): 137 (JSC::FTL::DFG::LowerDFGToLLVM::compileGetPropertyEnumerator): 138 (JSC::FTL::DFG::LowerDFGToLLVM::compileToIndexString): 139 (JSC::FTL::DFG::LowerDFGToLLVM::didOverflowStack): 140 (JSC::FTL::DFG::LowerDFGToLLVM::allocatePropertyStorage): 141 (JSC::FTL::DFG::LowerDFGToLLVM::reallocatePropertyStorage): 142 (JSC::FTL::DFG::LowerDFGToLLVM::getById): 143 (JSC::FTL::DFG::LowerDFGToLLVM::nonSpeculativeCompare): 144 (JSC::FTL::DFG::LowerDFGToLLVM::contiguousPutByValOutOfBounds): 145 (JSC::FTL::DFG::LowerDFGToLLVM::switchStringSlow): 146 (JSC::FTL::DFG::LowerDFGToLLVM::doubleToInt32): 147 (JSC::FTL::DFG::LowerDFGToLLVM::sensibleDoubleToInt32): 148 (JSC::FTL::DFG::LowerDFGToLLVM::lazySlowPath): 149 (JSC::FTL::DFG::LowerDFGToLLVM::jsValueToStrictInt52): 150 (JSC::FTL::DFG::LowerDFGToLLVM::doubleToStrictInt52): 151 (JSC::FTL::DFG::LowerDFGToLLVM::vmCall): 152 (JSC::FTL::DFG::LowerDFGToLLVM::callCheck): 153 (JSC::FTL::DFG::LowerDFGToLLVM::lowBlock): 154 (JSC::FTL::DFG::LowerDFGToLLVM::appendOSRExit): 155 (JSC::FTL::DFG::LowerDFGToLLVM::callStackmap): 156 (JSC::FTL::DFG::LowerDFGToLLVM::probe): 157 (JSC::FTL::DFG::LowerDFGToLLVM::crash): 158 (JSC::FTL::lowerDFGToLLVM): 159 (JSC::FTL::DFG::LowerDFGToLLVM::vmCallNoExceptions): Deleted. 160 * ftl/FTLOutput.cpp: 161 (JSC::FTL::Output::sensibleDoubleToInt): 162 * ftl/FTLOutput.h: 163 (JSC::FTL::Output::ceil64): 164 (JSC::FTL::Output::ctlz32): 165 (JSC::FTL::Output::addWithOverflow32): 166 (JSC::FTL::Output::subWithOverflow32): 167 (JSC::FTL::Output::mulWithOverflow32): 168 (JSC::FTL::Output::addWithOverflow64): 169 (JSC::FTL::Output::subWithOverflow64): 170 (JSC::FTL::Output::mulWithOverflow64): 171 (JSC::FTL::Output::doubleAbs): 172 (JSC::FTL::Output::doubleSin): 173 (JSC::FTL::Output::doubleCos): 174 (JSC::FTL::Output::doublePow): 175 (JSC::FTL::Output::doublePowi): 176 (JSC::FTL::Output::doubleSqrt): 177 (JSC::FTL::Output::doubleLog): 178 (JSC::FTL::Output::call): 179 (JSC::FTL::Output::trap): 180 * ftl/FTLState.cpp: 181 (JSC::FTL::State::State): Deleted. 182 * ftl/FTLState.h: 183 * ftl/FTLWeight.h: 184 (JSC::FTL::Weight::frequencyClass): 185 1 186 2015-11-18 Saam barati <sbarati@apple.com> 2 187 -
trunk/Source/JavaScriptCore/b3/B3LowerToAir.cpp
r192558 r192605 1715 1715 } 1716 1716 1717 case B3::Oops: { 1718 append(Air::Oops); 1719 return; 1720 } 1721 1717 1722 default: 1718 1723 break; -
trunk/Source/JavaScriptCore/dfg/DFGPlan.cpp
r191870 r192605 499 499 } 500 500 501 #if !FTL_USES_B3 501 502 if (state.jitCode->stackmaps.stackSize() > Options::llvmMaxStackSize()) { 502 503 FTL::fail(state); 503 504 return FTLPath; 504 505 } 506 #endif 505 507 506 508 FTL::link(state); -
trunk/Source/JavaScriptCore/ftl/FTLAbbreviatedTypes.h
r192591 r192605 1 1 /* 2 * Copyright (C) 2013 Apple Inc. All rights reserved.2 * Copyright (C) 2013, 2015 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 34 34 namespace JSC { namespace B3 { 35 35 class BasicBlock; 36 class Value; 36 37 enum Type : int8_t; 37 38 } } … … 42 43 typedef B3::BasicBlock* LBasicBlock; 43 44 typedef B3::Type LType; 45 typedef B3::Value* LValue; 44 46 #else 45 47 typedef LLVMBasicBlockRef LBasicBlock; 46 48 typedef LLVMTypeRef LType; 49 typedef LLVMValueRef LValue; 47 50 #endif 48 51 … … 55 58 typedef LLVMModuleRef LModule; 56 59 typedef LLVMRealPredicate LRealPredicate; 57 typedef LLVMValueRef LValue;58 60 typedef LLVMMemoryBufferRef LMemoryBuffer; 59 61 -
trunk/Source/JavaScriptCore/ftl/FTLB3Output.cpp
r192591 r192605 34 34 Output::Output(State& state) 35 35 : CommonValues(state.context) 36 , m_proc edure(*state.proc)36 , m_proc(*state.proc) 37 37 { 38 } 39 40 Output::~Output() 41 { 42 } 43 44 void Output::initialize(AbstractHeapRepository& heaps) 45 { 46 m_heaps = &heaps; 47 } 48 49 LBasicBlock Output::appendTo(LBasicBlock block, LBasicBlock nextBlock) 50 { 51 appendTo(block); 52 return insertNewBlocksBefore(nextBlock); 53 } 54 55 void Output::appendTo(LBasicBlock block) 56 { 57 m_block = block; 58 } 59 60 LValue Output::lockedStackSlot(size_t bytes) 61 { 62 return m_block->appendNew<B3::StackSlotValue>(m_proc, origin(), bytes, B3::StackSlotKind::Locked); 63 } 64 65 LValue Output::load(TypedPointer pointer, LType type) 66 { 67 LValue load = m_block->appendNew<B3::MemoryValue>(m_proc, B3::Load, type, origin(), pointer.value()); 68 pointer.heap().decorateInstruction(load, *m_heaps); 69 return load; 70 } 71 72 void Output::store(LValue value, TypedPointer pointer) 73 { 74 LValue store = m_block->appendNew<B3::MemoryValue>(m_proc, B3::Store, origin(), value, pointer.value()); 75 pointer.heap().decorateInstruction(store, *m_heaps); 76 } 77 78 void Output::branch(LValue condition, LBasicBlock taken, Weight takenWeight, LBasicBlock notTaken, Weight notTakenWeight) 79 { 80 m_block->appendNew<B3::ControlValue>( 81 m_proc, B3::Branch, origin(), condition, 82 B3::FrequentedBlock(taken, takenWeight.frequencyClass()), 83 B3::FrequentedBlock(notTaken, notTakenWeight.frequencyClass())); 38 84 } 39 85 -
trunk/Source/JavaScriptCore/ftl/FTLB3Output.h
r192591 r192605 32 32 #if FTL_USES_B3 33 33 34 #include "B3BasicBlock.h" 34 #include "B3ArgumentRegValue.h" 35 #include "B3BasicBlockInlines.h" 36 #include "B3CCallValue.h" 37 #include "B3Compilation.h" 38 #include "B3Const32Value.h" 39 #include "B3ConstPtrValue.h" 40 #include "B3ControlValue.h" 41 #include "B3MemoryValue.h" 35 42 #include "B3Procedure.h" 43 #include "B3StackSlotValue.h" 44 #include "B3SwitchValue.h" 45 #include "B3UpsilonValue.h" 46 #include "B3ValueInlines.h" 36 47 #include "FTLAbbreviatedTypes.h" 37 48 #include "FTLAbstractHeapRepository.h" … … 52 63 #endif // COMPILER(CLANG) 53 64 54 namespace JSC { namespace FTL { 65 namespace JSC { 66 67 namespace DFG { struct Node; } 68 69 namespace FTL { 55 70 56 71 enum Scale { ScaleOne, ScaleTwo, ScaleFour, ScaleEight, ScalePtr }; … … 59 74 public: 60 75 Output(State&); 61 ~Output() { CRASH(); } 76 ~Output(); 77 78 void initialize(AbstractHeapRepository&); 62 79 63 80 LBasicBlock newBlock(const char* name = "") 64 81 { 65 82 UNUSED_PARAM(name); 66 return m_proc edure.addBlock();83 return m_proc.addBlock(); 67 84 } 68 85 … … 74 91 } 75 92 76 LBasicBlock appendTo(LBasicBlock, LBasicBlock nextBlock) { CRASH(); } 77 void appendTo(LBasicBlock) { CRASH(); } 78 79 LValue param(unsigned index) { CRASH(); } 80 LValue constBool(bool value) { CRASH(); } 81 LValue constInt32(int32_t value) { CRASH(); } 93 LBasicBlock appendTo(LBasicBlock, LBasicBlock nextBlock); 94 void appendTo(LBasicBlock); 95 96 void setOrigin(DFG::Node* node) { m_origin = node; } 97 B3::Origin origin() { return B3::Origin(m_origin); } 98 99 LValue framePointer() { return m_block->appendNew<B3::Value>(m_proc, B3::FramePointer, origin()); } 100 101 LValue lockedStackSlot(size_t bytes); 102 103 LValue constBool(bool value) { return m_block->appendNew<B3::Const32Value>(m_proc, origin(), value); } 104 LValue constInt32(int32_t value) { return m_block->appendNew<B3::Const32Value>(m_proc, origin(), value); } 82 105 template<typename T> 83 LValue constIntPtr(T* value) { CRASH(); }106 LValue constIntPtr(T* value) { return m_block->appendNew<B3::ConstPtrValue>(m_proc, origin(), value); } 84 107 template<typename T> 85 LValue constIntPtr(T value) { CRASH(); }86 LValue constInt64(int64_t value) { CRASH(); }87 LValue constDouble(double value) { CRASH(); }88 89 LValue phi(LType type) { CRASH(); }108 LValue constIntPtr(T value) { return m_block->appendNew<B3::ConstPtrValue>(m_proc, origin(), value); } 109 LValue constInt64(int64_t value) { return m_block->appendNew<B3::Const64Value>(m_proc, origin(), value); } 110 LValue constDouble(double value) { return m_block->appendNew<B3::ConstDoubleValue>(m_proc, origin(), value); } 111 112 LValue phi(LType type) { return m_block->appendNew<B3::Value>(m_proc, B3::Phi, type, origin()); } 90 113 template<typename... Params> 91 LValue phi(LType type, ValueFromBlock value, Params... theRest) { CRASH(); }114 LValue phi(LType, ValueFromBlock, Params... theRest); 92 115 template<typename VectorType> 93 LValue phi(LType type, const VectorType& vector) { CRASH(); } 94 void addIncomingToPhi(LValue phi, ValueFromBlock value) { CRASH(); } 95 96 LValue add(LValue left, LValue right) { CRASH(); } 97 LValue sub(LValue left, LValue right) { CRASH(); } 98 LValue mul(LValue left, LValue right) { CRASH(); } 116 LValue phi(LType, const VectorType&); 117 void addIncomingToPhi(LValue phi, ValueFromBlock); 118 template<typename... Params> 119 void addIncomingToPhi(LValue phi, ValueFromBlock, Params... theRest); 120 121 LValue add(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::Add, origin(), left, right); } 122 LValue sub(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::Sub, origin(), left, right); } 123 LValue mul(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::Mul, origin(), left, right); } 99 124 LValue div(LValue left, LValue right) { CRASH(); } 100 125 LValue rem(LValue left, LValue right) { CRASH(); } 101 LValue neg(LValue value) { CRASH(); } 102 103 LValue doubleAdd(LValue left, LValue right) { CRASH(); } 104 LValue doubleSub(LValue left, LValue right) { CRASH(); } 105 LValue doubleMul(LValue left, LValue right) { CRASH(); } 106 LValue doubleDiv(LValue left, LValue right) { CRASH(); } 126 LValue neg(LValue value) 127 { 128 LValue zero = m_block->appendIntConstant(m_proc, origin(), value->type(), 0); 129 return sub(zero, value); 130 } 131 132 LValue doubleAdd(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::Add, origin(), left, right); } 133 LValue doubleSub(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::Sub, origin(), left, right); } 134 LValue doubleMul(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::Mul, origin(), left, right); } 135 LValue doubleDiv(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::Div, origin(), left, right); } 107 136 LValue doubleRem(LValue left, LValue right) { CRASH(); } 108 LValue doubleNeg(LValue value) { CRASH(); } 109 110 LValue bitAnd(LValue left, LValue right) { CRASH(); } 111 LValue bitOr(LValue left, LValue right) { CRASH(); } 112 LValue bitXor(LValue left, LValue right) { CRASH(); } 113 LValue shl(LValue left, LValue right) { CRASH(); } 114 LValue aShr(LValue left, LValue right) { CRASH(); } 115 LValue lShr(LValue left, LValue right) { CRASH(); } 137 LValue doubleNeg(LValue value) 138 { 139 return sub(doubleZero, value); 140 } 141 142 LValue bitAnd(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::BitAnd, origin(), left, right); } 143 LValue bitOr(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::BitOr, origin(), left, right); } 144 LValue bitXor(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::BitXor, origin(), left, right); } 145 LValue shl(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::Shl, origin(), left, right); } 146 LValue aShr(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::SShr, origin(), left, right); } 147 LValue lShr(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::ZShr, origin(), left, right); } 116 148 LValue bitNot(LValue value) { CRASH(); } 117 149 … … 176 208 LValue set(LValue value, LValue reference) { CRASH(); } 177 209 178 LValue load(TypedPointer, LType refType) { CRASH(); }179 void store(LValue, TypedPointer , LType refType) { CRASH(); }210 LValue load(TypedPointer, LType); 211 void store(LValue, TypedPointer); 180 212 181 213 LValue load8SignExt32(TypedPointer) { CRASH(); } … … 184 216 LValue load16ZeroExt32(TypedPointer) { CRASH(); } 185 217 LValue load32(TypedPointer pointer) { CRASH(); } 186 LValue load64(TypedPointer pointer) { CRASH(); }218 LValue load64(TypedPointer pointer) { return load(pointer, B3::Int64); } 187 219 LValue loadPtr(TypedPointer pointer) { CRASH(); } 188 220 LValue loadFloatToDouble(TypedPointer pointer) { CRASH(); } 189 221 LValue loadDouble(TypedPointer pointer) { CRASH(); } 190 void store16(LValue value, TypedPointer pointer) { CRASH(); } 191 void store32(LValue value, TypedPointer pointer) { CRASH(); } 192 void store64(LValue value, TypedPointer pointer) { CRASH(); } 193 void storePtr(LValue value, TypedPointer pointer) { CRASH(); } 194 void storeDouble(LValue value, TypedPointer pointer) { CRASH(); } 195 196 LValue addPtr(LValue value, ptrdiff_t immediate = 0) { CRASH(); } 222 void store32(LValue value, TypedPointer pointer) { store(value, pointer); } 223 void store64(LValue value, TypedPointer pointer) { store(value, pointer); } 224 void storePtr(LValue value, TypedPointer pointer) { store(value, pointer); } 225 void storeDouble(LValue value, TypedPointer pointer) { store(value, pointer); } 226 227 LValue addPtr(LValue value, ptrdiff_t immediate = 0) 228 { 229 if (!immediate) 230 return value; 231 return add(value, constIntPtr(immediate)); 232 } 197 233 198 234 // Construct an address by offsetting base by the requested amount and ascribing 199 235 // the requested abstract heap to it. 200 TypedPointer address(const AbstractHeap& heap, LValue base, ptrdiff_t offset = 0) { CRASH(); } 236 TypedPointer address(const AbstractHeap& heap, LValue base, ptrdiff_t offset = 0) 237 { 238 return TypedPointer(heap, addPtr(base, offset)); 239 } 201 240 // Construct an address by offsetting base by the amount specified by the field, 202 241 // and optionally an additional amount (use this with care), and then creating 203 242 // a TypedPointer with the given field as the heap. 204 TypedPointer address(LValue base, const AbstractField& field, ptrdiff_t offset = 0) { CRASH(); } 243 TypedPointer address(LValue base, const AbstractField& field, ptrdiff_t offset = 0) 244 { 245 return address(field, base, offset + field.offset()); 246 } 205 247 206 248 LValue baseIndex(LValue base, LValue index, Scale, ptrdiff_t offset = 0) { CRASH(); } … … 236 278 LValue above(LValue left, LValue right) { CRASH(); } 237 279 LValue aboveOrEqual(LValue left, LValue right) { CRASH(); } 238 LValue below(LValue left, LValue right) { CRASH(); }280 LValue below(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::Below, origin(), left, right); } 239 281 LValue belowOrEqual(LValue left, LValue right) { CRASH(); } 240 282 LValue greaterThan(LValue left, LValue right) { CRASH(); } … … 257 299 LValue doubleGreaterThanOrEqualOrUnordered(LValue left, LValue right) { CRASH(); } 258 300 259 LValue isZero32(LValue value) { CRASH(); }260 LValue notZero32(LValue value) { CRASH(); }261 LValue isZero64(LValue value) { CRASH(); }262 LValue notZero64(LValue value) { CRASH(); }263 LValue isNull(LValue value) { CRASH(); }264 LValue notNull(LValue value) { CRASH(); }265 266 LValue testIsZero32(LValue value, LValue mask) { CRASH(); }267 LValue testNonZero32(LValue value, LValue mask) { CRASH(); }268 LValue testIsZero64(LValue value, LValue mask) { CRASH(); }269 LValue testNonZero64(LValue value, LValue mask) { CRASH(); }270 LValue testIsZeroPtr(LValue value, LValue mask) { CRASH(); }271 LValue testNonZeroPtr(LValue value, LValue mask) { CRASH(); }301 LValue isZero32(LValue value) { return m_block->appendNew<B3::Value>(m_proc, B3::Equal, origin(), value, int32Zero); } 302 LValue notZero32(LValue value) { return m_block->appendNew<B3::Value>(m_proc, B3::NotEqual, origin(), value, int32Zero); } 303 LValue isZero64(LValue value) { return m_block->appendNew<B3::Value>(m_proc, B3::Equal, origin(), value, int64Zero); } 304 LValue notZero64(LValue value) { return m_block->appendNew<B3::Value>(m_proc, B3::NotEqual, origin(), value, int64Zero); } 305 LValue isNull(LValue value) { return isZero64(value); } 306 LValue notNull(LValue value) { return notZero64(value); } 307 308 LValue testIsZero32(LValue value, LValue mask) { return isZero32(bitAnd(value, mask)); } 309 LValue testNonZero32(LValue value, LValue mask) { return notZero32(bitAnd(value, mask)); } 310 LValue testIsZero64(LValue value, LValue mask) { return isZero64(bitAnd(value, mask)); } 311 LValue testNonZero64(LValue value, LValue mask) { return notZero64(bitAnd(value, mask)); } 312 LValue testIsZeroPtr(LValue value, LValue mask) { return isNull(bitAnd(value, mask)); } 313 LValue testNonZeroPtr(LValue value, LValue mask) { return notNull(bitAnd(value, mask)); } 272 314 273 315 LValue select(LValue value, LValue taken, LValue notTaken) { CRASH(); } … … 278 320 279 321 template<typename VectorType> 280 LValue call(L Value function, const VectorType& vector) { CRASH(); }281 LValue call(L Value function) { CRASH(); }282 LValue call(L Value function, LValue arg1) { CRASH(); }322 LValue call(LType type, LValue function, const VectorType& vector) { return m_block->appendNew<B3::CCallValue>(m_proc, type, origin(), B3::Value::AdjacencyList(vector)); } 323 LValue call(LType type, LValue function) { return m_block->appendNew<B3::CCallValue>(m_proc, type, origin()); } 324 LValue call(LType type, LValue function, LValue arg1) { return m_block->appendNew<B3::CCallValue>(m_proc, type, origin(), arg1); } 283 325 template<typename... Args> 284 LValue call(L Value function, LValue arg1, Args... args) { CRASH(); }326 LValue call(LType type, LValue function, LValue arg1, Args... args) { return m_block->appendNew<B3::CCallValue>(m_proc, type, origin(), arg1, args...); } 285 327 286 328 template<typename FunctionType> 287 LValue operation(FunctionType function) { CRASH(); } 288 289 void jump(LBasicBlock destination) { CRASH(); } 290 void branch(LValue condition, LBasicBlock taken, Weight takenWeight, LBasicBlock notTaken, Weight notTakenWeight) { CRASH(); } 291 void branch(LValue condition, WeightedTarget taken, WeightedTarget notTaken) { CRASH(); } 329 LValue operation(FunctionType function) { return constIntPtr(bitwise_cast<void*>(function)); } 330 331 void jump(LBasicBlock destination) { m_block->appendNew<B3::ControlValue>(m_proc, B3::Jump, origin(), B3::FrequentedBlock(destination)); } 332 void branch(LValue condition, LBasicBlock taken, Weight takenWeight, LBasicBlock notTaken, Weight notTakenWeight); 333 void branch(LValue condition, WeightedTarget taken, WeightedTarget notTaken) 334 { 335 branch(condition, taken.target(), taken.weight(), notTaken.target(), notTaken.weight()); 336 } 292 337 293 338 // Branches to an already-created handler if true, "falls through" if false. Fall-through is … … 301 346 void switchInstruction(LValue value, const VectorType& cases, LBasicBlock fallThrough, Weight fallThroughWeight) { CRASH(); } 302 347 303 void ret(LValue value) { CRASH(); } 304 305 void unreachable() { CRASH(); } 348 void ret(LValue value) { m_block->appendNew<B3::ControlValue>(m_proc, B3::Return, origin(), value); } 349 350 void unreachable() { m_block->appendNew<B3::ControlValue>(m_proc, B3::Oops, origin()); } 351 352 template<typename Functor> 353 void check(LValue value, const StackmapArgumentList& arguments, const Functor& functor) 354 { 355 B3::CheckValue* check = m_block->appendNew<B3::CheckValue>(m_proc, B3::Check, origin(), value); 356 for (LValue value : arguments) 357 check->append(B3::ConstrainedValue(value)); 358 check->setGenerator(functor); 359 } 306 360 307 361 void trap() { CRASH(); } 308 362 309 ValueFromBlock anchor(LValue value) { CRASH(); } 363 ValueFromBlock anchor(LValue value) 364 { 365 B3::UpsilonValue* upsilon = m_block->appendNew<B3::UpsilonValue>(m_proc, origin(), value); 366 return ValueFromBlock(upsilon, m_block); 367 } 310 368 311 369 #pragma mark - Intrinsics … … 317 375 318 376 #pragma mark - States 319 B3::Procedure& m_procedure; 320 377 B3::Procedure& m_proc; 378 379 DFG::Node* m_origin { nullptr }; 321 380 LBasicBlock m_block { nullptr }; 322 381 LBasicBlock m_nextBlock { nullptr }; 382 383 AbstractHeapRepository* m_heaps; 323 384 }; 385 386 template<typename... Params> 387 inline LValue Output::phi(LType type, ValueFromBlock value, Params... theRest) 388 { 389 LValue phiNode = phi(type); 390 addIncomingToPhi(phiNode, value, theRest...); 391 return phiNode; 392 } 393 394 template<typename VectorType> 395 inline LValue Output::phi(LType type, const VectorType& vector) 396 { 397 LValue phiNode = phi(type); 398 for (const ValueFromBlock& valueFromBlock : vector) 399 addIncomingToPhi(phiNode, valueFromBlock); 400 return phiNode; 401 } 402 403 inline void Output::addIncomingToPhi(LValue phi, ValueFromBlock value) 404 { 405 value.value()->as<B3::UpsilonValue>()->setPhi(phi); 406 } 407 408 template<typename... Params> 409 inline void Output::addIncomingToPhi(LValue phi, ValueFromBlock value, Params... theRest) 410 { 411 addIncomingToPhi(phi, value); 412 addIncomingToPhi(phi, theRest...); 413 } 414 324 415 325 416 #if COMPILER(CLANG) -
trunk/Source/JavaScriptCore/ftl/FTLCommonValues.cpp
r192591 r192605 27 27 #include "FTLCommonValues.h" 28 28 29 #include "B3BasicBlockInlines.h" 30 #include "B3Const32Value.h" 31 #include "B3Const64Value.h" 32 #include "B3ConstDoubleValue.h" 33 #include "B3ConstPtrValue.h" 34 #include "B3ProcedureInlines.h" 29 35 #include "B3Type.h" 36 #include "B3ValueInlines.h" 30 37 #include "FTLAbbreviations.h" 31 38 … … 33 40 34 41 namespace JSC { namespace FTL { 42 43 using namespace B3; 35 44 36 45 CommonValues::CommonValues(LContext context) … … 69 78 , intPtrTwo(constInt(intPtr, 2, SignExtend)) 70 79 , intPtrThree(constInt(intPtr, 3, SignExtend)) 71 , intPtrFour(constInt(intPtr, 4, SignExtend))72 80 , intPtrEight(constInt(intPtr, 8, SignExtend)) 73 , intPtrPtr(constInt(intPtr, sizeof(void*), SignExtend))74 81 , doubleZero(constReal(doubleType, 0)) 75 82 , rangeKind(mdKindID(context, "range")) … … 81 88 , m_module(0) 82 89 { 90 } 91 83 92 #if FTL_USES_B3 84 // Plenty of values are uninitialized. The branch is just there for NORETURN. 85 if (!m_module) 86 CRASH(); 93 void CommonValues::initializeConstants(B3::Procedure& proc, B3::BasicBlock* block) 94 { 95 int32Zero = block->appendNew<Const32Value>(proc, Origin(), 0); 96 int32One = block->appendNew<Const32Value>(proc, Origin(), 1); 97 booleanTrue = int32One; 98 booleanFalse = int32Zero; 99 int64Zero = block->appendNew<Const64Value>(proc, Origin(), 0); 100 intPtrZero = block->appendNew<ConstPtrValue>(proc, Origin(), 0); 101 intPtrOne = block->appendNew<ConstPtrValue>(proc, Origin(), 1); 102 intPtrTwo = block->appendNew<ConstPtrValue>(proc, Origin(), 2); 103 intPtrThree = block->appendNew<ConstPtrValue>(proc, Origin(), 3); 104 intPtrEight = block->appendNew<ConstPtrValue>(proc, Origin(), 8); 105 doubleZero = block->appendNew<ConstDoubleValue>(proc, Origin(), 0.); 106 } 87 107 #endif 88 }89 108 90 109 } } // namespace JSC::FTL -
trunk/Source/JavaScriptCore/ftl/FTLCommonValues.h
r192591 r192605 32 32 #include "FTLValueRange.h" 33 33 34 namespace JSC { namespace FTL { 34 namespace JSC { 35 36 namespace B3 { 37 class BasicBlock; 38 class Procedure; 39 } 40 41 namespace FTL { 35 42 36 43 class CommonValues { 37 44 public: 38 45 CommonValues(LContext context); 39 46 47 #if FTL_USES_B3 48 void initializeConstants(B3::Procedure&, B3::BasicBlock*); 49 #else // FTL_USES_B3 40 50 void initialize(LModule module) 41 51 { 42 52 m_module = module; 43 53 } 54 #endif // FTL_USES_B3 44 55 45 56 const LType voidType; … … 61 72 const LType refDouble; 62 73 #endif 63 constLValue booleanTrue { nullptr };64 constLValue booleanFalse { nullptr };65 const LValue int8Zero { nullptr }; 66 const LValue int32Zero { nullptr };67 const LValue int32One { nullptr }; 68 const LValue int64Zero { nullptr };69 const LValue intPtrZero{ nullptr };70 const LValue intPtrOne{ nullptr };71 const LValue intPtrTwo { nullptr };72 const LValue intPtrThree { nullptr };73 const LValue intPtrFour{ nullptr };74 const LValue intPtrEight{ nullptr };75 const LValue intPtrPtr{ nullptr };76 constLValue doubleZero { nullptr };74 LValue booleanTrue { nullptr }; 75 LValue booleanFalse { nullptr }; 76 #if !FTL_USES_B3 77 LValue int8Zero { nullptr }; 78 #endif 79 LValue int32Zero { nullptr }; 80 LValue int32One { nullptr }; 81 LValue int64Zero { nullptr }; 82 LValue intPtrZero { nullptr }; 83 LValue intPtrOne { nullptr }; 84 LValue intPtrTwo { nullptr }; 85 LValue intPtrThree { nullptr }; 86 LValue intPtrEight { nullptr }; 87 LValue doubleZero { nullptr }; 77 88 78 89 const unsigned rangeKind { 0 }; -
trunk/Source/JavaScriptCore/ftl/FTLJITFinalizer.cpp
r192590 r192605 152 152 153 153 m_plan.codeBlock->setJITCode(jitCode); 154 154 #if !FTL_USES_B3 155 155 m_plan.vm.updateFTLLargestStackSize(jitCode->stackmaps.stackSize()); 156 #endif 156 157 157 158 if (m_plan.compilation) -
trunk/Source/JavaScriptCore/ftl/FTLLink.cpp
r192590 r192605 53 53 codeBlock->clearSwitchJumpTables(); 54 54 55 #if !FTL_USES_B3 55 56 // What LLVM's stackmaps call stackSizeForLocals and what we call frameRegisterCount have a simple 56 57 // relationship, though it's not obvious from reading the code. The easiest way to understand them … … 78 79 // frameRegisterCount == state.jitCode->stackmaps.stackSizeForLocals() / sizeof(Register) 79 80 state.jitCode->common.frameRegisterCount = state.jitCode->stackmaps.stackSizeForLocals() / sizeof(void*); 81 #endif 80 82 81 83 state.jitCode->common.requiredRegisterCountForExit = graph.requiredRegisterCountForExit(); -
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp
r192591 r192605 65 65 namespace JSC { namespace FTL { 66 66 67 using namespace B3; 67 68 using namespace DFG; 68 69 … … 106 107 , m_heaps(state.context) 107 108 , m_out(state) 109 #if FTL_USES_B3 110 , m_proc(*state.proc) 111 #endif 108 112 , m_state(state.graph) 109 113 , m_interpreter(state.graph, m_state) … … 128 132 m_graph.ensureDominators(); 129 133 130 #if FTL_USES_B3 131 if (verboseCompilationEnabled() || !verboseCompilationEnabled()) 132 CRASH(); 133 134 m_prologue = FTL_NEW_BLOCK(m_out, ("Prologue")); 135 LBasicBlock stackOverflow = FTL_NEW_BLOCK(m_out, ("Stack overflow")); 136 LBasicBlock checkArguments = FTL_NEW_BLOCK(m_out, ("Check arguments")); 137 #else 134 #if !FTL_USES_B3 138 135 m_ftlState.module = 139 136 moduleCreateWithNameInContext(name.data(), m_ftlState.context); … … 147 144 addTargetDependentFunctionAttr(m_ftlState.function, "target-features", "-avx"); 148 145 } 146 #endif // !FTL_USES_B3 149 147 150 148 if (verboseCompilationEnabled()) 151 149 dataLog("Function ready, beginning lowering.\n"); 152 150 151 #if FTL_USES_B3 152 m_out.initialize(m_heaps); 153 #else 153 154 m_out.initialize(m_ftlState.module, m_ftlState.function, m_heaps); 155 #endif 154 156 155 157 m_prologue = FTL_NEW_BLOCK(m_out, ("Prologue")); … … 167 169 168 170 m_out.appendTo(m_prologue, stackOverflow); 171 #if FTL_USES_B3 172 m_out.initializeConstants(m_proc, m_prologue); 173 #endif 169 174 createPhiVariables(); 170 175 176 #if FTL_USES_B3 177 m_captured = m_out.lockedStackSlot(sizeof(JSValue) * m_graph.m_nextMachineLocal); 178 m_ftlState.capturedValue = m_captured; 179 #else // FTL_USES_B3 171 180 LValue capturedAlloca = m_out.alloca(arrayType(m_out.int64, m_graph.m_nextMachineLocal)); 172 181 … … 177 186 m_ftlState.capturedStackmapID = m_stackmapIDs++; 178 187 m_out.call( 179 m_out. stackmapIntrinsic(), m_out.constInt64(m_ftlState.capturedStackmapID),188 m_out.voidType, m_out.stackmapIntrinsic(), m_out.constInt64(m_ftlState.capturedStackmapID), 180 189 m_out.int32Zero, capturedAlloca); 181 #endif 190 #endif // FTL_USE_B3 182 191 183 192 auto preOrder = m_graph.blocksInPreOrder(); … … 186 195 bool hasVarargs = false; 187 196 size_t maxNumberOfCatchSpills = 0; 188 for ( BasicBlock* block : preOrder) {197 for (DFG::BasicBlock* block : preOrder) { 189 198 for (Node* node : *block) { 190 199 switch (node->op()) { … … 245 254 246 255 #if FTL_USES_B3 247 if (hasVarargs || !hasVarargs) 248 CRASH(); 256 // FIXME 249 257 #else 250 258 if (hasVarargs) { … … 253 261 m_ftlState.varargsSpillSlotsStackmapID = m_stackmapIDs++; 254 262 m_out.call( 255 m_out.stackmapIntrinsic(), m_out.constInt64(m_ftlState.varargsSpillSlotsStackmapID), 263 m_out.voidType, m_out.stackmapIntrinsic(), 264 m_out.constInt64(m_ftlState.varargsSpillSlotsStackmapID), 256 265 m_out.int32Zero, varargsSpillSlots); 257 266 } … … 265 274 m_ftlState.exceptionHandlingSpillSlotStackmapID = m_stackmapIDs++; 266 275 m_out.call( 267 m_out.stackmapIntrinsic(), m_out.constInt64(m_ftlState.exceptionHandlingSpillSlotStackmapID), 276 m_out.voidType, m_out.stackmapIntrinsic(), 277 m_out.constInt64(m_ftlState.exceptionHandlingSpillSlotStackmapID), 268 278 m_out.int32Zero, exceptionHandlingVolatileRegistersSpillSlots); 269 279 } … … 273 283 // be mem2reg candidates. 274 284 285 #if FTL_USES_B3 286 m_callFrame = m_out.framePointer(); 287 #else 275 288 m_callFrame = m_out.ptrToInt( 276 m_out.call(m_out.frameAddressIntrinsic(), m_out.int32Zero), m_out.intPtr); 289 m_out.call(m_out.intPtr, m_out.frameAddressIntrinsic(), m_out.int32Zero), m_out.intPtr); 290 #endif 277 291 m_tagTypeNumber = m_out.constInt64(TagTypeNumber); 278 292 m_tagMask = m_out.constInt64(TagMask); … … 284 298 285 299 m_out.appendTo(stackOverflow, m_handleExceptions); 286 m_out.call(m_out.operation(operationThrowStackOverflowError), m_callFrame, m_out.constIntPtr(codeBlock())); 300 m_out.call(m_out.voidType, m_out.operation(operationThrowStackOverflowError), m_callFrame, m_out.constIntPtr(codeBlock())); 301 #if FTL_USES_B3 302 // FIXME 303 #else 287 304 m_ftlState.handleStackOverflowExceptionStackmapID = m_stackmapIDs++; 288 305 m_out.call( 289 m_out.stackmapIntrinsic(), m_out.constInt64(m_ftlState.handleStackOverflowExceptionStackmapID), 306 m_out.voidType, m_out.stackmapIntrinsic(), 307 m_out.constInt64(m_ftlState.handleStackOverflowExceptionStackmapID), 290 308 m_out.constInt32(MacroAssembler::maxJumpReplacementSize())); 309 #endif 291 310 m_out.unreachable(); 292 311 293 312 m_out.appendTo(m_handleExceptions, checkArguments); 313 #if FTL_USES_B3 314 // FIXME 315 #else 294 316 m_ftlState.handleExceptionStackmapID = m_stackmapIDs++; 295 317 m_out.call( 296 m_out. stackmapIntrinsic(), m_out.constInt64(m_ftlState.handleExceptionStackmapID),318 m_out.voidType, m_out.stackmapIntrinsic(), m_out.constInt64(m_ftlState.handleExceptionStackmapID), 297 319 m_out.constInt32(MacroAssembler::maxJumpReplacementSize())); 320 #endif 298 321 m_out.unreachable(); 299 322 … … 342 365 m_out.jump(lowBlock(m_graph.block(0))); 343 366 344 for ( BasicBlock* block : preOrder)367 for (DFG::BasicBlock* block : preOrder) 345 368 compileBlock(block); 346 369 … … 360 383 { 361 384 for (BlockIndex blockIndex = m_graph.numBlocks(); blockIndex--;) { 362 BasicBlock* block = m_graph.block(blockIndex);385 DFG::BasicBlock* block = m_graph.block(blockIndex); 363 386 if (!block) 364 387 continue; 365 388 for (unsigned nodeIndex = block->size(); nodeIndex--;) { 366 389 Node* node = block->at(nodeIndex); 367 if (node->op() != Phi)390 if (node->op() != DFG::Phi) 368 391 continue; 369 392 LType type; … … 388 411 break; 389 412 } 413 #if FTL_USES_B3 414 m_phis.add(node, m_proc.add<Value>(B3::Phi, type, Origin(node))); 415 #else 390 416 m_phis.add(node, m_out.alloca(type)); 417 #endif 391 418 } 392 419 } 393 420 } 394 421 395 void compileBlock( BasicBlock* block)422 void compileBlock(DFG::BasicBlock* block) 396 423 { 397 424 if (!block) … … 452 479 // being used but not defined. Race conditions FTW! 453 480 for (BlockIndex blockIndex = m_graph.numBlocks(); blockIndex--;) { 454 BasicBlock* target = m_graph.block(blockIndex);481 DFG::BasicBlock* target = m_graph.block(blockIndex); 455 482 if (!target) 456 483 continue; … … 472 499 m_node = m_highBlock->at(nodeIndex); 473 500 m_origin = m_node->origin; 501 #if FTL_USES_B3 502 m_out.setOrigin(m_node); 503 #endif 474 504 475 505 if (verboseCompilationEnabled()) … … 481 511 482 512 switch (m_node->op()) { 483 case Upsilon:513 case DFG::Upsilon: 484 514 compileUpsilon(); 485 515 break; 486 case Phi:516 case DFG::Phi: 487 517 compilePhi(); 488 518 break; … … 501 531 compileDoubleAsInt32(); 502 532 break; 503 case ValueRep:533 case DFG::ValueRep: 504 534 compileValueRep(); 505 535 break; … … 522 552 compilePutStack(); 523 553 break; 524 case Check:554 case DFG::Check: 525 555 compileNoOp(); 526 556 break; … … 581 611 compileArithNegate(); 582 612 break; 583 case BitAnd:613 case DFG::BitAnd: 584 614 compileBitAnd(); 585 615 break; 586 case BitOr:616 case DFG::BitOr: 587 617 compileBitOr(); 588 618 break; 589 case BitXor:619 case DFG::BitXor: 590 620 compileBitXor(); 591 621 break; … … 841 871 compileForwardVarargs(); 842 872 break; 843 case Jump:873 case DFG::Jump: 844 874 compileJump(); 845 875 break; 846 case Branch:876 case DFG::Branch: 847 877 compileBranch(); 848 878 break; 849 case Switch:879 case DFG::Switch: 850 880 compileSwitch(); 851 881 break; 852 case Return:882 case DFG::Return: 853 883 compileReturn(); 854 884 break; … … 974 1004 void compileUpsilon() 975 1005 { 976 LValue destination = m_phis.get(m_node->phi()); 977 1006 LValue upsilonValue = nullptr; 978 1007 switch (m_node->child1().useKind()) { 979 1008 case DoubleRepUse: 980 m_out.set(lowDouble(m_node->child1()), destination);1009 upsilonValue = lowDouble(m_node->child1()); 981 1010 break; 982 1011 case Int32Use: 983 1012 case KnownInt32Use: 984 m_out.set(lowInt32(m_node->child1()), destination);1013 upsilonValue = lowInt32(m_node->child1()); 985 1014 break; 986 1015 case Int52RepUse: 987 m_out.set(lowInt52(m_node->child1()), destination);1016 upsilonValue = lowInt52(m_node->child1()); 988 1017 break; 989 1018 case BooleanUse: 990 1019 case KnownBooleanUse: 991 m_out.set(lowBoolean(m_node->child1()), destination);1020 upsilonValue = lowBoolean(m_node->child1()); 992 1021 break; 993 1022 case CellUse: 994 1023 case KnownCellUse: 995 m_out.set(lowCell(m_node->child1()), destination);1024 upsilonValue = lowCell(m_node->child1()); 996 1025 break; 997 1026 case UntypedUse: 998 m_out.set(lowJSValue(m_node->child1()), destination);1027 upsilonValue = lowJSValue(m_node->child1()); 999 1028 break; 1000 1029 default: … … 1002 1031 break; 1003 1032 } 1033 #if FTL_USES_B3 1034 ValueFromBlock upsilon = m_out.anchor(upsilonValue); 1035 LValue phiNode = m_phis.get(m_node->phi()); 1036 addIncomingToPhi(phiNode, uspilon); 1037 #else 1038 LValue destination = m_phis.get(m_node->phi()); 1039 m_out.set(upsilonValue, destination); 1040 #endif 1004 1041 } 1005 1042 1006 1043 void compilePhi() 1007 1044 { 1045 #if FTL_USES_B3 1046 LValue phiNode = m_phis.get(m_node->phi()); 1047 m_out.m_block->append(phiNode); 1048 #else 1008 1049 LValue source = m_phis.get(m_node); 1009 1050 … … 1028 1069 break; 1029 1070 } 1071 #endif 1030 1072 } 1031 1073 … … 1404 1446 function = operationToThis; 1405 1447 ValueFromBlock slowResult = m_out.anchor( 1406 vmCall(m_out. operation(function), m_callFrame, value));1448 vmCall(m_out.int64, m_out.operation(function), m_callFrame, value)); 1407 1449 m_out.jump(continuation); 1408 1450 … … 1420 1462 operation = operationValueAdd; 1421 1463 setJSValue(vmCall( 1422 m_out. operation(operation), m_callFrame,1464 m_out.int64, m_out.operation(operation), m_callFrame, 1423 1465 lowJSValue(m_node->child1()), lowJSValue(m_node->child2()))); 1424 1466 } … … 1429 1471 if (m_node->child3()) { 1430 1472 result = vmCall( 1431 m_out. operation(operationStrCat3), m_callFrame,1473 m_out.int64, m_out.operation(operationStrCat3), m_callFrame, 1432 1474 lowJSValue(m_node->child1(), ManualOperandSpeculation), 1433 1475 lowJSValue(m_node->child2(), ManualOperandSpeculation), … … 1435 1477 } else { 1436 1478 result = vmCall( 1437 m_out. operation(operationStrCat2), m_callFrame,1479 m_out.int64, m_out.operation(operationStrCat2), m_callFrame, 1438 1480 lowJSValue(m_node->child1(), ManualOperandSpeculation), 1439 1481 lowJSValue(m_node->child2(), ManualOperandSpeculation)); … … 1578 1620 appendOSRExitArgumentsForPatchpointIfWillCatchException(arguments, ExceptionType::SubGenerator, 3); // left, right, and result show up in the stackmap locations. 1579 1621 1580 LValue call = m_out.call(m_out. patchpointInt64Intrinsic(), arguments);1622 LValue call = m_out.call(m_out.int64, m_out.patchpointInt64Intrinsic(), arguments); 1581 1623 setInstructionCallingConvention(call, LLVMAnyRegCallConv); 1582 1624 … … 2293 2335 switch (m_node->arrayMode().type()) { 2294 2336 case Array::Int32: 2295 vmCall(m_out. operation(operationEnsureInt32), m_callFrame, cell);2337 vmCall(m_out.voidType, m_out.operation(operationEnsureInt32), m_callFrame, cell); 2296 2338 break; 2297 2339 case Array::Double: 2298 vmCall(m_out. operation(operationEnsureDouble), m_callFrame, cell);2340 vmCall(m_out.voidType, m_out.operation(operationEnsureDouble), m_callFrame, cell); 2299 2341 break; 2300 2342 case Array::Contiguous: 2301 vmCall(m_out. operation(operationEnsureContiguous), m_callFrame, cell);2343 vmCall(m_out.voidType, m_out.operation(operationEnsureContiguous), m_callFrame, cell); 2302 2344 break; 2303 2345 case Array::ArrayStorage: 2304 2346 case Array::SlowPutArrayStorage: 2305 vmCall(m_out. operation(operationEnsureArrayStorage), m_callFrame, cell);2347 vmCall(m_out.voidType, m_out.operation(operationEnsureArrayStorage), m_callFrame, cell); 2306 2348 break; 2307 2349 default: … … 2362 2404 m_out.appendTo(notCellCase, continuation); 2363 2405 ValueFromBlock notCellResult = m_out.anchor(vmCall( 2364 m_out. operation(operationGetByIdGeneric),2406 m_out.int64, m_out.operation(operationGetByIdGeneric), 2365 2407 m_callFrame, value, 2366 2408 m_out.constIntPtr(m_graph.identifiers()[m_node->identifierNumber()]))); … … 2408 2450 arguments.insert(0, m_out.constInt64(stackmapID)); 2409 2451 2410 LValue call = m_out.call(m_out. patchpointVoidIntrinsic(), arguments);2452 LValue call = m_out.call(m_out.voidType, m_out.patchpointVoidIntrinsic(), arguments); 2411 2453 setInstructionCallingConvention(call, LLVMAnyRegCallConv); 2412 2454 … … 2450 2492 2451 2493 ValueFromBlock slowResult = m_out.anchor( 2452 vmCall(m_out. operation(operationResolveRope), m_callFrame, cell));2494 vmCall(m_out.intPtr, m_out.operation(operationResolveRope), m_callFrame, cell)); 2453 2495 2454 2496 m_out.jump(continuation); … … 2608 2650 m_out.appendTo(slowCase, continuation); 2609 2651 ValueFromBlock slowResult = m_out.anchor( 2610 vmCall(m_out. operation(operationGetByValArrayInt), m_callFrame, base, index));2652 vmCall(m_out.int64, m_out.operation(operationGetByValArrayInt), m_callFrame, base, index)); 2611 2653 m_out.jump(continuation); 2612 2654 … … 2660 2702 m_out.appendTo(slowCase, continuation); 2661 2703 ValueFromBlock slowResult = m_out.anchor( 2662 vmCall(m_out. operation(operationGetByValArrayInt), m_callFrame, base, index));2704 vmCall(m_out.int64, m_out.operation(operationGetByValArrayInt), m_callFrame, base, index)); 2663 2705 m_out.jump(continuation); 2664 2706 … … 2750 2792 case Array::Generic: { 2751 2793 setJSValue(vmCall( 2752 m_out. operation(operationGetByVal), m_callFrame,2794 m_out.int64, m_out.operation(operationGetByVal), m_callFrame, 2753 2795 lowJSValue(m_node->child1()), lowJSValue(m_node->child2()))); 2754 2796 return; … … 2899 2941 2900 2942 vmCall( 2901 m_out. operation(operation), m_callFrame,2943 m_out.voidType, m_out.operation(operation), m_callFrame, 2902 2944 lowJSValue(child1), lowJSValue(child2), lowJSValue(child3)); 2903 2945 return; … … 3138 3180 auto uid = m_graph.identifiers()[m_node->identifierNumber()]; 3139 3181 vmCall( 3182 m_out.voidType, 3140 3183 m_out.operation(m_node->op() == PutGetterById ? operationPutGetterById : operationPutSetterById), 3141 3184 m_callFrame, base, m_out.constIntPtr(uid), m_out.constInt32(m_node->accessorAttributes()), accessor); … … 3149 3192 auto uid = m_graph.identifiers()[m_node->identifierNumber()]; 3150 3193 vmCall( 3151 m_out. operation(operationPutGetterSetter),3194 m_out.voidType, m_out.operation(operationPutGetterSetter), 3152 3195 m_callFrame, base, m_out.constIntPtr(uid), m_out.constInt32(m_node->accessorAttributes()), getter, setter); 3153 3196 … … 3160 3203 LValue accessor = lowCell(m_node->child3()); 3161 3204 vmCall( 3205 m_out.voidType, 3162 3206 m_out.operation(m_node->op() == PutGetterByVal ? operationPutGetterByVal : operationPutSetterByVal), 3163 3207 m_callFrame, base, subscript, m_out.constInt32(m_node->accessorAttributes()), accessor); … … 3224 3268 operation = m_out.operation(operationArrayPushDouble); 3225 3269 ValueFromBlock slowResult = m_out.anchor( 3226 vmCall( operation, m_callFrame, value, base));3270 vmCall(m_out.int64, operation, m_callFrame, value, base)); 3227 3271 m_out.jump(continuation); 3228 3272 … … 3282 3326 m_out.appendTo(slowCase, continuation); 3283 3327 results.append(m_out.anchor(vmCall( 3284 m_out. operation(operationArrayPopAndRecoverLength), m_callFrame, base)));3328 m_out.int64, m_out.operation(operationArrayPopAndRecoverLength), m_callFrame, base))); 3285 3329 m_out.jump(continuation); 3286 3330 … … 3305 3349 if (table->singletonScope()->isStillValid()) { 3306 3350 LValue callResult = vmCall( 3351 m_out.int64, 3307 3352 m_out.operation(operationCreateActivationDirect), m_callFrame, weakPointer(structure), 3308 3353 scope, weakPointer(table), m_out.constInt64(JSValue::encode(initializationValue))); … … 3362 3407 if (executable->singletonFunction()->isStillValid()) { 3363 3408 LValue callResult = isArrowFunction 3364 ? vmCall(m_out. operation(operationNewArrowFunction), m_callFrame, scope, weakPointer(executable), thisValue)3365 : vmCall(m_out. operation(operationNewFunction), m_callFrame, scope, weakPointer(executable));3409 ? vmCall(m_out.int64, m_out.operation(operationNewArrowFunction), m_callFrame, scope, weakPointer(executable), thisValue) 3410 : vmCall(m_out.int64, m_out.operation(operationNewFunction), m_callFrame, scope, weakPointer(executable)); 3366 3411 setJSValue(callResult); 3367 3412 return; … … 3528 3573 3529 3574 LValue result = vmCall( 3530 m_out. operation(operationCreateScopedArguments), m_callFrame,3575 m_out.int64, m_out.operation(operationCreateScopedArguments), m_callFrame, 3531 3576 weakPointer( 3532 3577 m_graph.globalObjectFor(m_node->origin.semantic)->scopedArgumentsStructure()), … … 3539 3584 { 3540 3585 LValue result = vmCall( 3541 m_out. operation(operationCreateClonedArguments), m_callFrame,3586 m_out.int64, m_out.operation(operationCreateClonedArguments), m_callFrame, 3542 3587 weakPointer( 3543 3588 m_graph.globalObjectFor(m_node->origin.semantic)->outOfBandArgumentsStructure()), … … 3608 3653 if (!m_node->numChildren()) { 3609 3654 setJSValue(vmCall( 3610 m_out. operation(operationNewEmptyArray), m_callFrame,3655 m_out.int64, m_out.operation(operationNewEmptyArray), m_callFrame, 3611 3656 m_out.constIntPtr(structure))); 3612 3657 return; … … 3629 3674 3630 3675 LValue result = vmCall( 3631 m_out. operation(operationNewArray), m_callFrame,3676 m_out.int64, m_out.operation(operationNewArray), m_callFrame, 3632 3677 m_out.constIntPtr(structure), m_out.constIntPtr(buffer), 3633 3678 m_out.constIntPtr(m_node->numChildren())); … … 3670 3715 3671 3716 setJSValue(vmCall( 3672 m_out. operation(operationNewArrayBuffer), m_callFrame,3717 m_out.int64, m_out.operation(operationNewArrayBuffer), m_callFrame, 3673 3718 m_out.constIntPtr(structure), m_out.constIntPtr(m_node->startConstant()), 3674 3719 m_out.constIntPtr(m_node->numConstants()))); … … 3782 3827 globalObject->arrayStructureForIndexingTypeDuringAllocation(ArrayWithArrayStorage)), 3783 3828 m_out.constIntPtr(structure)); 3784 setJSValue(vmCall(m_out. operation(operationNewArrayWithSize), m_callFrame, structureValue, publicLength));3829 setJSValue(vmCall(m_out.int64, m_out.operation(operationNewArrayWithSize), m_callFrame, structureValue, publicLength)); 3785 3830 } 3786 3831 … … 3873 3918 else 3874 3919 operation = m_out.operation(m_node->op() == ToString ? operationToString : operationCallStringConstructor); 3875 ValueFromBlock convertedResult = m_out.anchor(vmCall( operation, m_callFrame, value));3920 ValueFromBlock convertedResult = m_out.anchor(vmCall(m_out.int64, operation, m_callFrame, value)); 3876 3921 m_out.jump(continuation); 3877 3922 … … 3909 3954 m_out.appendTo(isObjectCase, continuation); 3910 3955 results.append(m_out.anchor(vmCall( 3911 m_out. operation(operationToPrimitive), m_callFrame, value)));3956 m_out.int64, m_out.operation(operationToPrimitive), m_callFrame, value))); 3912 3957 m_out.jump(continuation); 3913 3958 … … 4047 4092 Vector<ValueFromBlock, 4> results; 4048 4093 results.append(m_out.anchor(vmCall( 4049 m_out. operation(operationSingleCharacterString),4094 m_out.int64, m_out.operation(operationSingleCharacterString), 4050 4095 m_callFrame, char16Bit.value()))); 4051 4096 m_out.jump(continuation); … … 4089 4134 4090 4135 results.append(m_out.anchor(vmCall( 4091 m_out. operation(operationGetByValStringInt), m_callFrame, base, index)));4136 m_out.int64, m_out.operation(operationGetByValStringInt), m_callFrame, base, index))); 4092 4137 } 4093 4138 … … 4634 4679 arguments.insert(0, m_out.constInt64(stackmapID)); 4635 4680 4636 LValue call = m_out.call(m_out. patchpointInt64Intrinsic(), arguments);4681 LValue call = m_out.call(m_out.int64, m_out.patchpointInt64Intrinsic(), arguments); 4637 4682 setInstructionCallingConvention(call, LLVMWebKitJSCallConv); 4638 4683 … … 4674 4719 exitArguments.insert(0, m_out.constInt64(stackmapID)); 4675 4720 4676 LValue call = 4677 m_out.call(m_out.patchpointVoidIntrinsic(), exitArguments); 4721 LValue call = m_out.call(m_out.voidType, m_out.patchpointVoidIntrinsic(), exitArguments); 4678 4722 setInstructionCallingConvention(call, LLVMAnyRegCallConv); 4679 4723 m_out.unreachable(); … … 4727 4771 arguments.insert(0, m_out.constInt64(stackmapID)); 4728 4772 4729 LValue call = m_out.call(m_out. patchpointInt64Intrinsic(), arguments);4773 LValue call = m_out.call(m_out.int64, m_out.patchpointInt64Intrinsic(), arguments); 4730 4774 setInstructionCallingConvention(call, LLVMCCallConv); 4731 4775 … … 4750 4794 4751 4795 LValue length = vmCall( 4752 m_out. operation(operationSizeOfVarargs), m_callFrame, jsArguments,4796 m_out.int32, m_out.operation(operationSizeOfVarargs), m_callFrame, jsArguments, 4753 4797 m_out.constInt32(data->offset)); 4754 4798 … … 4774 4818 4775 4819 vmCall( 4776 m_out. operation(operationLoadVarargs), m_callFrame,4820 m_out.voidType, m_out.operation(operationLoadVarargs), m_callFrame, 4777 4821 m_out.castToInt32(machineStart), jsArguments, m_out.constInt32(data->offset), 4778 4822 length, m_out.constInt32(data->mandatoryMinimum)); … … 4970 5014 m_out.appendTo(needResolution, resolved); 4971 5015 values.append(m_out.anchor( 4972 vmCall(m_out. operation(operationResolveRope), m_callFrame, stringValue)));5016 vmCall(m_out.intPtr, m_out.operation(operationResolveRope), m_callFrame, stringValue))); 4973 5017 m_out.jump(resolved); 4974 5018 … … 5097 5141 void compileInvalidationPoint() 5098 5142 { 5143 #if FTL_USES_B3 5144 UNREACHABLE_FOR_PLATFORM(); 5145 #else // FTL_USES_B3 5099 5146 if (verboseCompilationEnabled()) 5100 5147 dataLog(" Invalidation point with availability: ", availabilityMap(), "\n"); … … 5113 5160 5114 5161 exitDescriptor.m_isInvalidationPoint = true; 5162 #endif // FTL_USES_B3 5115 5163 } 5116 5164 … … 5305 5353 5306 5354 LValue call = m_out.call( 5307 m_out. patchpointInt64Intrinsic(),5355 m_out.int64, m_out.patchpointInt64Intrinsic(), 5308 5356 m_out.constInt64(stackmapID), m_out.constInt32(sizeOfIn()), 5309 5357 constNull(m_out.ref8), m_out.constInt32(1), cell); … … 5317 5365 } 5318 5366 5319 setJSValue(vmCall(m_out. operation(operationGenericIn), m_callFrame, cell, lowJSValue(m_node->child1())));5367 setJSValue(vmCall(m_out.int64, m_out.operation(operationGenericIn), m_callFrame, cell, lowJSValue(m_node->child1()))); 5320 5368 #endif 5321 5369 } … … 5424 5472 ValueFromBlock slowResult = m_out.anchor(m_out.equal( 5425 5473 m_out.constInt64(JSValue::encode(jsBoolean(true))), 5426 vmCall(m_out. operation(operationHasIndexedProperty), m_callFrame, base, index)));5474 vmCall(m_out.int64, m_out.operation(operationHasIndexedProperty), m_callFrame, base, index))); 5427 5475 m_out.jump(continuation); 5428 5476 … … 5458 5506 ValueFromBlock slowResult = m_out.anchor(m_out.equal( 5459 5507 m_out.constInt64(JSValue::encode(jsBoolean(true))), 5460 vmCall(m_out. operation(operationHasIndexedProperty), m_callFrame, base, index)));5508 vmCall(m_out.int64, m_out.operation(operationHasIndexedProperty), m_callFrame, base, index))); 5461 5509 m_out.jump(continuation); 5462 5510 … … 5476 5524 LValue base = lowJSValue(m_node->child1()); 5477 5525 LValue property = lowCell(m_node->child2()); 5478 setJSValue(vmCall(m_out. operation(operationHasGenericProperty), m_callFrame, base, property));5526 setJSValue(vmCall(m_out.int64, m_out.operation(operationHasGenericProperty), m_callFrame, base, property)); 5479 5527 } 5480 5528 … … 5502 5550 m_out.equal( 5503 5551 m_out.constInt64(JSValue::encode(jsBoolean(true))), 5504 vmCall(m_out. operation(operationHasGenericProperty), m_callFrame, base, property)));5552 vmCall(m_out.int64, m_out.operation(operationHasGenericProperty), m_callFrame, base, property))); 5505 5553 m_out.jump(continuation); 5506 5554 … … 5549 5597 m_out.appendTo(slowCase, continuation); 5550 5598 ValueFromBlock slowCaseResult = m_out.anchor( 5551 vmCall(m_out. operation(operationGetByVal), m_callFrame, base, property));5599 vmCall(m_out.int64, m_out.operation(operationGetByVal), m_callFrame, base, property)); 5552 5600 m_out.jump(continuation); 5553 5601 … … 5565 5613 { 5566 5614 LValue base = lowCell(m_node->child1()); 5567 setJSValue(vmCall(m_out. operation(operationGetPropertyEnumerator), m_callFrame, base));5615 setJSValue(vmCall(m_out.int64, m_out.operation(operationGetPropertyEnumerator), m_callFrame, base)); 5568 5616 } 5569 5617 … … 5623 5671 { 5624 5672 LValue index = lowInt32(m_node->child1()); 5625 setJSValue(vmCall(m_out. operation(operationToIndexString), m_callFrame, index));5673 setJSValue(vmCall(m_out.int64, m_out.operation(operationToIndexString), m_callFrame, index)); 5626 5674 } 5627 5675 … … 5845 5893 5846 5894 for (BlockIndex blockIndex = 0; blockIndex < m_graph.numBlocks(); ++blockIndex) { 5847 BasicBlock* block = m_graph.block(blockIndex);5895 DFG::BasicBlock* block = m_graph.block(blockIndex); 5848 5896 if (!block) 5849 5897 continue; … … 6197 6245 if (previousStructure->couldHaveIndexingHeader()) { 6198 6246 return vmCall( 6247 m_out.intPtr, 6199 6248 m_out.operation( 6200 6249 operationReallocateButterflyToHavePropertyStorageWithInitialCapacity), … … 6217 6266 if (previous->couldHaveIndexingHeader()) { 6218 6267 LValue newAllocSize = m_out.constIntPtr(newSize); 6219 return vmCall(m_out. operation(operationReallocateButterflyToGrowPropertyStorage), m_callFrame, object, newAllocSize);6268 return vmCall(m_out.intPtr, m_out.operation(operationReallocateButterflyToGrowPropertyStorage), m_callFrame, object, newAllocSize); 6220 6269 } 6221 6270 … … 6305 6354 arguments.insert(0, m_out.constInt64(stackmapID)); 6306 6355 6307 LValue call = m_out.call(m_out. patchpointInt64Intrinsic(), arguments);6356 LValue call = m_out.call(m_out.int64, m_out.patchpointInt64Intrinsic(), arguments); 6308 6357 setInstructionCallingConvention(call, LLVMAnyRegCallConv); 6309 6358 … … 6532 6581 m_out.appendTo(slowPath, continuation); 6533 6582 ValueFromBlock slowResult = m_out.anchor(m_out.notNull(vmCall( 6534 m_out. operation(helperFunction), m_callFrame, left, right)));6583 m_out.boolean, m_out.operation(helperFunction), m_callFrame, left, right))); 6535 6584 m_out.jump(continuation); 6536 6585 … … 7033 7082 7034 7083 vmCall( 7035 m_out. operation(slowPathFunction),7084 m_out.voidType, m_out.operation(slowPathFunction), 7036 7085 m_callFrame, base, index, value); 7037 7086 … … 7309 7358 7310 7359 LValue branchOffset = vmCall( 7311 m_out. operation(operationSwitchStringAndGetBranchOffset),7360 m_out.int32, m_out.operation(operationSwitchStringAndGetBranchOffset), 7312 7361 m_callFrame, m_out.constIntPtr(data->switchTableIndex), string); 7313 7362 … … 7534 7583 7535 7584 m_out.appendTo(slowPath, continuation); 7536 results.append(m_out.anchor(m_out.call(m_out. operation(toInt32), doubleValue)));7585 results.append(m_out.anchor(m_out.call(m_out.int32, m_out.operation(toInt32), doubleValue))); 7537 7586 m_out.jump(continuation); 7538 7587 … … 7563 7612 LBasicBlock lastNext = m_out.appendTo(slowPath, continuation); 7564 7613 ValueFromBlock slowResult = m_out.anchor( 7565 m_out.call(m_out. operation(toInt32), doubleValue));7614 m_out.call(m_out.int32, m_out.operation(toInt32), doubleValue)); 7566 7615 m_out.jump(continuation); 7567 7616 … … 7679 7728 appendOSRExitArgumentsForPatchpointIfWillCatchException(arguments, ExceptionType::LazySlowPath, userArguments.size() + 1); // All the arguments plus the result show up in the stackmap locations. 7680 7729 7681 LValue call = m_out.call(m_out. patchpointInt64Intrinsic(), arguments);7730 LValue call = m_out.call(m_out.int64, m_out.patchpointInt64Intrinsic(), arguments); 7682 7731 setInstructionCallingConvention(call, LLVMAnyRegCallConv); 7683 7732 … … 8118 8167 8119 8168 LValue possibleResult = m_out.call( 8120 m_out. operation(operationConvertBoxedDoubleToInt52), boxedValue);8169 m_out.int64, m_out.operation(operationConvertBoxedDoubleToInt52), boxedValue); 8121 8170 FTL_TYPE_CHECK( 8122 8171 jsValueValue(boxedValue), edge, SpecInt32 | SpecInt52AsDouble, … … 8134 8183 { 8135 8184 LValue possibleResult = m_out.call( 8136 m_out. operation(operationConvertDoubleToInt52), value);8185 m_out.int64, m_out.operation(operationConvertDoubleToInt52), value); 8137 8186 FTL_TYPE_CHECK( 8138 8187 doubleValue(value), edge, SpecInt52AsDouble, … … 8861 8910 8862 8911 template<typename... Args> 8863 LValue vmCall(L Value function, Args... args)8912 LValue vmCall(LType type, LValue function, Args... args) 8864 8913 { 8865 8914 callPreflight(); 8866 LValue result = m_out.call( function, args...);8915 LValue result = m_out.call(type, function, args...); 8867 8916 callCheck(); 8868 8917 return result; 8869 8918 } 8870 8919 8871 template<typename... Args>8872 LValue vmCallNoExceptions(LValue function, Args... args)8873 {8874 callPreflight();8875 LValue result = m_out.call(function, args...);8876 return result;8877 }8878 8879 8920 void callPreflight(CodeOrigin codeOrigin) 8880 8921 { … … 8910 8951 { 8911 8952 if (Options::useExceptionFuzz()) 8912 m_out.call(m_out. operation(operationExceptionFuzz), m_callFrame);8953 m_out.call(m_out.voidType, m_out.operation(operationExceptionFuzz), m_callFrame); 8913 8954 8914 8955 LValue exception = m_out.load64(m_out.absolute(vm().addressOfException())); … … 8958 8999 } 8959 9000 8960 LBasicBlock lowBlock( BasicBlock* block)9001 LBasicBlock lowBlock(DFG::BasicBlock* block) 8961 9002 { 8962 9003 return m_blocks.get(block); … … 9009 9050 OSRExitDescriptor& exitDescriptor = m_ftlState.jitCode->osrExitDescriptors.last(); 9010 9051 9052 #if FTL_USES_B3 9053 StackmapArgumentList arguments; 9054 9055 CodeOrigin codeOrigin = exitDescriptor.m_codeOrigin; 9056 9057 buildExitArguments(exitDescriptor, arguments, lowValue, codeOrigin); 9058 9059 m_out.check( 9060 failCondition, arguments, 9061 [&] (CCallHelpers& jit, const B3::StackmapGenerationParams&) { 9062 jit.oops(); 9063 }); 9064 #else // FTL_USES_B3 9011 9065 if (failCondition == m_out.booleanTrue) { 9012 9066 emitOSRExitCall(exitDescriptor, lowValue); … … 9029 9083 9030 9084 m_out.appendTo(continuation, lastNext); 9031 } 9032 9085 #endif // FTL_USES_B3 9086 } 9087 9088 #if !FTL_USES_B3 9033 9089 void emitOSRExitCall(OSRExitDescriptor& exitDescriptor, FormattedValue lowValue) 9034 9090 { … … 9041 9097 callStackmap(exitDescriptor, arguments); 9042 9098 } 9099 #endif 9043 9100 9044 9101 void buildExitArguments( … … 9105 9162 } 9106 9163 } 9107 9164 9165 #if !FTL_USES_B3 9108 9166 void callStackmap(OSRExitDescriptor& exitDescriptor, StackmapArgumentList& arguments) 9109 9167 { … … 9112 9170 arguments.insert(0, m_out.constInt64(exitDescriptor.m_stackmapID)); 9113 9171 9114 m_out.call(m_out.stackmapIntrinsic(), arguments); 9115 } 9172 m_out.call(m_out.voidType, m_out.stackmapIntrinsic(), arguments); 9173 } 9174 #endif // !FTL_USES_B3 9116 9175 9117 9176 ExitValue exitValueForAvailability( … … 9476 9535 uint32_t stackmapID = m_stackmapIDs++; 9477 9536 m_ftlState.probes.append(ProbeDescriptor(stackmapID, probeFunc)); 9478 m_out.call(m_out. stackmapIntrinsic(), m_out.constInt64(stackmapID), m_out.constInt32(sizeOfProbe()));9537 m_out.call(m_out.voidType, m_out.stackmapIntrinsic(), m_out.constInt64(stackmapID), m_out.constInt32(sizeOfProbe())); 9479 9538 } 9480 9539 #endif … … 9487 9546 { 9488 9547 #if ASSERT_DISABLED 9489 m_out.call(m_out. operation(ftlUnreachable));9548 m_out.call(m_out.voidType, m_out.operation(ftlUnreachable)); 9490 9549 UNUSED_PARAM(blockIndex); 9491 9550 UNUSED_PARAM(nodeIndex); … … 9498 9557 #else 9499 9558 m_out.call( 9559 m_out.voidType, 9500 9560 m_out.intToPtr( 9501 9561 m_out.constIntPtr(ftlUnreachable), … … 9519 9579 AbstractHeapRepository m_heaps; 9520 9580 Output m_out; 9581 #if FTL_USES_B3 9582 Procedure& m_proc; 9583 #endif 9521 9584 9522 9585 LBasicBlock m_prologue; 9523 9586 LBasicBlock m_handleExceptions; 9524 HashMap< BasicBlock*, LBasicBlock> m_blocks;9587 HashMap<DFG::BasicBlock*, LBasicBlock> m_blocks; 9525 9588 9526 9589 LValue m_callFrame; … … 9550 9613 InPlaceAbstractState m_state; 9551 9614 AbstractInterpreter<InPlaceAbstractState> m_interpreter; 9552 BasicBlock* m_highBlock;9553 BasicBlock* m_nextHighBlock;9615 DFG::BasicBlock* m_highBlock; 9616 DFG::BasicBlock* m_nextHighBlock; 9554 9617 LBasicBlock m_nextLowBlock; 9555 9618 … … 9569 9632 void lowerDFGToLLVM(State& state) 9570 9633 { 9634 #if FTL_USES_B3 9635 state.proc = std::make_unique<Procedure>(); 9636 #endif 9637 9571 9638 LowerDFGToLLVM lowering(state); 9572 9639 lowering.lower(); -
trunk/Source/JavaScriptCore/ftl/FTLOutput.cpp
r192591 r192605 80 80 RELEASE_ASSERT(isX86()); 81 81 return call( 82 int32, 82 83 x86SSE2CvtTSD2SIIntrinsic(), 83 84 insertElement( -
trunk/Source/JavaScriptCore/ftl/FTLOutput.h
r192591 r192605 146 146 LValue ceil64(LValue operand) 147 147 { 148 return call( ceil64Intrinsic(), operand);148 return call(doubleType, ceil64Intrinsic(), operand); 149 149 } 150 150 LValue ctlz32(LValue xOperand, LValue yOperand) 151 151 { 152 return call( ctlz32Intrinsic(), xOperand, yOperand);152 return call(int32, ctlz32Intrinsic(), xOperand, yOperand); 153 153 } 154 154 LValue addWithOverflow32(LValue left, LValue right) 155 155 { 156 return call( addWithOverflow32Intrinsic(), left, right);156 return call(int32, addWithOverflow32Intrinsic(), left, right); 157 157 } 158 158 LValue subWithOverflow32(LValue left, LValue right) 159 159 { 160 return call( subWithOverflow32Intrinsic(), left, right);160 return call(int32, subWithOverflow32Intrinsic(), left, right); 161 161 } 162 162 LValue mulWithOverflow32(LValue left, LValue right) 163 163 { 164 return call( mulWithOverflow32Intrinsic(), left, right);164 return call(int32, mulWithOverflow32Intrinsic(), left, right); 165 165 } 166 166 LValue addWithOverflow64(LValue left, LValue right) 167 167 { 168 return call( addWithOverflow64Intrinsic(), left, right);168 return call(int64, addWithOverflow64Intrinsic(), left, right); 169 169 } 170 170 LValue subWithOverflow64(LValue left, LValue right) 171 171 { 172 return call( subWithOverflow64Intrinsic(), left, right);172 return call(int64, subWithOverflow64Intrinsic(), left, right); 173 173 } 174 174 LValue mulWithOverflow64(LValue left, LValue right) 175 175 { 176 return call( mulWithOverflow64Intrinsic(), left, right);176 return call(int64, mulWithOverflow64Intrinsic(), left, right); 177 177 } 178 178 LValue doubleAbs(LValue value) 179 179 { 180 return call(double AbsIntrinsic(), value);180 return call(doubleType, doubleAbsIntrinsic(), value); 181 181 } 182 182 183 183 LValue doubleSin(LValue value) 184 184 { 185 return call(double SinIntrinsic(), value);185 return call(doubleType, doubleSinIntrinsic(), value); 186 186 } 187 187 LValue doubleCos(LValue value) 188 188 { 189 return call(double CosIntrinsic(), value);189 return call(doubleType, doubleCosIntrinsic(), value); 190 190 } 191 191 192 192 LValue doublePow(LValue xOperand, LValue yOperand) 193 193 { 194 return call(double PowIntrinsic(), xOperand, yOperand);194 return call(doubleType, doublePowIntrinsic(), xOperand, yOperand); 195 195 } 196 196 197 197 LValue doublePowi(LValue xOperand, LValue yOperand) 198 198 { 199 return call(double PowiIntrinsic(), xOperand, yOperand);199 return call(doubleType, doublePowiIntrinsic(), xOperand, yOperand); 200 200 } 201 201 202 202 LValue doubleSqrt(LValue value) 203 203 { 204 return call(double SqrtIntrinsic(), value);204 return call(doubleType, doubleSqrtIntrinsic(), value); 205 205 } 206 206 207 207 LValue doubleLog(LValue value) 208 208 { 209 return call(double LogIntrinsic(), value);209 return call(doubleType, doubleLogIntrinsic(), value); 210 210 } 211 211 … … 376 376 377 377 template<typename VectorType> 378 LValue call(L Value function, const VectorType& vector) { return buildCall(m_builder, function, vector); }379 LValue call(L Value function) { return buildCall(m_builder, function); }380 LValue call(L Value function, LValue arg1) { return buildCall(m_builder, function, arg1); }378 LValue call(LType, LValue function, const VectorType& vector) { return buildCall(m_builder, function, vector); } 379 LValue call(LType, LValue function) { return buildCall(m_builder, function); } 380 LValue call(LType, LValue function, LValue arg1) { return buildCall(m_builder, function, arg1); } 381 381 template<typename... Args> 382 LValue call(L Value function, LValue arg1, Args... args) { return buildCall(m_builder, function, arg1, args...); }382 LValue call(LType, LValue function, LValue arg1, Args... args) { return buildCall(m_builder, function, arg1, args...); } 383 383 384 384 template<typename FunctionType> … … 432 432 void trap() 433 433 { 434 call( trapIntrinsic());434 call(voidType, trapIntrinsic()); 435 435 } 436 436 -
trunk/Source/JavaScriptCore/ftl/FTLState.cpp
r192591 r192605 47 47 , function(0) 48 48 , generatedFunction(0) 49 , handleStackOverflowExceptionStackmapID(UINT_MAX)50 , handleExceptionStackmapID(UINT_MAX)51 , capturedStackmapID(UINT_MAX)52 , varargsSpillSlotsStackmapID(UINT_MAX)53 , exceptionHandlingSpillSlotStackmapID(UINT_MAX)54 49 , unwindDataSection(0) 55 50 , unwindDataSectionSize(0) -
trunk/Source/JavaScriptCore/ftl/FTLState.h
r192561 r192605 76 76 GeneratedFunction generatedFunction; 77 77 JITFinalizer* finalizer; 78 unsigned handleStackOverflowExceptionStackmapID; 79 unsigned handleExceptionStackmapID; 80 unsigned capturedStackmapID; 81 unsigned varargsSpillSlotsStackmapID; 82 unsigned exceptionHandlingSpillSlotStackmapID; 78 #if FTL_USES_B3 79 LValue handleStackOverflowExceptionValue { nullptr }; 80 LValue handleExceptionValue { nullptr }; 81 LValue capturedValue { nullptr }; 82 LValue varargsSpillSlotsValue { nullptr }; 83 LValue exceptionHandlingSpillSlotValue { nullptr }; 84 #else // FTL_USES_B3 85 unsigned handleStackOverflowExceptionStackmapID { UINT_MAX }; 86 unsigned handleExceptionStackmapID { UINT_MAX }; 87 unsigned capturedStackmapID { UINT_MAX }; 88 unsigned varargsSpillSlotsStackmapID { UINT_MAX }; 89 unsigned exceptionHandlingSpillSlotStackmapID { UINT_MAX }; 90 #endif // FTL_USE_B3 83 91 SegmentedVector<GetByIdDescriptor> getByIds; 84 92 SegmentedVector<PutByIdDescriptor> putByIds; -
trunk/Source/JavaScriptCore/ftl/FTLWeight.h
r183525 r192605 29 29 #if ENABLE(FTL_JIT) 30 30 31 #include "B3FrequencyClass.h" 31 32 #include <wtf/MathExtras.h> 32 33 #include <wtf/StdLibExtras.h> … … 50 51 51 52 float value() const { return m_value; } 53 54 #if FTL_USES_B3 55 B3::FrequencyClass frequencyClass() const { return value() ? B3::FrequencyClass::Normal : B3::FrequencyClass::Rare; } 56 #endif 52 57 53 58 unsigned scaleToTotal(double total) const
Note: See TracChangeset
for help on using the changeset viewer.