Commit a7d83080 authored by Victor Gomes's avatar Victor Gomes Committed by V8 LUCI CQ

[maglev] Support StaLookupSlot

Bug: v8:7700
Change-Id: I3ea3027feb51f10ef0587328835d5a3a1002ed54
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3803029Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82101}
parent 440a0829
......@@ -83,6 +83,16 @@ uint8_t StoreLookupSlotFlags::Encode(LanguageMode language_mode,
LookupHoistingModeBit::encode(static_cast<bool>(lookup_hoisting_mode));
}
// static
LanguageMode StoreLookupSlotFlags::GetLanguageMode(uint8_t flags) {
return LanguageModeBit::decode(flags);
}
// static
bool StoreLookupSlotFlags::IsLookupHoistingMode(uint8_t flags) {
return LookupHoistingModeBit::decode(flags);
}
} // namespace interpreter
} // namespace internal
} // namespace v8
......@@ -88,6 +88,9 @@ class StoreLookupSlotFlags {
static uint8_t Encode(LanguageMode language_mode,
LookupHoistingMode lookup_hoisting_mode);
static LanguageMode GetLanguageMode(uint8_t flags);
static bool IsLookupHoistingMode(uint8_t flags);
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(StoreLookupSlotFlags);
};
......
......@@ -831,7 +831,29 @@ void MaglevGraphBuilder::VisitLdaLookupGlobalSlotInsideTypeof() {
BuildCallRuntime(Runtime::kLoadLookupSlotInsideTypeof, {name}));
}
MAGLEV_UNIMPLEMENTED_BYTECODE(StaLookupSlot)
namespace {
Runtime::FunctionId StaLookupSlotFunction(uint8_t sta_lookup_slot_flags) {
using Flags = interpreter::StoreLookupSlotFlags;
switch (Flags::GetLanguageMode(sta_lookup_slot_flags)) {
case LanguageMode::kStrict:
return Runtime::kStoreLookupSlot_Strict;
case LanguageMode::kSloppy:
if (Flags::IsLookupHoistingMode(sta_lookup_slot_flags)) {
return Runtime::kStoreLookupSlot_SloppyHoisting;
} else {
return Runtime::kStoreLookupSlot_Sloppy;
}
}
}
} // namespace
void MaglevGraphBuilder::VisitStaLookupSlot() {
// StaLookupSlot <name_index> <flags>
ValueNode* value = GetAccumulatorTagged();
ValueNode* name = GetConstant(GetRefOperand<Name>(0));
uint32_t flags = GetFlagOperand(1);
SetAccumulator(BuildCallRuntime(StaLookupSlotFunction(flags), {name, value}));
}
void MaglevGraphBuilder::BuildMapCheck(ValueNode* object,
const compiler::MapRef& map) {
......
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