Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (260343 => 260344)
--- trunk/Source/_javascript_Core/ChangeLog 2020-04-19 21:18:07 UTC (rev 260343)
+++ trunk/Source/_javascript_Core/ChangeLog 2020-04-19 23:53:38 UTC (rev 260344)
@@ -1,3 +1,29 @@
+2020-04-19 Yusuke Suzuki <[email protected]>
+
+ [JSC] LLInt slow path call should not have third argument
+ https://bugs.webkit.org/show_bug.cgi?id=210721
+
+ Reviewed by Mark Lam.
+
+ LLInt callSlowPath does not work with third argument in Windows, CLoop etc. LLInt slow-path should not take third argument,
+ instead, use `bytecode.metadata(...)` to get metadata.
+
+ * jit/JITCall.cpp:
+ (JSC::JIT::emit_op_iterator_open):
+ (JSC::JIT::emit_op_iterator_next):
+ * llint/LowLevelInterpreter64.asm:
+ * runtime/CommonSlowPaths.cpp:
+ (JSC::iterator_open_try_fast):
+ (JSC::SLOW_PATH_DECL):
+ (JSC::iterator_next_try_fast):
+ (JSC::iterator_open_try_fast_narrow): Deleted.
+ (JSC::iterator_open_try_fast_wide16): Deleted.
+ (JSC::iterator_open_try_fast_wide32): Deleted.
+ (JSC::iterator_next_try_fast_narrow): Deleted.
+ (JSC::iterator_next_try_fast_wide16): Deleted.
+ (JSC::iterator_next_try_fast_wide32): Deleted.
+ * runtime/CommonSlowPaths.h:
+
2020-04-19 Mark Lam <[email protected]>
Fix missing exception checks and handling in JSC APIs.
Modified: trunk/Source/_javascript_Core/jit/JITCall.cpp (260343 => 260344)
--- trunk/Source/_javascript_Core/jit/JITCall.cpp 2020-04-19 21:18:07 UTC (rev 260343)
+++ trunk/Source/_javascript_Core/jit/JITCall.cpp 2020-04-19 23:53:38 UTC (rev 260344)
@@ -385,7 +385,6 @@
void JIT::emit_op_iterator_open(const Instruction* instruction)
{
auto bytecode = instruction->as<OpIteratorOpen>();
- auto& metadata = bytecode.metadata(m_codeBlock);
auto* tryFastFunction = ([&] () {
switch (instruction->width()) {
case Narrow: return iterator_open_try_fast_narrow;
@@ -394,7 +393,7 @@
default: RELEASE_ASSERT_NOT_REACHED();
}
})();
- setupArguments<decltype(tryFastFunction)>(instruction, &metadata);
+ setupArguments<decltype(tryFastFunction)>(instruction);
appendCallWithExceptionCheck(tryFastFunction);
Jump fastCase = branch32(NotEqual, GPRInfo::returnValueGPR2, TrustedImm32(static_cast<uint32_t>(IterationMode::Generic)));
@@ -455,7 +454,7 @@
emitGetVirtualRegister(bytecode.m_next, regT0);
Jump genericCase = branchIfNotEmpty(regT0);
- setupArguments<decltype(tryFastFunction)>(instruction, &metadata);
+ setupArguments<decltype(tryFastFunction)>(instruction);
appendCallWithExceptionCheck(tryFastFunction);
Jump fastCase = branch32(NotEqual, GPRInfo::returnValueGPR2, TrustedImm32(static_cast<uint32_t>(IterationMode::Generic)));
Modified: trunk/Source/_javascript_Core/llint/LowLevelInterpreter64.asm (260343 => 260344)
--- trunk/Source/_javascript_Core/llint/LowLevelInterpreter64.asm 2020-04-19 21:18:07 UTC (rev 260343)
+++ trunk/Source/_javascript_Core/llint/LowLevelInterpreter64.asm 2020-04-19 23:53:38 UTC (rev 260344)
@@ -2659,7 +2659,6 @@
llintOpWithMetadata(op_iterator_open, OpIteratorOpen, macro (size, get, dispatch, metadata, return)
- metadata(a2, t5)
macro fastNarrow()
callSlowPath(_iterator_open_try_fast_narrow)
end
@@ -2717,7 +2716,6 @@
loadVariable(get, m_next, t0)
btqnz t0, t0, .iteratorNextGeneric
- metadata(a2, t5)
macro fastNarrow()
callSlowPath(_iterator_next_try_fast_narrow)
end
Modified: trunk/Source/_javascript_Core/runtime/CommonSlowPaths.cpp (260343 => 260344)
--- trunk/Source/_javascript_Core/runtime/CommonSlowPaths.cpp 2020-04-19 21:18:07 UTC (rev 260343)
+++ trunk/Source/_javascript_Core/runtime/CommonSlowPaths.cpp 2020-04-19 23:53:38 UTC (rev 260344)
@@ -855,13 +855,13 @@
}
template<OpcodeSize width>
-SlowPathReturnType SLOW_PATH iterator_open_try_fast(CallFrame* callFrame, const Instruction* pc, void* metadataPtr)
+SlowPathReturnType SLOW_PATH iterator_open_try_fast(CallFrame* callFrame, const Instruction* pc)
{
// Don't set PC; we can't throw and it's relatively slow.
BEGIN_NO_SET_PC();
auto bytecode = pc->asKnownWidth<OpIteratorOpen, width>();
- auto& metadata = *reinterpret_cast<OpIteratorOpen::Metadata*>(metadataPtr);
+ auto& metadata = bytecode.metadata(codeBlock);
JSValue iterable = GET_C(bytecode.m_iterable).jsValue();
PROFILE_VALUE_IN(iterable, m_iterableProfile);
JSValue symbolIterator = GET_C(bytecode.m_symbolIterator).jsValue();
@@ -900,28 +900,28 @@
return encodeResult(pc, reinterpret_cast<void*>(IterationMode::Generic));
}
-SlowPathReturnType SLOW_PATH iterator_open_try_fast_narrow(CallFrame* callFrame, const Instruction* pc, void* metadataPtr)
+SLOW_PATH_DECL(iterator_open_try_fast_narrow)
{
- return iterator_open_try_fast<Narrow>(callFrame, pc, metadataPtr);
+ return iterator_open_try_fast<Narrow>(callFrame, pc);
}
-SlowPathReturnType SLOW_PATH iterator_open_try_fast_wide16(CallFrame* callFrame, const Instruction* pc, void* metadataPtr)
+SLOW_PATH_DECL(iterator_open_try_fast_wide16)
{
- return iterator_open_try_fast<Wide16>(callFrame, pc, metadataPtr);
+ return iterator_open_try_fast<Wide16>(callFrame, pc);
}
-SlowPathReturnType SLOW_PATH iterator_open_try_fast_wide32(CallFrame* callFrame, const Instruction* pc, void* metadataPtr)
+SLOW_PATH_DECL(iterator_open_try_fast_wide32)
{
- return iterator_open_try_fast<Wide32>(callFrame, pc, metadataPtr);
+ return iterator_open_try_fast<Wide32>(callFrame, pc);
}
template<OpcodeSize width>
-SlowPathReturnType SLOW_PATH iterator_next_try_fast(CallFrame* callFrame, const Instruction* pc, void* metadataPtr)
+SlowPathReturnType SLOW_PATH iterator_next_try_fast(CallFrame* callFrame, const Instruction* pc)
{
BEGIN();
auto bytecode = pc->asKnownWidth<OpIteratorNext, width>();
- auto& metadata = *reinterpret_cast<OpIteratorNext::Metadata*>(metadataPtr);
+ auto& metadata = bytecode.metadata(codeBlock);
ASSERT(!GET(bytecode.m_next).jsValue());
JSObject* iterator = jsCast<JSObject*>(GET(bytecode.m_iterator).jsValue());;
@@ -957,19 +957,19 @@
RELEASE_ASSERT_NOT_REACHED();
}
-SlowPathReturnType SLOW_PATH iterator_next_try_fast_narrow(CallFrame* callFrame, const Instruction* pc, void* metadataPtr)
+SLOW_PATH_DECL(iterator_next_try_fast_narrow)
{
- return iterator_next_try_fast<Narrow>(callFrame, pc, metadataPtr);
+ return iterator_next_try_fast<Narrow>(callFrame, pc);
}
-SlowPathReturnType SLOW_PATH iterator_next_try_fast_wide16(CallFrame* callFrame, const Instruction* pc, void* metadataPtr)
+SLOW_PATH_DECL(iterator_next_try_fast_wide16)
{
- return iterator_next_try_fast<Wide16>(callFrame, pc, metadataPtr);
+ return iterator_next_try_fast<Wide16>(callFrame, pc);
}
-SlowPathReturnType SLOW_PATH iterator_next_try_fast_wide32(CallFrame* callFrame, const Instruction* pc, void* metadataPtr)
+SLOW_PATH_DECL(iterator_next_try_fast_wide32)
{
- return iterator_next_try_fast<Wide32>(callFrame, pc, metadataPtr);
+ return iterator_next_try_fast<Wide32>(callFrame, pc);
}
SLOW_PATH_DECL(slow_path_del_by_val)
Modified: trunk/Source/_javascript_Core/runtime/CommonSlowPaths.h (260343 => 260344)
--- trunk/Source/_javascript_Core/runtime/CommonSlowPaths.h 2020-04-19 21:18:07 UTC (rev 260343)
+++ trunk/Source/_javascript_Core/runtime/CommonSlowPaths.h 2020-04-19 23:53:38 UTC (rev 260344)
@@ -282,19 +282,13 @@
SLOW_PATH_HIDDEN_DECL(slow_path_new_array_with_spread);
SLOW_PATH_HIDDEN_DECL(slow_path_new_array_buffer);
SLOW_PATH_HIDDEN_DECL(slow_path_spread);
+SLOW_PATH_HIDDEN_DECL(iterator_open_try_fast_narrow);
+SLOW_PATH_HIDDEN_DECL(iterator_open_try_fast_wide16);
+SLOW_PATH_HIDDEN_DECL(iterator_open_try_fast_wide32);
+SLOW_PATH_HIDDEN_DECL(iterator_next_try_fast_narrow);
+SLOW_PATH_HIDDEN_DECL(iterator_next_try_fast_wide16);
+SLOW_PATH_HIDDEN_DECL(iterator_next_try_fast_wide32);
-template<OpcodeSize size>
-extern SlowPathReturnType SLOW_PATH iterator_open_try_fast(CallFrame*, const Instruction* pc, void* metadata);
-extern "C" SlowPathReturnType SLOW_PATH iterator_open_try_fast_narrow(CallFrame*, const Instruction* pc, void* metadata = nullptr);
-extern "C" SlowPathReturnType SLOW_PATH iterator_open_try_fast_wide16(CallFrame*, const Instruction* pc, void* metadata = nullptr);
-extern "C" SlowPathReturnType SLOW_PATH iterator_open_try_fast_wide32(CallFrame*, const Instruction* pc, void* metadata = nullptr);
-
-template<OpcodeSize size>
-extern SlowPathReturnType SLOW_PATH iterator_next_try_fast(CallFrame*, const Instruction* pc, void* metadata);
-extern "C" SlowPathReturnType SLOW_PATH iterator_next_try_fast_narrow(CallFrame*, const Instruction* pc, void* metadata = nullptr);
-extern "C" SlowPathReturnType SLOW_PATH iterator_next_try_fast_wide16(CallFrame*, const Instruction* pc, void* metadata = nullptr);
-extern "C" SlowPathReturnType SLOW_PATH iterator_next_try_fast_wide32(CallFrame*, const Instruction* pc, void* metadata = nullptr);
-
using SlowPathFunction = SlowPathReturnType(SLOW_PATH *)(CallFrame*, const Instruction*);
} // namespace JSC