[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: Manos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78798}
This commit is contained in:
Jakob Kummerow 2022-01-26 11:47:02 +01:00 committed by V8 LUCI CQ
parent 7045943147
commit 8121a2b095

View File

@ -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;