Changeset 251978 in webkit
- Timestamp:
- Nov 3, 2019 8:11:43 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r251967 r251978 1 2019-11-03 Tadeu Zagallo <tzagallo@apple.com> 2 3 LLIntGenerator should not allocate temporaries in between variables 4 https://bugs.webkit.org/show_bug.cgi?id=203787 5 6 Reviewed by Yusuke Suzuki. 7 8 * wasm/stress/local-ref.js: Added. 9 1 10 2019-11-02 Alexey Proskuryakov <ap@apple.com> 2 11 -
trunk/Source/JavaScriptCore/ChangeLog
r251967 r251978 1 2019-11-03 Tadeu Zagallo <tzagallo@apple.com> 2 3 LLIntGenerator should not allocate temporaries in between variables 4 https://bugs.webkit.org/show_bug.cgi?id=203787 5 6 Reviewed by Yusuke Suzuki. 7 8 The BytecodeGenerator requires that all variables must be allocated contiguously, before any 9 temporaries are allocated. Currently, we might end up allocating a temporary to materialize 10 the null constant to initialize locals of type Anyref/Funcref. Fix it by keeping track of the 11 locals that need to be initialized and adding a new callback to notify when we have finished 12 parsing locals. Only then we perform the delayed initialization of local refs. 13 14 * wasm/WasmAirIRGenerator.cpp: 15 (JSC::Wasm::AirIRGenerator::didFinishParsingLocals): 16 * wasm/WasmB3IRGenerator.cpp: 17 (JSC::Wasm::B3IRGenerator::didFinishParsingLocals): 18 * wasm/WasmFunctionParser.h: 19 (JSC::Wasm::FunctionParser<Context>::parse): 20 * wasm/WasmLLIntGenerator.cpp: 21 (JSC::Wasm::LLIntGenerator::addLocal): 22 (JSC::Wasm::LLIntGenerator::didFinishParsingLocals): 23 * wasm/WasmValidate.cpp: 24 (JSC::Wasm::Validate::didFinishParsingLocals): 25 1 26 2019-11-02 Alexey Proskuryakov <ap@apple.com> 2 27 -
trunk/Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp
r251886 r251978 299 299 void dump(const Vector<ControlEntry>& controlStack, const Stack* expressionStack); 300 300 void setParser(FunctionParser<AirIRGenerator>* parser) { m_parser = parser; }; 301 void didFinishParsingLocals() { } 301 302 302 303 static Vector<Tmp> toTmpVector(const Vector<TypedTmp>& vector) -
trunk/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp
r251886 r251978 244 244 void dump(const Vector<ControlEntry>& controlStack, const Stack* expressionStack); 245 245 void setParser(FunctionParser<B3IRGenerator>* parser) { m_parser = parser; }; 246 void didFinishParsingLocals() { } 246 247 247 248 Value* constant(B3::Type, uint64_t bits, Optional<Origin> = WTF::nullopt); -
trunk/Source/JavaScriptCore/wasm/WasmFunctionParser.h
r251886 r251978 146 146 WASM_TRY_ADD_TO_CONTEXT(addLocal(typeOfLocal, numberOfLocals)); 147 147 } 148 149 m_context.didFinishParsingLocals(); 148 150 149 151 WASM_FAIL_IF_HELPER_FAILS(parseBody()); -
trunk/Source/JavaScriptCore/wasm/WasmLLIntGenerator.cpp
r251886 r251978 208 208 PartialResult WARN_UNUSED_RETURN addUnreachable(); 209 209 210 void didFinishParsingLocals(); 211 210 212 void setParser(FunctionParser<LLIntGenerator>* parser) { m_parser = parser; }; 211 213 … … 273 275 HashMap<Label*, Vector<SwitchEntry>> m_switches; 274 276 ExpressionType m_jsNullConstant; 277 ExpressionList m_unitializedLocals; 275 278 }; 276 279 … … 485 488 case Type::Anyref: 486 489 case Type::Funcref: 487 WasmMov::emit(this, local, jsNullConstant());490 m_unitializedLocals.append(local); 488 491 break; 489 492 default: … … 492 495 } 493 496 return { }; 497 } 498 499 void LLIntGenerator::didFinishParsingLocals() 500 { 501 auto null = jsNullConstant(); 502 for (auto local : m_unitializedLocals) 503 WasmMov::emit(this, local, null); 504 m_unitializedLocals.clear(); 494 505 } 495 506 -
trunk/Source/JavaScriptCore/wasm/WasmValidate.cpp
r251886 r251978 176 176 void dump(const Vector<ControlEntry>&, const Stack*); 177 177 void setParser(FunctionParser<Validate>*) { } 178 void didFinishParsingLocals() { } 178 179 179 180 private:
Note: See TracChangeset
for help on using the changeset viewer.