Commit 8121a2b0 authored by Jakob Kummerow's avatar Jakob Kummerow Committed by V8 LUCI CQ

[wasm][cleanup] Replace SmiConstant with NumberConstant

The existing NumberConstant helper subsumes the recently introduced
SmiConstant (because it produces Smis when it can), so there is no
need for the latter.

Change-Id: Ia49d2c9298c6e75a6465b3b6a68745f4de899671
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3416240
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: 's avatarManos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78798}
parent 70459431
......@@ -230,13 +230,6 @@ class WasmGraphAssembler : public GraphAssembler {
return graph()->NewNode(mcgraph()->common()->NumberConstant(value));
}
Node* SmiConstant(Tagged_t value) {
Address tagged_value = Internals::IntToSmi(static_cast<int>(value));
return kTaggedSize == kInt32Size
? Int32Constant(static_cast<int32_t>(tagged_value))
: Int64Constant(static_cast<int64_t>(tagged_value));
}
// Helper functions for dealing with HeapObjects.
// Rule of thumb: if access to a given field in an object is required in
// at least two places, put a helper function here.
......@@ -5637,13 +5630,13 @@ Node* WasmGraphBuilder::ArrayInitFromData(const wasm::ArrayType* type,
gasm_->Uint32Constant(data_segment), offset, length, rtt);
TrapIfTrue(wasm::kTrapArrayTooLarge,
gasm_->TaggedEqual(
array, gasm_->SmiConstant(
array, gasm_->NumberConstant(
wasm::kArrayInitFromDataArrayTooLargeErrorCode)),
position);
TrapIfTrue(
wasm::kTrapDataSegmentOutOfBounds,
gasm_->TaggedEqual(
array, gasm_->SmiConstant(
array, gasm_->NumberConstant(
wasm::kArrayInitFromDataSegmentOutOfBoundsErrorCode)),
position);
return array;
......
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