Commit 7702496f authored by Manos Koukoutos's avatar Manos Koukoutos Committed by Commit Bot

[wasm][turbofan] Only use LoadImmutable for non-tagged values

Due to immutable loads being placed earlier during scheduling and
subsequently being spilled, the safepoint table of a function may grow
significantly. Until we implement an optimization to avoid spilling in
such cases, we disable immutable loads for tagged values.

Bug: chromium:1191540, v8:11510
Change-Id: Ia5c5d274e6d4b9145cd028828f9a328a65bed17f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2796953
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73743}
parent f8c1c4ef
......@@ -84,10 +84,19 @@ MachineType assert_size(int expected_size, MachineType type) {
assert_size(WASM_INSTANCE_OBJECT_SIZE(name), type), BuildLoadInstance(), \
wasm::ObjectAccess::ToTagged(WasmInstanceObject::k##name##Offset))
// TODO(11510): Using LoadImmutable for tagged values causes registers to be
// spilled and added to the safepoint table, resulting in large code size
// regressions. A possible solution would be to not spill the register at all,
// but rather reload the value from memory. This will require non-trivial
// changes in the register allocator and instuction selector.
#define LOAD_INSTANCE_FIELD(name, type) \
gasm_->LoadImmutable( \
assert_size(WASM_INSTANCE_OBJECT_SIZE(name), type), BuildLoadInstance(), \
wasm::ObjectAccess::ToTagged(WasmInstanceObject::k##name##Offset))
(CanBeTaggedOrCompressedPointer((type).representation()) \
? LOAD_MUTABLE_INSTANCE_FIELD(name, type) \
: gasm_->LoadImmutable( \
assert_size(WASM_INSTANCE_OBJECT_SIZE(name), type), \
BuildLoadInstance(), \
wasm::ObjectAccess::ToTagged( \
WasmInstanceObject::k##name##Offset)))
#define LOAD_ROOT(root_name, factory_name) \
(use_js_isolate_and_params() \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment