Skip to content

Commit

Permalink
[JSC] Enable 16bit CLoop Win
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=198283
rdar://128344991

Reviewed by Ross Kirsling.

This was MSVC workaround. Now we only support clang-cl, so we do not need this workaround.

* Source/JavaScriptCore/generator/Opcode.rb:
* Source/JavaScriptCore/llint/LowLevelInterpreter.asm:
* Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm:

Canonical link: https://commits.webkit.org/278968@main
  • Loading branch information
Constellation committed May 19, 2024
1 parent 8f1711c commit 2c77a22
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 23 deletions.
6 changes: 0 additions & 6 deletions Source/JavaScriptCore/generator/Opcode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,6 @@ def emitter
static bool checkImpl(BytecodeGenerator* gen#{typed_reference_args}#{metadata_param})
{
UNUSED_PARAM(gen);
#if OS(WINDOWS) && ENABLE(C_LOOP)
// FIXME: Disable wide16 optimization for Windows CLoop
// https://bugs.webkit.org/show_bug.cgi?id=198283
if (__size == OpcodeSize::Wide16)
return false;
#endif
return #{map_fields_with_size("", "__size", &:fits_check).join "\n && "}
&& (__size == OpcodeSize::Narrow ? #{Argument.new("opcodeID", opcodeIDType, 0).fits_check(Size::Narrow)} : #{Argument.new("opcodeID", opcodeIDType, 0).fits_check(Size::Wide16)})
&& (__size == OpcodeSize::Wide16 ? #{op_wide16.fits_check(Size::Narrow)} : true)
Expand Down
18 changes: 3 additions & 15 deletions Source/JavaScriptCore/llint/LowLevelInterpreter.asm
Original file line number Diff line number Diff line change
Expand Up @@ -467,19 +467,13 @@ _%label%:
break
end

# FIXME: We cannot enable wide16 bytecode in Windows CLoop. With MSVC, as CLoop::execute gets larger code
# size, CLoop::execute gets higher stack height requirement. This makes CLoop::execute takes 160KB stack
# per call, causes stack overflow error easily. For now, we disable wide16 optimization for Windows CLoop.
# https://bugs.webkit.org/show_bug.cgi?id=198283
if not C_LOOP_WIN
_%label%_wide16:
prologue()
fn(wide16)
if ASSERT_ENABLED
break
break
end
end

_%label%_wide32:
prologue()
Expand Down Expand Up @@ -1083,21 +1077,15 @@ end

macro defineReturnLabel(opcodeName, size)
macro defineNarrow()
if not C_LOOP_WIN
_%opcodeName%_return_location:
end
_%opcodeName%_return_location:
end

macro defineWide16()
if not C_LOOP_WIN
_%opcodeName%_return_location_wide16:
end
_%opcodeName%_return_location_wide16:
end

macro defineWide32()
if not C_LOOP_WIN
_%opcodeName%_return_location_wide32:
end
_%opcodeName%_return_location_wide32:
end

size(defineNarrow, defineWide16, defineWide32, macro (f) f() end)
Expand Down
2 changes: 0 additions & 2 deletions Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,6 @@ macro cCall4(function)
push a0
call function
addp 16, sp
elsif C_LOOP or C_LOOP_WIN
error
else
error
end
Expand Down

0 comments on commit 2c77a22

Please sign in to comment.