Remove strong mode support from property loads.

R=rossberg@chromium.org,bmeurer@chromium.org,verwaest@chromium.org
BUG=v8:3956
LOG=n

Review URL: https://codereview.chromium.org/1700993002

Cr-Commit-Position: refs/heads/master@{#34067}
This commit is contained in:
mstarzinger 2016-02-17 02:30:10 -08:00 committed by Commit bot
parent a7b315b50c
commit 305a36e0d4
69 changed files with 610 additions and 1395 deletions

View File

@ -142,8 +142,7 @@ MUST_USE_RESULT static MaybeHandle<Object> ReplaceAccessorWithDataProperty(
Handle<Object> old_value;
bool is_observed = observe && receiver->map()->is_observed();
if (is_observed) {
MaybeHandle<Object> maybe_old =
Object::GetPropertyWithAccessor(&it, SLOPPY);
MaybeHandle<Object> maybe_old = Object::GetPropertyWithAccessor(&it);
if (!maybe_old.ToHandle(&old_value)) return maybe_old;
}

View File

@ -1625,9 +1625,9 @@ MUST_USE_RESULT Maybe<bool> FastAssign(Handle<JSReceiver> to,
prop_value = JSObject::FastPropertyAt(from, representation, index);
}
} else {
ASSIGN_RETURN_ON_EXCEPTION_VALUE(
isolate, prop_value, Object::GetProperty(from, next_key, STRICT),
Nothing<bool>());
ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, prop_value,
Object::GetProperty(from, next_key),
Nothing<bool>());
}
} else {
// If the map did change, do a slower lookup. We are still guaranteed that
@ -1637,9 +1637,8 @@ MUST_USE_RESULT Maybe<bool> FastAssign(Handle<JSReceiver> to,
DCHECK(it.state() == LookupIterator::DATA ||
it.state() == LookupIterator::ACCESSOR);
if (!it.IsEnumerable()) continue;
ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, prop_value,
Object::GetProperty(&it, STRICT),
Nothing<bool>());
ASSIGN_RETURN_ON_EXCEPTION_VALUE(
isolate, prop_value, Object::GetProperty(&it), Nothing<bool>());
}
Handle<Object> status;
ASSIGN_RETURN_ON_EXCEPTION_VALUE(
@ -1698,7 +1697,7 @@ BUILTIN(ObjectAssign) {
Handle<Object> prop_value;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, prop_value,
Runtime::GetObjectProperty(isolate, from, next_key, STRICT));
Runtime::GetObjectProperty(isolate, from, next_key));
// 4c ii 2. Let status be ? Set(to, nextKey, propValue, true).
Handle<Object> status;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
@ -4075,12 +4074,7 @@ static void Generate_LoadIC_Miss(MacroAssembler* masm) {
static void Generate_LoadIC_Normal(MacroAssembler* masm) {
LoadIC::GenerateNormal(masm, SLOPPY);
}
static void Generate_LoadIC_Normal_Strong(MacroAssembler* masm) {
LoadIC::GenerateNormal(masm, STRONG);
LoadIC::GenerateNormal(masm);
}
@ -4090,22 +4084,12 @@ static void Generate_LoadIC_Getter_ForDeopt(MacroAssembler* masm) {
static void Generate_LoadIC_Slow(MacroAssembler* masm) {
LoadIC::GenerateRuntimeGetProperty(masm, SLOPPY);
}
static void Generate_LoadIC_Slow_Strong(MacroAssembler* masm) {
LoadIC::GenerateRuntimeGetProperty(masm, STRONG);
LoadIC::GenerateRuntimeGetProperty(masm);
}
static void Generate_KeyedLoadIC_Slow(MacroAssembler* masm) {
KeyedLoadIC::GenerateRuntimeGetProperty(masm, SLOPPY);
}
static void Generate_KeyedLoadIC_Slow_Strong(MacroAssembler* masm) {
KeyedLoadIC::GenerateRuntimeGetProperty(masm, STRONG);
KeyedLoadIC::GenerateRuntimeGetProperty(masm);
}
@ -4115,12 +4099,7 @@ static void Generate_KeyedLoadIC_Miss(MacroAssembler* masm) {
static void Generate_KeyedLoadIC_Megamorphic(MacroAssembler* masm) {
KeyedLoadIC::GenerateMegamorphic(masm, SLOPPY);
}
static void Generate_KeyedLoadIC_Megamorphic_Strong(MacroAssembler* masm) {
KeyedLoadIC::GenerateMegamorphic(masm, STRONG);
KeyedLoadIC::GenerateMegamorphic(masm);
}

View File

@ -224,9 +224,6 @@ inline bool operator&(BuiltinExtraArguments lhs, BuiltinExtraArguments rhs) {
V(LoadIC_Getter_ForDeopt, LOAD_IC, MONOMORPHIC, kNoExtraICState) \
V(KeyedLoadIC_Megamorphic, KEYED_LOAD_IC, MEGAMORPHIC, kNoExtraICState) \
\
V(KeyedLoadIC_Megamorphic_Strong, KEYED_LOAD_IC, MEGAMORPHIC, \
LoadICState::kStrongModeState) \
\
V(StoreIC_Setter_ForDeopt, STORE_IC, MONOMORPHIC, \
StoreICState::kStrictModeState) \
\
@ -292,13 +289,10 @@ inline bool operator&(BuiltinExtraArguments lhs, BuiltinExtraArguments rhs) {
// Define list of builtin handlers implemented in assembly.
#define BUILTIN_LIST_H(V) \
V(LoadIC_Slow, LOAD_IC) \
V(LoadIC_Slow_Strong, LOAD_IC) \
V(KeyedLoadIC_Slow, KEYED_LOAD_IC) \
V(KeyedLoadIC_Slow_Strong, KEYED_LOAD_IC) \
V(StoreIC_Slow, STORE_IC) \
V(KeyedStoreIC_Slow, KEYED_STORE_IC) \
V(LoadIC_Normal, LOAD_IC) \
V(LoadIC_Normal_Strong, LOAD_IC) \
V(StoreIC_Normal, STORE_IC)
// Define list of builtins used by the debugger implemented in assembly.

View File

@ -12,44 +12,36 @@ namespace internal {
// static
Callable CodeFactory::LoadIC(Isolate* isolate, TypeofMode typeof_mode,
LanguageMode language_mode) {
return Callable(
LoadIC::initialize_stub(
isolate, LoadICState(typeof_mode, language_mode).GetExtraICState()),
LoadDescriptor(isolate));
Callable CodeFactory::LoadIC(Isolate* isolate, TypeofMode typeof_mode) {
return Callable(LoadIC::initialize_stub(
isolate, LoadICState(typeof_mode).GetExtraICState()),
LoadDescriptor(isolate));
}
// static
Callable CodeFactory::LoadICInOptimizedCode(
Isolate* isolate, TypeofMode typeof_mode, LanguageMode language_mode,
Isolate* isolate, TypeofMode typeof_mode,
InlineCacheState initialization_state) {
auto code = LoadIC::initialize_stub_in_optimized_code(
isolate, LoadICState(typeof_mode, language_mode).GetExtraICState(),
isolate, LoadICState(typeof_mode).GetExtraICState(),
initialization_state);
return Callable(code, LoadWithVectorDescriptor(isolate));
}
// static
Callable CodeFactory::KeyedLoadIC(Isolate* isolate,
LanguageMode language_mode) {
ExtraICState state = is_strong(language_mode) ? LoadICState::kStrongModeState
: kNoExtraICState;
return Callable(KeyedLoadIC::initialize_stub(isolate, state),
Callable CodeFactory::KeyedLoadIC(Isolate* isolate) {
return Callable(KeyedLoadIC::initialize_stub(isolate, kNoExtraICState),
LoadDescriptor(isolate));
}
// static
Callable CodeFactory::KeyedLoadICInOptimizedCode(
Isolate* isolate, LanguageMode language_mode,
InlineCacheState initialization_state) {
ExtraICState state = is_strong(language_mode) ? LoadICState::kStrongModeState
: kNoExtraICState;
Isolate* isolate, InlineCacheState initialization_state) {
auto code = KeyedLoadIC::initialize_stub_in_optimized_code(
isolate, initialization_state, state);
isolate, initialization_state, kNoExtraICState);
if (initialization_state != MEGAMORPHIC) {
return Callable(code, LoadWithVectorDescriptor(isolate));
}

View File

@ -32,16 +32,13 @@ class Callable final BASE_EMBEDDED {
class CodeFactory final {
public:
// Initial states for ICs.
static Callable LoadIC(Isolate* isolate, TypeofMode typeof_mode,
LanguageMode language_mode);
static Callable LoadIC(Isolate* isolate, TypeofMode typeof_mode);
static Callable LoadICInOptimizedCode(Isolate* isolate,
TypeofMode typeof_mode,
LanguageMode language_mode,
InlineCacheState initialization_state);
static Callable KeyedLoadIC(Isolate* isolate, LanguageMode language_mode);
static Callable KeyedLoadIC(Isolate* isolate);
static Callable KeyedLoadICInOptimizedCode(
Isolate* isolate, LanguageMode language_mode,
InlineCacheState initialization_state);
Isolate* isolate, InlineCacheState initialization_state);
static Callable CallIC(Isolate* isolate, int argc,
ConvertReceiverMode mode = ConvertReceiverMode::kAny,
TailCallMode tail_call_mode = TailCallMode::kDisallow);

View File

@ -2157,8 +2157,7 @@ HValue* CodeStubGraphBuilder<LoadDictionaryElementStub>::BuildCodeStub() {
HValue* hash = BuildElementIndexHash(key);
return BuildUncheckedDictionaryElementLoad(receiver, elements, key, hash,
casted_stub()->language_mode());
return BuildUncheckedDictionaryElementLoad(receiver, elements, key, hash);
}
@ -2292,8 +2291,7 @@ HValue* CodeStubGraphBuilder<KeyedLoadGenericStub>::BuildCodeStub() {
HValue* hash = BuildElementIndexHash(key);
Push(BuildUncheckedDictionaryElementLoad(receiver, elements, key, hash,
casted_stub()->language_mode()));
Push(BuildUncheckedDictionaryElementLoad(receiver, elements, key, hash));
}
kind_if.Else();
@ -2337,8 +2335,8 @@ HValue* CodeStubGraphBuilder<KeyedLoadGenericStub>::BuildCodeStub() {
hash = AddUncasted<HShr>(hash, Add<HConstant>(Name::kHashShift));
HValue* value = BuildUncheckedDictionaryElementLoad(
receiver, properties, key, hash, casted_stub()->language_mode());
HValue* value =
BuildUncheckedDictionaryElementLoad(receiver, properties, key, hash);
Push(value);
}
if_dict_properties.Else();
@ -2415,10 +2413,7 @@ HValue* CodeStubGraphBuilder<KeyedLoadGenericStub>::BuildCodeStub() {
// KeyedLookupCache miss; call runtime.
Add<HPushArguments>(receiver, key);
Push(Add<HCallRuntime>(
Runtime::FunctionForId(is_strong(casted_stub()->language_mode())
? Runtime::kKeyedGetPropertyStrong
: Runtime::kKeyedGetProperty),
2));
Runtime::FunctionForId(Runtime::kKeyedGetProperty), 2));
}
inline_or_runtime.End();
}

View File

@ -601,9 +601,7 @@ void LoadDictionaryElementStub::InitializeDescriptor(
void KeyedLoadGenericStub::InitializeDescriptor(
CodeStubDescriptor* descriptor) {
descriptor->Initialize(
Runtime::FunctionForId(is_strong(language_mode())
? Runtime::kKeyedGetPropertyStrong
: Runtime::kKeyedGetProperty)->entry);
Runtime::FunctionForId(Runtime::kKeyedGetProperty)->entry);
}

View File

@ -2074,10 +2074,6 @@ class LoadDictionaryElementStub : public HydrogenCodeStub {
return LoadWithVectorDescriptor(isolate());
}
LanguageMode language_mode() const {
return LoadICState::GetLanguageMode(MinorKey());
}
DEFINE_HYDROGEN_CODE_STUB(LoadDictionaryElement, HydrogenCodeStub);
};
@ -2092,10 +2088,6 @@ class KeyedLoadGenericStub : public HydrogenCodeStub {
Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; }
InlineCacheState GetICState() const override { return GENERIC; }
LanguageMode language_mode() const {
return LoadICState::GetLanguageMode(MinorKey());
}
DEFINE_CALL_INTERFACE_DESCRIPTOR(Load);
DEFINE_HYDROGEN_CODE_STUB(KeyedLoadGeneric, HydrogenCodeStub);

View File

@ -3570,7 +3570,7 @@ Node* AstGraphBuilder::BuildVariableAssignment(
Node* AstGraphBuilder::BuildKeyedLoad(Node* object, Node* key,
const VectorSlotPair& feedback) {
const Operator* op = javascript()->LoadProperty(language_mode(), feedback);
const Operator* op = javascript()->LoadProperty(feedback);
Node* node = NewNode(op, object, key, GetFunctionClosure());
return node;
}
@ -3578,7 +3578,7 @@ Node* AstGraphBuilder::BuildKeyedLoad(Node* object, Node* key,
Node* AstGraphBuilder::BuildNamedLoad(Node* object, Handle<Name> name,
const VectorSlotPair& feedback) {
const Operator* op = javascript()->LoadNamed(language_mode(), name, feedback);
const Operator* op = javascript()->LoadNamed(name, feedback);
Node* node = NewNode(op, object, GetFunctionClosure());
return node;
}
@ -3606,9 +3606,8 @@ Node* AstGraphBuilder::BuildNamedSuperLoad(Node* receiver, Node* home_object,
Handle<Name> name,
const VectorSlotPair& feedback) {
Node* name_node = jsgraph()->Constant(name);
Node* language = jsgraph()->Constant(language_mode());
const Operator* op = javascript()->CallRuntime(Runtime::kLoadFromSuper);
Node* node = NewNode(op, receiver, home_object, name_node, language);
Node* node = NewNode(op, receiver, home_object, name_node);
return node;
}
@ -3616,9 +3615,8 @@ Node* AstGraphBuilder::BuildNamedSuperLoad(Node* receiver, Node* home_object,
Node* AstGraphBuilder::BuildKeyedSuperLoad(Node* receiver, Node* home_object,
Node* key,
const VectorSlotPair& feedback) {
Node* language = jsgraph()->Constant(language_mode());
const Operator* op = javascript()->CallRuntime(Runtime::kLoadKeyedFromSuper);
Node* node = NewNode(op, receiver, home_object, key, language);
Node* node = NewNode(op, receiver, home_object, key);
return node;
}

View File

@ -645,35 +645,19 @@ void BytecodeGraphBuilder::BuildLoadGlobal(
environment()->BindAccumulator(node, &states);
}
void BytecodeGraphBuilder::VisitLdaGlobalSloppy() {
void BytecodeGraphBuilder::VisitLdaGlobal() {
BuildLoadGlobal(TypeofMode::NOT_INSIDE_TYPEOF);
}
void BytecodeGraphBuilder::VisitLdaGlobalStrict() {
BuildLoadGlobal(TypeofMode::NOT_INSIDE_TYPEOF);
}
void BytecodeGraphBuilder::VisitLdaGlobalInsideTypeofSloppy() {
void BytecodeGraphBuilder::VisitLdaGlobalInsideTypeof() {
BuildLoadGlobal(TypeofMode::INSIDE_TYPEOF);
}
void BytecodeGraphBuilder::VisitLdaGlobalInsideTypeofStrict() {
BuildLoadGlobal(TypeofMode::INSIDE_TYPEOF);
}
void BytecodeGraphBuilder::VisitLdaGlobalSloppyWide() {
void BytecodeGraphBuilder::VisitLdaGlobalWide() {
BuildLoadGlobal(TypeofMode::NOT_INSIDE_TYPEOF);
}
void BytecodeGraphBuilder::VisitLdaGlobalStrictWide() {
BuildLoadGlobal(TypeofMode::NOT_INSIDE_TYPEOF);
}
void BytecodeGraphBuilder::VisitLdaGlobalInsideTypeofSloppyWide() {
BuildLoadGlobal(TypeofMode::INSIDE_TYPEOF);
}
void BytecodeGraphBuilder::VisitLdaGlobalInsideTypeofStrictWide() {
void BytecodeGraphBuilder::VisitLdaGlobalInsideTypeofWide() {
BuildLoadGlobal(TypeofMode::INSIDE_TYPEOF);
}
@ -800,30 +784,14 @@ void BytecodeGraphBuilder::BuildNamedLoad() {
VectorSlotPair feedback =
CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(2));
const Operator* op = javascript()->LoadNamed(language_mode(), name, feedback);
const Operator* op = javascript()->LoadNamed(name, feedback);
Node* node = NewNode(op, object, GetFunctionClosure());
environment()->BindAccumulator(node, &states);
}
void BytecodeGraphBuilder::VisitLoadICSloppy() {
DCHECK(is_sloppy(language_mode()));
BuildNamedLoad();
}
void BytecodeGraphBuilder::VisitLoadIC() { BuildNamedLoad(); }
void BytecodeGraphBuilder::VisitLoadICStrict() {
DCHECK(is_strict(language_mode()));
BuildNamedLoad();
}
void BytecodeGraphBuilder::VisitLoadICSloppyWide() {
DCHECK(is_sloppy(language_mode()));
BuildNamedLoad();
}
void BytecodeGraphBuilder::VisitLoadICStrictWide() {
DCHECK(is_strict(language_mode()));
BuildNamedLoad();
}
void BytecodeGraphBuilder::VisitLoadICWide() { BuildNamedLoad(); }
void BytecodeGraphBuilder::BuildKeyedLoad() {
FrameStateBeforeAndAfter states(this);
@ -833,30 +801,14 @@ void BytecodeGraphBuilder::BuildKeyedLoad() {
VectorSlotPair feedback =
CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(1));
const Operator* op = javascript()->LoadProperty(language_mode(), feedback);
const Operator* op = javascript()->LoadProperty(feedback);
Node* node = NewNode(op, object, key, GetFunctionClosure());
environment()->BindAccumulator(node, &states);
}
void BytecodeGraphBuilder::VisitKeyedLoadICSloppy() {
DCHECK(is_sloppy(language_mode()));
BuildKeyedLoad();
}
void BytecodeGraphBuilder::VisitKeyedLoadIC() { BuildKeyedLoad(); }
void BytecodeGraphBuilder::VisitKeyedLoadICStrict() {
DCHECK(is_strict(language_mode()));
BuildKeyedLoad();
}
void BytecodeGraphBuilder::VisitKeyedLoadICSloppyWide() {
DCHECK(is_sloppy(language_mode()));
BuildKeyedLoad();
}
void BytecodeGraphBuilder::VisitKeyedLoadICStrictWide() {
DCHECK(is_strict(language_mode()));
BuildKeyedLoad();
}
void BytecodeGraphBuilder::VisitKeyedLoadICWide() { BuildKeyedLoad(); }
void BytecodeGraphBuilder::BuildNamedStore(LanguageMode language_mode) {
FrameStateBeforeAndAfter states(this);

View File

@ -270,8 +270,8 @@ void JSGenericLowering::LowerJSLoadProperty(Node* node) {
Node* control = NodeProperties::GetControlInput(node);
CallDescriptor::Flags flags = AdjustFrameStatesForCall(node);
const PropertyAccess& p = PropertyAccessOf(node->op());
Callable callable = CodeFactory::KeyedLoadICInOptimizedCode(
isolate(), p.language_mode(), UNINITIALIZED);
Callable callable =
CodeFactory::KeyedLoadICInOptimizedCode(isolate(), UNINITIALIZED);
// Load the type feedback vector from the closure.
Node* shared_info = effect = graph()->NewNode(
machine()->Load(MachineType::AnyTagged()), closure,
@ -297,7 +297,7 @@ void JSGenericLowering::LowerJSLoadNamed(Node* node) {
CallDescriptor::Flags flags = AdjustFrameStatesForCall(node);
NamedAccess const& p = NamedAccessOf(node->op());
Callable callable = CodeFactory::LoadICInOptimizedCode(
isolate(), NOT_INSIDE_TYPEOF, p.language_mode(), UNINITIALIZED);
isolate(), NOT_INSIDE_TYPEOF, UNINITIALIZED);
// Load the type feedback vector from the closure.
Node* shared_info = effect = graph()->NewNode(
machine()->Load(MachineType::AnyTagged()), closure,
@ -325,7 +325,7 @@ void JSGenericLowering::LowerJSLoadGlobal(Node* node) {
CallDescriptor::Flags flags = AdjustFrameStatesForCall(node);
const LoadGlobalParameters& p = LoadGlobalParametersOf(node->op());
Callable callable = CodeFactory::LoadICInOptimizedCode(
isolate(), p.typeof_mode(), SLOPPY, UNINITIALIZED);
isolate(), p.typeof_mode(), UNINITIALIZED);
// Load the type feedback vector from the closure.
Node* shared_info = effect = graph()->NewNode(
machine()->Load(MachineType::AnyTagged()), closure,

View File

@ -603,11 +603,9 @@ const Operator* JSOperatorBuilder::ConvertReceiver(
convert_mode); // parameter
}
const Operator* JSOperatorBuilder::LoadNamed(LanguageMode language_mode,
Handle<Name> name,
const Operator* JSOperatorBuilder::LoadNamed(Handle<Name> name,
const VectorSlotPair& feedback) {
NamedAccess access(language_mode, name, feedback);
NamedAccess access(SLOPPY, name, feedback);
return new (zone()) Operator1<NamedAccess>( // --
IrOpcode::kJSLoadNamed, Operator::kNoProperties, // opcode
"JSLoadNamed", // name
@ -615,10 +613,9 @@ const Operator* JSOperatorBuilder::LoadNamed(LanguageMode language_mode,
access); // parameter
}
const Operator* JSOperatorBuilder::LoadProperty(
LanguageMode language_mode, VectorSlotPair const& feedback) {
PropertyAccess access(language_mode, feedback);
VectorSlotPair const& feedback) {
PropertyAccess access(SLOPPY, feedback);
return new (zone()) Operator1<PropertyAccess>( // --
IrOpcode::kJSLoadProperty, Operator::kNoProperties, // opcode
"JSLoadProperty", // name

View File

@ -438,10 +438,8 @@ class JSOperatorBuilder final : public ZoneObject {
const Operator* ConvertReceiver(ConvertReceiverMode convert_mode);
const Operator* LoadProperty(LanguageMode language_mode,
VectorSlotPair const& feedback);
const Operator* LoadNamed(LanguageMode language_mode, Handle<Name> name,
VectorSlotPair const& feedback);
const Operator* LoadProperty(VectorSlotPair const& feedback);
const Operator* LoadNamed(Handle<Name> name, VectorSlotPair const& feedback);
const Operator* StoreProperty(LanguageMode language_mode,
VectorSlotPair const& feedback);

View File

@ -2671,9 +2671,9 @@ void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
__ mov(LoadDescriptor::NameRegister(), Operand(instr->name()));
EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
Handle<Code> ic =
CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(),
SLOPPY, PREMONOMORPHIC).code();
Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(
isolate(), instr->typeof_mode(), PREMONOMORPHIC)
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
@ -2768,10 +2768,10 @@ void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
// Name is always in r2.
__ mov(LoadDescriptor::NameRegister(), Operand(instr->name()));
EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr);
Handle<Code> ic =
CodeFactory::LoadICInOptimizedCode(
isolate(), NOT_INSIDE_TYPEOF, instr->hydrogen()->language_mode(),
instr->hydrogen()->initialization_state()).code();
Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(
isolate(), NOT_INSIDE_TYPEOF,
instr->hydrogen()->initialization_state())
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS);
}
@ -3070,8 +3070,8 @@ void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
}
Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode(
isolate(), instr->hydrogen()->language_mode(),
instr->hydrogen()->initialization_state()).code();
isolate(), instr->hydrogen()->initialization_state())
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS);
}

View File

@ -3046,9 +3046,9 @@ void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
DCHECK(ToRegister(instr->result()).Is(x0));
__ Mov(LoadDescriptor::NameRegister(), Operand(instr->name()));
EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
Handle<Code> ic =
CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(),
SLOPPY, PREMONOMORPHIC).code();
Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(
isolate(), instr->typeof_mode(), PREMONOMORPHIC)
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
@ -3311,8 +3311,8 @@ void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
}
Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode(
isolate(), instr->hydrogen()->language_mode(),
instr->hydrogen()->initialization_state()).code();
isolate(), instr->hydrogen()->initialization_state())
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
DCHECK(ToRegister(instr->result()).Is(x0));
@ -3366,10 +3366,10 @@ void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister()));
__ Mov(LoadDescriptor::NameRegister(), Operand(instr->name()));
EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr);
Handle<Code> ic =
CodeFactory::LoadICInOptimizedCode(
isolate(), NOT_INSIDE_TYPEOF, instr->hydrogen()->language_mode(),
instr->hydrogen()->initialization_state()).code();
Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(
isolate(), NOT_INSIDE_TYPEOF,
instr->hydrogen()->initialization_state())
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
DCHECK(ToRegister(instr->result()).is(x0));

View File

@ -6323,9 +6323,8 @@ class HLoadNamedField final : public HTemplateInstruction<2> {
class HLoadNamedGeneric final : public HTemplateInstruction<2> {
public:
DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HLoadNamedGeneric, HValue*,
Handle<Name>, LanguageMode,
InlineCacheState);
DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HLoadNamedGeneric, HValue*,
Handle<Name>, InlineCacheState);
HValue* context() const { return OperandAt(0); }
HValue* object() const { return OperandAt(1); }
@ -6353,14 +6352,10 @@ class HLoadNamedGeneric final : public HTemplateInstruction<2> {
DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric)
LanguageMode language_mode() const { return language_mode_; }
private:
HLoadNamedGeneric(HValue* context, HValue* object, Handle<Name> name,
LanguageMode language_mode,
InlineCacheState initialization_state)
: name_(name),
language_mode_(language_mode),
initialization_state_(initialization_state) {
SetOperandAt(0, context);
SetOperandAt(1, object);
@ -6371,7 +6366,6 @@ class HLoadNamedGeneric final : public HTemplateInstruction<2> {
Handle<Name> name_;
Handle<TypeFeedbackVector> feedback_vector_;
FeedbackVectorSlot slot_;
LanguageMode language_mode_;
InlineCacheState initialization_state_;
};
@ -6614,9 +6608,8 @@ class HLoadKeyed final : public HTemplateInstruction<4>,
class HLoadKeyedGeneric final : public HTemplateInstruction<3> {
public:
DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HLoadKeyedGeneric, HValue*,
HValue*, LanguageMode,
InlineCacheState);
DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HLoadKeyedGeneric, HValue*,
HValue*, InlineCacheState);
HValue* object() const { return OperandAt(0); }
HValue* key() const { return OperandAt(1); }
HValue* context() const { return OperandAt(2); }
@ -6648,14 +6641,10 @@ class HLoadKeyedGeneric final : public HTemplateInstruction<3> {
DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric)
LanguageMode language_mode() const { return language_mode_; }
private:
HLoadKeyedGeneric(HValue* context, HValue* obj, HValue* key,
LanguageMode language_mode,
InlineCacheState initialization_state)
: initialization_state_(initialization_state),
language_mode_(language_mode) {
: initialization_state_(initialization_state) {
set_representation(Representation::Tagged());
SetOperandAt(0, obj);
SetOperandAt(1, key);
@ -6666,7 +6655,6 @@ class HLoadKeyedGeneric final : public HTemplateInstruction<3> {
Handle<TypeFeedbackVector> feedback_vector_;
FeedbackVectorSlot slot_;
InlineCacheState initialization_state_;
LanguageMode language_mode_;
};

View File

@ -1675,10 +1675,10 @@ HValue* HGraphBuilder::BuildElementIndexHash(HValue* index) {
return AddUncasted<HBitwise>(Token::BIT_XOR, hash, shifted_hash);
}
HValue* HGraphBuilder::BuildUncheckedDictionaryElementLoad(
HValue* receiver, HValue* elements, HValue* key, HValue* hash,
LanguageMode language_mode) {
HValue* HGraphBuilder::BuildUncheckedDictionaryElementLoad(HValue* receiver,
HValue* elements,
HValue* key,
HValue* hash) {
HValue* capacity =
Add<HLoadKeyed>(elements, Add<HConstant>(NameDictionary::kCapacityIndex),
nullptr, nullptr, FAST_ELEMENTS);
@ -1721,11 +1721,8 @@ HValue* HGraphBuilder::BuildUncheckedDictionaryElementLoad(
// element == undefined means "not found". Call the runtime.
// TODO(jkummerow): walk the prototype chain instead.
Add<HPushArguments>(receiver, key);
Push(Add<HCallRuntime>(
Runtime::FunctionForId(is_strong(language_mode)
? Runtime::kKeyedGetPropertyStrong
: Runtime::kKeyedGetProperty),
2));
Push(Add<HCallRuntime>(Runtime::FunctionForId(Runtime::kKeyedGetProperty),
2));
}
if_undefined.Else();
{
@ -1784,11 +1781,8 @@ HValue* HGraphBuilder::BuildUncheckedDictionaryElementLoad(
FAST_ELEMENTS));
details_compare.Else();
Add<HPushArguments>(receiver, key);
Push(Add<HCallRuntime>(
Runtime::FunctionForId(is_strong(language_mode)
? Runtime::kKeyedGetPropertyStrong
: Runtime::kKeyedGetProperty),
2));
Push(Add<HCallRuntime>(Runtime::FunctionForId(Runtime::kKeyedGetProperty),
2));
details_compare.End();
found_key_match.Else();
@ -7335,14 +7329,14 @@ HInstruction* HOptimizedGraphBuilder::BuildNamedGeneric(
// use a generic Keyed Load if we are using the type vector, because
// it has to share information with full code.
HConstant* key = Add<HConstant>(name);
HLoadKeyedGeneric* result = New<HLoadKeyedGeneric>(
object, key, function_language_mode(), PREMONOMORPHIC);
HLoadKeyedGeneric* result =
New<HLoadKeyedGeneric>(object, key, PREMONOMORPHIC);
result->SetVectorAndSlot(vector, slot);
return result;
}
HLoadNamedGeneric* result = New<HLoadNamedGeneric>(
object, name, function_language_mode(), PREMONOMORPHIC);
HLoadNamedGeneric* result =
New<HLoadNamedGeneric>(object, name, PREMONOMORPHIC);
result->SetVectorAndSlot(vector, slot);
return result;
} else {
@ -7376,8 +7370,8 @@ HInstruction* HOptimizedGraphBuilder::BuildKeyedGeneric(
HValue* object, HValue* key, HValue* value) {
if (access_type == LOAD) {
InlineCacheState initial_state = expr->AsProperty()->GetInlineCacheState();
HLoadKeyedGeneric* result = New<HLoadKeyedGeneric>(
object, key, function_language_mode(), initial_state);
HLoadKeyedGeneric* result =
New<HLoadKeyedGeneric>(object, key, initial_state);
// HLoadKeyedGeneric with vector ics benefits from being encoded as
// MEGAMORPHIC because the vector/slot combo becomes unnecessary.
if (initial_state != MEGAMORPHIC) {

View File

@ -1348,8 +1348,7 @@ class HGraphBuilder {
HValue* BuildUncheckedDictionaryElementLoad(HValue* receiver,
HValue* elements, HValue* key,
HValue* hash,
LanguageMode language_mode);
HValue* hash);
// ES6 section 7.4.7 CreateIterResultObject ( value, done )
HValue* BuildCreateIterResultObject(HValue* value, HValue* done);

View File

@ -2600,9 +2600,9 @@ void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
__ mov(LoadDescriptor::NameRegister(), instr->name());
EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
Handle<Code> ic =
CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(),
SLOPPY, PREMONOMORPHIC).code();
Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(
isolate(), instr->typeof_mode(), PREMONOMORPHIC)
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
@ -2717,10 +2717,10 @@ void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
__ mov(LoadDescriptor::NameRegister(), instr->name());
EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr);
Handle<Code> ic =
CodeFactory::LoadICInOptimizedCode(
isolate(), NOT_INSIDE_TYPEOF, instr->hydrogen()->language_mode(),
instr->hydrogen()->initialization_state()).code();
Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(
isolate(), NOT_INSIDE_TYPEOF,
instr->hydrogen()->initialization_state())
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
@ -2956,8 +2956,8 @@ void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
}
Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode(
isolate(), instr->hydrogen()->language_mode(),
instr->hydrogen()->initialization_state()).code();
isolate(), instr->hydrogen()->initialization_state())
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}

View File

@ -2587,9 +2587,9 @@ void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
__ li(LoadDescriptor::NameRegister(), Operand(instr->name()));
EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
Handle<Code> ic =
CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(),
SLOPPY, PREMONOMORPHIC).code();
Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(
isolate(), instr->typeof_mode(), PREMONOMORPHIC)
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
@ -2688,10 +2688,10 @@ void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
// Name is always in a2.
__ li(LoadDescriptor::NameRegister(), Operand(instr->name()));
EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr);
Handle<Code> ic =
CodeFactory::LoadICInOptimizedCode(
isolate(), NOT_INSIDE_TYPEOF, instr->hydrogen()->language_mode(),
instr->hydrogen()->initialization_state()).code();
Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(
isolate(), NOT_INSIDE_TYPEOF,
instr->hydrogen()->initialization_state())
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
@ -3001,8 +3001,8 @@ void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
}
Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode(
isolate(), instr->hydrogen()->language_mode(),
instr->hydrogen()->initialization_state()).code();
isolate(), instr->hydrogen()->initialization_state())
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}

View File

@ -2708,9 +2708,9 @@ void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
__ li(LoadDescriptor::NameRegister(), Operand(instr->name()));
EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
Handle<Code> ic =
CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(),
SLOPPY, PREMONOMORPHIC).code();
Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(
isolate(), instr->typeof_mode(), PREMONOMORPHIC)
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
@ -2824,10 +2824,10 @@ void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
// Name is always in a2.
__ li(LoadDescriptor::NameRegister(), Operand(instr->name()));
EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr);
Handle<Code> ic =
CodeFactory::LoadICInOptimizedCode(
isolate(), NOT_INSIDE_TYPEOF, instr->hydrogen()->language_mode(),
instr->hydrogen()->initialization_state()).code();
Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(
isolate(), NOT_INSIDE_TYPEOF,
instr->hydrogen()->initialization_state())
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
@ -3181,8 +3181,8 @@ void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
}
Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode(
isolate(), instr->hydrogen()->language_mode(),
instr->hydrogen()->initialization_state()).code();
isolate(), instr->hydrogen()->initialization_state())
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}

View File

@ -2738,9 +2738,9 @@ void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
__ mov(LoadDescriptor::NameRegister(), Operand(instr->name()));
EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
Handle<Code> ic =
CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(),
SLOPPY, PREMONOMORPHIC).code();
Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(
isolate(), instr->typeof_mode(), PREMONOMORPHIC)
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
@ -2855,10 +2855,10 @@ void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
// Name is always in r5.
__ mov(LoadDescriptor::NameRegister(), Operand(instr->name()));
EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr);
Handle<Code> ic =
CodeFactory::LoadICInOptimizedCode(
isolate(), NOT_INSIDE_TYPEOF, instr->hydrogen()->language_mode(),
instr->hydrogen()->initialization_state()).code();
Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(
isolate(), NOT_INSIDE_TYPEOF,
instr->hydrogen()->initialization_state())
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
@ -3222,8 +3222,8 @@ void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
}
Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode(
isolate(), instr->hydrogen()->language_mode(),
instr->hydrogen()->initialization_state()).code();
isolate(), instr->hydrogen()->initialization_state())
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}

View File

@ -2616,9 +2616,9 @@ void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
__ Move(LoadDescriptor::NameRegister(), instr->name());
EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
Handle<Code> ic =
CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(),
SLOPPY, PREMONOMORPHIC).code();
Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(
isolate(), instr->typeof_mode(), PREMONOMORPHIC)
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
@ -2733,10 +2733,10 @@ void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
__ Move(LoadDescriptor::NameRegister(), instr->name());
EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr);
Handle<Code> ic =
CodeFactory::LoadICInOptimizedCode(
isolate(), NOT_INSIDE_TYPEOF, instr->hydrogen()->language_mode(),
instr->hydrogen()->initialization_state()).code();
Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(
isolate(), NOT_INSIDE_TYPEOF,
instr->hydrogen()->initialization_state())
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
@ -3025,8 +3025,8 @@ void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
}
Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode(
isolate(), instr->hydrogen()->language_mode(),
instr->hydrogen()->initialization_state()).code();
isolate(), instr->hydrogen()->initialization_state())
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}

View File

@ -2886,9 +2886,9 @@ void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
__ mov(LoadDescriptor::NameRegister(), instr->name());
EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
Handle<Code> ic =
CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(),
SLOPPY, PREMONOMORPHIC).code();
Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(
isolate(), instr->typeof_mode(), PREMONOMORPHIC)
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
@ -2997,10 +2997,10 @@ void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
__ mov(LoadDescriptor::NameRegister(), instr->name());
EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr);
Handle<Code> ic =
CodeFactory::LoadICInOptimizedCode(
isolate(), NOT_INSIDE_TYPEOF, instr->hydrogen()->language_mode(),
instr->hydrogen()->initialization_state()).code();
Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(
isolate(), NOT_INSIDE_TYPEOF,
instr->hydrogen()->initialization_state())
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
@ -3233,8 +3233,8 @@ void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
}
Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode(
isolate(), instr->hydrogen()->language_mode(),
instr->hydrogen()->initialization_state()).code();
isolate(), instr->hydrogen()->initialization_state())
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}

View File

@ -707,7 +707,7 @@ MaybeHandle<Object> Debug::CallFunction(const char* name, int argc,
AssertDebugContext();
Handle<Object> holder = isolate_->natives_utils_object();
Handle<JSFunction> fun = Handle<JSFunction>::cast(
Object::GetProperty(isolate_, holder, name, STRICT).ToHandleChecked());
Object::GetProperty(isolate_, holder, name).ToHandleChecked());
Handle<Object> undefined = isolate_->factory()->undefined_value();
return Execution::TryCall(isolate_, fun, undefined, argc, args);
}

View File

@ -2106,7 +2106,7 @@ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
__ mov(LoadDescriptor::NameRegister(), Operand(key->value()));
__ mov(LoadDescriptor::SlotRegister(),
Operand(SmiFromSlot(prop->PropertyFeedbackSlot())));
CallLoadIC(NOT_INSIDE_TYPEOF, language_mode());
CallLoadIC(NOT_INSIDE_TYPEOF);
}
@ -2118,14 +2118,13 @@ void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) {
DCHECK(prop->IsSuperAccess());
__ Push(key->value());
__ Push(Smi::FromInt(language_mode()));
__ CallRuntime(Runtime::kLoadFromSuper);
}
void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
SetExpressionPosition(prop);
Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code();
Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code();
__ mov(LoadDescriptor::SlotRegister(),
Operand(SmiFromSlot(prop->PropertyFeedbackSlot())));
CallIC(ic);
@ -2135,7 +2134,6 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) {
// Stack: receiver, home_object, key.
SetExpressionPosition(prop);
__ Push(Smi::FromInt(language_mode()));
__ CallRuntime(Runtime::kLoadKeyedFromSuper);
}
@ -2658,7 +2656,6 @@ void FullCodeGenerator::EmitSuperCallWithLoadIC(Call* expr) {
__ ldr(scratch, MemOperand(sp, kPointerSize * 2));
__ Push(scratch);
__ Push(key->value());
__ Push(Smi::FromInt(language_mode()));
// Stack here:
// - home_object
@ -2666,7 +2663,6 @@ void FullCodeGenerator::EmitSuperCallWithLoadIC(Call* expr) {
// - this (receiver) <-- LoadFromSuper will pop here and below.
// - home_object
// - key
// - language_mode
__ CallRuntime(Runtime::kLoadFromSuper);
// Replace home_object with target function.
@ -2720,7 +2716,6 @@ void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) {
__ ldr(scratch, MemOperand(sp, kPointerSize * 2));
__ Push(scratch);
VisitForStackValue(prop->key());
__ Push(Smi::FromInt(language_mode()));
// Stack here:
// - home_object
@ -2728,7 +2723,6 @@ void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) {
// - this (receiver) <-- LoadKeyedFromSuper will pop here and below.
// - home_object
// - key
// - language_mode
__ CallRuntime(Runtime::kLoadKeyedFromSuper);
// Replace home_object with target function.

View File

@ -1892,7 +1892,7 @@ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
__ Mov(LoadDescriptor::NameRegister(), Operand(key->value()));
__ Mov(LoadDescriptor::SlotRegister(),
SmiFromSlot(prop->PropertyFeedbackSlot()));
CallLoadIC(NOT_INSIDE_TYPEOF, language_mode());
CallLoadIC(NOT_INSIDE_TYPEOF);
}
@ -1904,7 +1904,6 @@ void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) {
DCHECK(prop->IsSuperAccess());
__ Push(key->value());
__ Push(Smi::FromInt(language_mode()));
__ CallRuntime(Runtime::kLoadFromSuper);
}
@ -1912,7 +1911,7 @@ void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) {
void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
SetExpressionPosition(prop);
// Call keyed load IC. It has arguments key and receiver in x0 and x1.
Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code();
Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code();
__ Mov(LoadDescriptor::SlotRegister(),
SmiFromSlot(prop->PropertyFeedbackSlot()));
CallIC(ic);
@ -1922,7 +1921,6 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) {
// Stack: receiver, home_object, key.
SetExpressionPosition(prop);
__ Push(Smi::FromInt(language_mode()));
__ CallRuntime(Runtime::kLoadKeyedFromSuper);
}
@ -2459,14 +2457,12 @@ void FullCodeGenerator::EmitSuperCallWithLoadIC(Call* expr) {
__ Peek(scratch, kPointerSize);
__ Push(x0, scratch);
__ Push(key->value());
__ Push(Smi::FromInt(language_mode()));
// Stack here:
// - home_object
// - this (receiver)
// - this (receiver) <-- LoadFromSuper will pop here and below.
// - home_object
// - language_mode
__ CallRuntime(Runtime::kLoadFromSuper);
// Replace home_object with target function.
@ -2521,7 +2517,6 @@ void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) {
__ Peek(scratch, kPointerSize);
__ Push(x0, scratch);
VisitForStackValue(prop->key());
__ Push(Smi::FromInt(language_mode()));
// Stack here:
// - home_object
@ -2529,7 +2524,6 @@ void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) {
// - this (receiver) <-- LoadKeyedFromSuper will pop here and below.
// - home_object
// - key
// - language_mode
__ CallRuntime(Runtime::kLoadKeyedFromSuper);
// Replace home_object with target function.

View File

@ -181,10 +181,8 @@ void FullCodeGenerator::PrepareForBailout(Expression* node, State state) {
void FullCodeGenerator::CallLoadIC(TypeofMode typeof_mode,
LanguageMode language_mode,
TypeFeedbackId id) {
Handle<Code> ic =
CodeFactory::LoadIC(isolate(), typeof_mode, language_mode).code();
Handle<Code> ic = CodeFactory::LoadIC(isolate(), typeof_mode).code();
CallIC(ic, id);
}

View File

@ -675,7 +675,7 @@ class FullCodeGenerator: public AstVisitor {
TypeFeedbackId id = TypeFeedbackId::None());
// Inside typeof reference errors are never thrown.
void CallLoadIC(TypeofMode typeof_mode, LanguageMode language_mode = SLOPPY,
void CallLoadIC(TypeofMode typeof_mode,
TypeFeedbackId id = TypeFeedbackId::None());
void CallStoreIC(TypeFeedbackId id = TypeFeedbackId::None());

View File

@ -2009,7 +2009,7 @@ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
__ mov(LoadDescriptor::NameRegister(), Immediate(key->value()));
__ mov(LoadDescriptor::SlotRegister(),
Immediate(SmiFromSlot(prop->PropertyFeedbackSlot())));
CallLoadIC(NOT_INSIDE_TYPEOF, language_mode());
CallLoadIC(NOT_INSIDE_TYPEOF);
}
@ -2021,14 +2021,13 @@ void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) {
DCHECK(prop->IsSuperAccess());
__ push(Immediate(key->value()));
__ push(Immediate(Smi::FromInt(language_mode())));
__ CallRuntime(Runtime::kLoadFromSuper);
}
void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
SetExpressionPosition(prop);
Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code();
Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code();
__ mov(LoadDescriptor::SlotRegister(),
Immediate(SmiFromSlot(prop->PropertyFeedbackSlot())));
CallIC(ic);
@ -2038,7 +2037,6 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) {
// Stack: receiver, home_object, key.
SetExpressionPosition(prop);
__ push(Immediate(Smi::FromInt(language_mode())));
__ CallRuntime(Runtime::kLoadKeyedFromSuper);
}
@ -2549,14 +2547,12 @@ void FullCodeGenerator::EmitSuperCallWithLoadIC(Call* expr) {
__ push(eax);
__ push(Operand(esp, kPointerSize * 2));
__ push(Immediate(key->value()));
__ push(Immediate(Smi::FromInt(language_mode())));
// Stack here:
// - home_object
// - this (receiver)
// - this (receiver) <-- LoadFromSuper will pop here and below.
// - home_object
// - key
// - language_mode
__ CallRuntime(Runtime::kLoadFromSuper);
// Replace home_object with target function.
@ -2607,14 +2603,12 @@ void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) {
__ push(eax);
__ push(Operand(esp, kPointerSize * 2));
VisitForStackValue(prop->key());
__ push(Immediate(Smi::FromInt(language_mode())));
// Stack here:
// - home_object
// - this (receiver)
// - this (receiver) <-- LoadKeyedFromSuper will pop here and below.
// - home_object
// - key
// - language_mode
__ CallRuntime(Runtime::kLoadKeyedFromSuper);
// Replace home_object with target function.

View File

@ -2093,7 +2093,7 @@ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
__ li(LoadDescriptor::NameRegister(), Operand(key->value()));
__ li(LoadDescriptor::SlotRegister(),
Operand(SmiFromSlot(prop->PropertyFeedbackSlot())));
CallLoadIC(NOT_INSIDE_TYPEOF, language_mode());
CallLoadIC(NOT_INSIDE_TYPEOF);
}
@ -2106,14 +2106,13 @@ void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) {
DCHECK(prop->IsSuperAccess());
__ Push(key->value());
__ Push(Smi::FromInt(language_mode()));
__ CallRuntime(Runtime::kLoadFromSuper);
}
void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
SetExpressionPosition(prop);
Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code();
Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code();
__ li(LoadDescriptor::SlotRegister(),
Operand(SmiFromSlot(prop->PropertyFeedbackSlot())));
CallIC(ic);
@ -2123,7 +2122,6 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) {
// Stack: receiver, home_object, key.
SetExpressionPosition(prop);
__ Push(Smi::FromInt(language_mode()));
__ CallRuntime(Runtime::kLoadKeyedFromSuper);
}
@ -2646,7 +2644,6 @@ void FullCodeGenerator::EmitSuperCallWithLoadIC(Call* expr) {
VisitForAccumulatorValue(super_ref->this_var());
__ Push(scratch, v0, v0, scratch);
__ Push(key->value());
__ Push(Smi::FromInt(language_mode()));
// Stack here:
// - home_object
@ -2654,7 +2651,6 @@ void FullCodeGenerator::EmitSuperCallWithLoadIC(Call* expr) {
// - this (receiver) <-- LoadFromSuper will pop here and below.
// - home_object
// - key
// - language_mode
__ CallRuntime(Runtime::kLoadFromSuper);
// Replace home_object with target function.
@ -2706,7 +2702,6 @@ void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) {
VisitForAccumulatorValue(super_ref->this_var());
__ Push(scratch, v0, v0, scratch);
VisitForStackValue(prop->key());
__ Push(Smi::FromInt(language_mode()));
// Stack here:
// - home_object
@ -2714,7 +2709,6 @@ void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) {
// - this (receiver) <-- LoadKeyedFromSuper will pop here and below.
// - home_object
// - key
// - language_mode
__ CallRuntime(Runtime::kLoadKeyedFromSuper);
// Replace home_object with target function.

View File

@ -2097,7 +2097,7 @@ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
__ li(LoadDescriptor::NameRegister(), Operand(key->value()));
__ li(LoadDescriptor::SlotRegister(),
Operand(SmiFromSlot(prop->PropertyFeedbackSlot())));
CallLoadIC(NOT_INSIDE_TYPEOF, language_mode());
CallLoadIC(NOT_INSIDE_TYPEOF);
}
@ -2110,7 +2110,6 @@ void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) {
DCHECK(prop->IsSuperAccess());
__ Push(key->value());
__ Push(Smi::FromInt(language_mode()));
__ CallRuntime(Runtime::kLoadFromSuper);
}
@ -2119,7 +2118,7 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
// Call keyed load IC. It has register arguments receiver and key.
SetExpressionPosition(prop);
Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code();
Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code();
__ li(LoadDescriptor::SlotRegister(),
Operand(SmiFromSlot(prop->PropertyFeedbackSlot())));
CallIC(ic);
@ -2129,7 +2128,6 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) {
// Stack: receiver, home_object, key.
SetExpressionPosition(prop);
__ Push(Smi::FromInt(language_mode()));
__ CallRuntime(Runtime::kLoadKeyedFromSuper);
}
@ -2652,7 +2650,6 @@ void FullCodeGenerator::EmitSuperCallWithLoadIC(Call* expr) {
VisitForAccumulatorValue(super_ref->this_var());
__ Push(scratch, v0, v0, scratch);
__ Push(key->value());
__ Push(Smi::FromInt(language_mode()));
// Stack here:
// - home_object
@ -2660,7 +2657,6 @@ void FullCodeGenerator::EmitSuperCallWithLoadIC(Call* expr) {
// - this (receiver) <-- LoadFromSuper will pop here and below.
// - home_object
// - key
// - language_mode
__ CallRuntime(Runtime::kLoadFromSuper);
// Replace home_object with target function.
@ -2712,7 +2708,6 @@ void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) {
VisitForAccumulatorValue(super_ref->this_var());
__ Push(scratch, v0, v0, scratch);
VisitForStackValue(prop->key());
__ Push(Smi::FromInt(language_mode()));
// Stack here:
// - home_object
@ -2720,7 +2715,6 @@ void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) {
// - this (receiver) <-- LoadKeyedFromSuper will pop here and below.
// - home_object
// - key
// - language_mode
__ CallRuntime(Runtime::kLoadKeyedFromSuper);
// Replace home_object with target function.

View File

@ -2072,7 +2072,7 @@ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
__ mov(LoadDescriptor::NameRegister(), Operand(key->value()));
__ mov(LoadDescriptor::SlotRegister(),
Operand(SmiFromSlot(prop->PropertyFeedbackSlot())));
CallLoadIC(NOT_INSIDE_TYPEOF, language_mode());
CallLoadIC(NOT_INSIDE_TYPEOF);
}
@ -2084,14 +2084,13 @@ void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) {
DCHECK(prop->IsSuperAccess());
__ Push(key->value());
__ Push(Smi::FromInt(language_mode()));
__ CallRuntime(Runtime::kLoadFromSuper);
}
void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
SetExpressionPosition(prop);
Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code();
Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code();
__ mov(LoadDescriptor::SlotRegister(),
Operand(SmiFromSlot(prop->PropertyFeedbackSlot())));
CallIC(ic);
@ -2101,7 +2100,6 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) {
// Stack: receiver, home_object, key.
SetExpressionPosition(prop);
__ Push(Smi::FromInt(language_mode()));
__ CallRuntime(Runtime::kLoadKeyedFromSuper);
}
@ -2650,7 +2648,6 @@ void FullCodeGenerator::EmitSuperCallWithLoadIC(Call* expr) {
VisitForAccumulatorValue(super_ref->this_var());
__ Push(scratch, r3, r3, scratch);
__ Push(key->value());
__ Push(Smi::FromInt(language_mode()));
// Stack here:
// - home_object
@ -2658,7 +2655,6 @@ void FullCodeGenerator::EmitSuperCallWithLoadIC(Call* expr) {
// - this (receiver) <-- LoadFromSuper will pop here and below.
// - home_object
// - key
// - language_mode
__ CallRuntime(Runtime::kLoadFromSuper);
// Replace home_object with target function.
@ -2709,7 +2705,6 @@ void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) {
VisitForAccumulatorValue(super_ref->this_var());
__ Push(scratch, r3, r3, scratch);
VisitForStackValue(prop->key());
__ Push(Smi::FromInt(language_mode()));
// Stack here:
// - home_object
@ -2717,7 +2712,6 @@ void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) {
// - this (receiver) <-- LoadKeyedFromSuper will pop here and below.
// - home_object
// - key
// - language_mode
__ CallRuntime(Runtime::kLoadKeyedFromSuper);
// Replace home_object with target function.

View File

@ -2028,7 +2028,7 @@ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
__ Move(LoadDescriptor::NameRegister(), key->value());
__ Move(LoadDescriptor::SlotRegister(),
SmiFromSlot(prop->PropertyFeedbackSlot()));
CallLoadIC(NOT_INSIDE_TYPEOF, language_mode());
CallLoadIC(NOT_INSIDE_TYPEOF);
}
@ -2040,14 +2040,13 @@ void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) {
DCHECK(prop->IsSuperAccess());
__ Push(key->value());
__ Push(Smi::FromInt(language_mode()));
__ CallRuntime(Runtime::kLoadFromSuper);
}
void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
SetExpressionPosition(prop);
Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code();
Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code();
__ Move(LoadDescriptor::SlotRegister(),
SmiFromSlot(prop->PropertyFeedbackSlot()));
CallIC(ic);
@ -2057,7 +2056,6 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) {
// Stack: receiver, home_object, key.
SetExpressionPosition(prop);
__ Push(Smi::FromInt(language_mode()));
__ CallRuntime(Runtime::kLoadKeyedFromSuper);
}
@ -2532,7 +2530,6 @@ void FullCodeGenerator::EmitSuperCallWithLoadIC(Call* expr) {
__ Push(rax);
__ Push(Operand(rsp, kPointerSize * 2));
__ Push(key->value());
__ Push(Smi::FromInt(language_mode()));
// Stack here:
// - home_object
@ -2540,7 +2537,6 @@ void FullCodeGenerator::EmitSuperCallWithLoadIC(Call* expr) {
// - this (receiver) <-- LoadFromSuper will pop here and below.
// - home_object
// - key
// - language_mode
__ CallRuntime(Runtime::kLoadFromSuper);
// Replace home_object with target function.
@ -2591,7 +2587,6 @@ void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) {
__ Push(rax);
__ Push(Operand(rsp, kPointerSize * 2));
VisitForStackValue(prop->key());
__ Push(Smi::FromInt(language_mode()));
// Stack here:
// - home_object
@ -2599,7 +2594,6 @@ void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) {
// - this (receiver) <-- LoadKeyedFromSuper will pop here and below.
// - home_object
// - key
// - language_mode
__ CallRuntime(Runtime::kLoadKeyedFromSuper);
// Replace home_object with target function.

View File

@ -2001,7 +2001,7 @@ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
__ mov(LoadDescriptor::NameRegister(), Immediate(key->value()));
__ mov(LoadDescriptor::SlotRegister(),
Immediate(SmiFromSlot(prop->PropertyFeedbackSlot())));
CallLoadIC(NOT_INSIDE_TYPEOF, language_mode());
CallLoadIC(NOT_INSIDE_TYPEOF);
}
@ -2013,14 +2013,13 @@ void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) {
DCHECK(prop->IsSuperAccess());
__ push(Immediate(key->value()));
__ push(Immediate(Smi::FromInt(language_mode())));
__ CallRuntime(Runtime::kLoadFromSuper);
}
void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
SetExpressionPosition(prop);
Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code();
Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code();
__ mov(LoadDescriptor::SlotRegister(),
Immediate(SmiFromSlot(prop->PropertyFeedbackSlot())));
CallIC(ic);
@ -2030,7 +2029,6 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) {
// Stack: receiver, home_object, key.
SetExpressionPosition(prop);
__ push(Immediate(Smi::FromInt(language_mode())));
__ CallRuntime(Runtime::kLoadKeyedFromSuper);
}
@ -2541,14 +2539,12 @@ void FullCodeGenerator::EmitSuperCallWithLoadIC(Call* expr) {
__ push(eax);
__ push(Operand(esp, kPointerSize * 2));
__ push(Immediate(key->value()));
__ push(Immediate(Smi::FromInt(language_mode())));
// Stack here:
// - home_object
// - this (receiver)
// - this (receiver) <-- LoadFromSuper will pop here and below.
// - home_object
// - key
// - language_mode
__ CallRuntime(Runtime::kLoadFromSuper);
// Replace home_object with target function.
@ -2599,14 +2595,12 @@ void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) {
__ push(eax);
__ push(Operand(esp, kPointerSize * 2));
VisitForStackValue(prop->key());
__ push(Immediate(Smi::FromInt(language_mode())));
// Stack here:
// - home_object
// - this (receiver)
// - this (receiver) <-- LoadKeyedFromSuper will pop here and below.
// - home_object
// - key
// - language_mode
__ CallRuntime(Runtime::kLoadKeyedFromSuper);
// Replace home_object with target function.

View File

@ -157,8 +157,7 @@ static void GenerateKeyedLoadReceiverCheck(MacroAssembler* masm,
static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver,
Register key, Register elements,
Register scratch1, Register scratch2,
Register result, Label* slow,
LanguageMode language_mode) {
Register result, Label* slow) {
// Register use:
//
// receiver - holds the receiver on entry.
@ -215,13 +214,8 @@ static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver,
__ jmp(&check_next_prototype);
__ bind(&absent);
if (is_strong(language_mode)) {
// Strong mode accesses must throw in this case, so call the runtime.
__ jmp(slow);
} else {
__ LoadRoot(result, Heap::kUndefinedValueRootIndex);
__ jmp(&done);
}
__ LoadRoot(result, Heap::kUndefinedValueRootIndex);
__ jmp(&done);
__ bind(&in_bounds);
// Fast case: Do the load.
@ -264,8 +258,7 @@ static void GenerateKeyNameCheck(MacroAssembler* masm, Register key,
__ bind(&unique);
}
void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) {
void LoadIC::GenerateNormal(MacroAssembler* masm) {
Register dictionary = r0;
DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister()));
DCHECK(!dictionary.is(LoadDescriptor::NameRegister()));
@ -280,7 +273,7 @@ void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) {
// Dictionary load failed, go slow (but don't miss).
__ bind(&slow);
GenerateRuntimeGetProperty(masm, language_mode);
GenerateRuntimeGetProperty(masm);
}
@ -312,17 +305,14 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kLoadIC_Miss);
}
void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
LanguageMode language_mode) {
void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
// The return address is in lr.
__ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister());
__ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister());
// Do tail-call to runtime routine.
__ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong
: Runtime::kGetProperty);
__ TailCallRuntime(Runtime::kGetProperty);
}
@ -340,22 +330,17 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kKeyedLoadIC_Miss);
}
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
LanguageMode language_mode) {
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
// The return address is in lr.
__ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister());
// Perform tail call to the entry.
// Do tail-call to runtime routine.
__ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong
: Runtime::kKeyedGetProperty);
__ TailCallRuntime(Runtime::kKeyedGetProperty);
}
void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm,
LanguageMode language_mode) {
void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm) {
// The return address is in lr.
Label slow, check_name, index_smi, index_name, property_array_property;
Label probe_dictionary, check_number_dictionary;
@ -379,8 +364,7 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm,
// Check the receiver's map to see if it has fast elements.
__ CheckFastElements(r0, r3, &check_number_dictionary);
GenerateFastArrayLoad(masm, receiver, key, r0, r3, r4, r0, &slow,
language_mode);
GenerateFastArrayLoad(masm, receiver, key, r0, r3, r4, r0, &slow);
__ IncrementCounter(isolate->counters()->ic_keyed_load_generic_smi(), 1, r4,
r3);
__ Ret();
@ -403,7 +387,7 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm,
__ bind(&slow);
__ IncrementCounter(isolate->counters()->ic_keyed_load_generic_slow(), 1, r4,
r3);
GenerateRuntimeGetProperty(masm, language_mode);
GenerateRuntimeGetProperty(masm);
__ bind(&check_name);
GenerateKeyNameCheck(masm, key, r0, r3, &index_name, &slow);

View File

@ -164,8 +164,7 @@ static void GenerateKeyedLoadReceiverCheck(MacroAssembler* masm,
static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver,
Register key, Register elements,
Register scratch1, Register scratch2,
Register result, Label* slow,
LanguageMode language_mode) {
Register result, Label* slow) {
DCHECK(!AreAliased(receiver, key, elements, scratch1, scratch2));
Label check_prototypes, check_next_prototype;
@ -203,13 +202,8 @@ static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver,
__ B(&check_next_prototype);
__ Bind(&absent);
if (is_strong(language_mode)) {
// Strong mode accesses must throw in this case, so call the runtime.
__ B(slow);
} else {
__ LoadRoot(result, Heap::kUndefinedValueRootIndex);
__ B(&done);
}
__ LoadRoot(result, Heap::kUndefinedValueRootIndex);
__ B(&done);
__ Bind(&in_bounds);
// Fast case: Do the load.
@ -260,8 +254,7 @@ static void GenerateKeyNameCheck(MacroAssembler* masm, Register key,
// Fall through if the key is a unique name.
}
void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) {
void LoadIC::GenerateNormal(MacroAssembler* masm) {
Register dictionary = x0;
DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister()));
DCHECK(!dictionary.is(LoadDescriptor::NameRegister()));
@ -275,7 +268,7 @@ void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) {
// Dictionary load failed, go slow (but don't miss).
__ Bind(&slow);
GenerateRuntimeGetProperty(masm, language_mode);
GenerateRuntimeGetProperty(masm);
}
@ -296,15 +289,12 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kLoadIC_Miss);
}
void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
LanguageMode language_mode) {
void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
// The return address is in lr.
__ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister());
// Do tail-call to runtime routine.
__ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong
: Runtime::kGetProperty);
__ TailCallRuntime(Runtime::kGetProperty);
}
@ -325,24 +315,19 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kKeyedLoadIC_Miss);
}
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
LanguageMode language_mode) {
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
// The return address is in lr.
__ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister());
// Do tail-call to runtime routine.
__ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong
: Runtime::kKeyedGetProperty);
__ TailCallRuntime(Runtime::kKeyedGetProperty);
}
static void GenerateKeyedLoadWithSmiKey(MacroAssembler* masm, Register key,
Register receiver, Register scratch1,
Register scratch2, Register scratch3,
Register scratch4, Register scratch5,
Label* slow,
LanguageMode language_mode) {
Label* slow) {
DCHECK(!AreAliased(key, receiver, scratch1, scratch2, scratch3, scratch4,
scratch5));
@ -358,7 +343,7 @@ static void GenerateKeyedLoadWithSmiKey(MacroAssembler* masm, Register key,
__ CheckFastElements(scratch1, scratch2, &check_number_dictionary);
GenerateFastArrayLoad(masm, receiver, key, scratch3, scratch2, scratch1,
result, slow, language_mode);
result, slow);
__ IncrementCounter(isolate->counters()->ic_keyed_load_generic_smi(), 1,
scratch1, scratch2);
__ Ret();
@ -429,9 +414,7 @@ static void GenerateKeyedLoadWithNameKey(MacroAssembler* masm, Register key,
__ Ret();
}
void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm,
LanguageMode language_mode) {
void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm) {
// The return address is in lr.
Label slow, check_name, index_smi, index_name;
@ -444,14 +427,13 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm,
__ Bind(&index_smi);
// Now the key is known to be a smi. This place is also jumped to from below
// where a numeric string is converted to a smi.
GenerateKeyedLoadWithSmiKey(masm, key, receiver, x7, x3, x4, x5, x6, &slow,
language_mode);
GenerateKeyedLoadWithSmiKey(masm, key, receiver, x7, x3, x4, x5, x6, &slow);
// Slow case.
__ Bind(&slow);
__ IncrementCounter(masm->isolate()->counters()->ic_keyed_load_generic_slow(),
1, x4, x3);
GenerateRuntimeGetProperty(masm, language_mode);
GenerateRuntimeGetProperty(masm);
__ Bind(&check_name);
GenerateKeyNameCheck(masm, key, x0, x3, &index_name, &slow);

View File

@ -561,10 +561,8 @@ Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback(
#undef __
void ElementHandlerCompiler::CompileElementHandlers(
MapHandleList* receiver_maps, CodeHandleList* handlers,
LanguageMode language_mode) {
MapHandleList* receiver_maps, CodeHandleList* handlers) {
for (int i = 0; i < receiver_maps->length(); ++i) {
Handle<Map> receiver_map = receiver_maps->at(i);
Handle<Code> cached_stub;
@ -572,9 +570,7 @@ void ElementHandlerCompiler::CompileElementHandlers(
if (receiver_map->IsStringMap()) {
cached_stub = LoadIndexedStringStub(isolate()).GetCode();
} else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) {
cached_stub = is_strong(language_mode)
? isolate()->builtins()->KeyedLoadIC_Slow_Strong()
: isolate()->builtins()->KeyedLoadIC_Slow();
cached_stub = isolate()->builtins()->KeyedLoadIC_Slow();
} else {
bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE;
ElementsKind elements_kind = receiver_map->elements_kind();
@ -583,9 +579,7 @@ void ElementHandlerCompiler::CompileElementHandlers(
// generated stub code needs to check that dynamically anyway.
bool convert_hole_to_undefined =
(is_js_array && elements_kind == FAST_HOLEY_ELEMENTS &&
*receiver_map ==
isolate()->get_initial_js_array_map(elements_kind)) &&
!is_strong(language_mode);
*receiver_map == isolate()->get_initial_js_array_map(elements_kind));
if (receiver_map->has_indexed_interceptor()) {
cached_stub = LoadIndexedInterceptorStub(isolate()).GetCode();
@ -597,9 +591,7 @@ void ElementHandlerCompiler::CompileElementHandlers(
convert_hole_to_undefined).GetCode();
} else {
DCHECK(elements_kind == DICTIONARY_ELEMENTS);
LoadICState state =
LoadICState(is_strong(language_mode) ? LoadICState::kStrongModeState
: kNoExtraICState);
LoadICState state = LoadICState(kNoExtraICState);
cached_stub = LoadDictionaryElementStub(isolate(), state).GetCode();
}
}

View File

@ -295,8 +295,7 @@ class ElementHandlerCompiler : public PropertyHandlerCompiler {
virtual ~ElementHandlerCompiler() {}
void CompileElementHandlers(MapHandleList* receiver_maps,
CodeHandleList* handlers,
LanguageMode language_mode);
CodeHandleList* handlers);
static void GenerateStoreSlow(MacroAssembler* masm);
};

View File

@ -167,7 +167,7 @@ static void GenerateKeyedLoadReceiverCheck(MacroAssembler* masm,
static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver,
Register key, Register scratch,
Register scratch2, Register result,
Label* slow, LanguageMode language_mode) {
Label* slow) {
// Register use:
// receiver - holds the receiver and is unchanged.
// key - holds the key and is unchanged (must be a smi).
@ -211,13 +211,8 @@ static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver,
__ jmp(&check_next_prototype);
__ bind(&absent);
if (is_strong(language_mode)) {
// Strong mode accesses must throw in this case, so call the runtime.
__ jmp(slow);
} else {
__ mov(result, masm->isolate()->factory()->undefined_value());
__ jmp(&done);
}
__ mov(result, masm->isolate()->factory()->undefined_value());
__ jmp(&done);
__ bind(&in_bounds);
// Fast case: Do the load.
@ -262,9 +257,7 @@ static void GenerateKeyNameCheck(MacroAssembler* masm, Register key,
__ bind(&unique);
}
void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm,
LanguageMode language_mode) {
void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm) {
// The return address is on the stack.
Label slow, check_name, index_smi, index_name, property_array_property;
Label probe_dictionary, check_number_dictionary;
@ -286,8 +279,7 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm,
// Check the receiver's map to see if it has fast elements.
__ CheckFastElements(eax, &check_number_dictionary);
GenerateFastArrayLoad(masm, receiver, key, eax, ebx, eax, &slow,
language_mode);
GenerateFastArrayLoad(masm, receiver, key, eax, ebx, eax, &slow);
Isolate* isolate = masm->isolate();
Counters* counters = isolate->counters();
__ IncrementCounter(counters->ic_keyed_load_generic_smi(), 1);
@ -319,7 +311,7 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm,
__ bind(&slow);
// Slow case: jump to runtime.
__ IncrementCounter(counters->ic_keyed_load_generic_slow(), 1);
GenerateRuntimeGetProperty(masm, language_mode);
GenerateRuntimeGetProperty(masm);
__ bind(&check_name);
GenerateKeyNameCheck(masm, key, eax, ebx, &index_name, &slow);
@ -628,8 +620,7 @@ void KeyedStoreIC::GenerateMegamorphic(MacroAssembler* masm,
GenerateMiss(masm);
}
void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) {
void LoadIC::GenerateNormal(MacroAssembler* masm) {
Register dictionary = eax;
DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister()));
DCHECK(!dictionary.is(LoadDescriptor::NameRegister()));
@ -644,7 +635,7 @@ void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) {
// Dictionary load failed, go slow (but don't miss).
__ bind(&slow);
GenerateRuntimeGetProperty(masm, language_mode);
GenerateRuntimeGetProperty(masm);
}
@ -675,9 +666,7 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kLoadIC_Miss);
}
void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
LanguageMode language_mode) {
void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
// Return address is on the stack.
Register receiver = LoadDescriptor::ReceiverRegister();
Register name = LoadDescriptor::NameRegister();
@ -689,8 +678,7 @@ void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
__ push(ebx);
// Do tail-call to runtime routine.
__ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong
: Runtime::kGetProperty);
__ TailCallRuntime(Runtime::kGetProperty);
}
@ -704,9 +692,7 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kKeyedLoadIC_Miss);
}
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
LanguageMode language_mode) {
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
// Return address is on the stack.
Register receiver = LoadDescriptor::ReceiverRegister();
Register name = LoadDescriptor::NameRegister();
@ -718,8 +704,7 @@ void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
__ push(ebx);
// Do tail-call to runtime routine.
__ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong
: Runtime::kKeyedGetProperty);
__ TailCallRuntime(Runtime::kKeyedGetProperty);
}

View File

@ -43,8 +43,7 @@ Handle<Code> PropertyICCompiler::ComputeKeyedLoadMonomorphicHandler(
// stub code needs to check that dynamically anyway.
bool convert_hole_to_undefined =
is_js_array && elements_kind == FAST_HOLEY_ELEMENTS &&
*receiver_map == isolate->get_initial_js_array_map(elements_kind) &&
!(is_strong(LoadICState::GetLanguageMode(extra_ic_state)));
*receiver_map == isolate->get_initial_js_array_map(elements_kind);
Handle<Code> stub;
if (receiver_map->has_indexed_interceptor()) {
stub = LoadIndexedInterceptorStub(isolate).GetCode();

View File

@ -95,9 +95,6 @@ void LoadIC::set_target(Code* code) {
// The contextual mode must be preserved across IC patching.
DCHECK(LoadICState::GetTypeofMode(code->extra_ic_state()) ==
LoadICState::GetTypeofMode(target()->extra_ic_state()));
// Strongness must be preserved across IC patching.
DCHECK(LoadICState::GetLanguageMode(code->extra_ic_state()) ==
LoadICState::GetLanguageMode(target()->extra_ic_state()));
IC::set_target(code);
}

View File

@ -202,38 +202,24 @@ class CompareICState {
class LoadICState final BASE_EMBEDDED {
private:
class TypeofModeBits : public BitField<TypeofMode, 0, 1> {};
class LanguageModeBits
: public BitField<LanguageMode, TypeofModeBits::kNext, 2> {};
STATIC_ASSERT(static_cast<int>(INSIDE_TYPEOF) == 0);
const ExtraICState state_;
public:
static const uint32_t kNextBitFieldOffset = LanguageModeBits::kNext;
static const ExtraICState kStrongModeState = STRONG
<< LanguageModeBits::kShift;
static const uint32_t kNextBitFieldOffset = TypeofModeBits::kNext;
explicit LoadICState(ExtraICState extra_ic_state) : state_(extra_ic_state) {}
explicit LoadICState(TypeofMode typeof_mode, LanguageMode language_mode)
: state_(TypeofModeBits::encode(typeof_mode) |
LanguageModeBits::encode(language_mode)) {}
explicit LoadICState(TypeofMode typeof_mode)
: state_(TypeofModeBits::encode(typeof_mode)) {}
ExtraICState GetExtraICState() const { return state_; }
TypeofMode typeof_mode() const { return TypeofModeBits::decode(state_); }
LanguageMode language_mode() const {
return LanguageModeBits::decode(state_);
}
static TypeofMode GetTypeofMode(ExtraICState state) {
return LoadICState(state).typeof_mode();
}
static LanguageMode GetLanguageMode(ExtraICState state) {
return LoadICState(state).language_mode();
}
};

View File

@ -559,9 +559,7 @@ Handle<Code> KeyedLoadIC::ChooseMegamorphicStub(Isolate* isolate,
if (FLAG_compiled_keyed_generic_loads) {
return KeyedLoadGenericStub(isolate, LoadICState(extra_state)).GetCode();
} else {
return is_strong(LoadICState::GetLanguageMode(extra_state))
? isolate->builtins()->KeyedLoadIC_Megamorphic_Strong()
: isolate->builtins()->KeyedLoadIC_Megamorphic();
return isolate->builtins()->KeyedLoadIC_Megamorphic();
}
}
@ -668,9 +666,9 @@ MaybeHandle<Object> LoadIC::Load(Handle<Object> object, Handle<Name> name) {
TRACE_GENERIC_IC(isolate(), "LoadIC", "name as array index");
}
Handle<Object> result;
ASSIGN_RETURN_ON_EXCEPTION(
isolate(), result,
Object::GetElement(isolate(), object, index, language_mode()), Object);
ASSIGN_RETURN_ON_EXCEPTION(isolate(), result,
Object::GetElement(isolate(), object, index),
Object);
return result;
}
@ -714,8 +712,8 @@ MaybeHandle<Object> LoadIC::Load(Handle<Object> object, Handle<Name> name) {
// Get the property.
Handle<Object> result;
ASSIGN_RETURN_ON_EXCEPTION(
isolate(), result, Object::GetProperty(&it, language_mode()), Object);
ASSIGN_RETURN_ON_EXCEPTION(isolate(), result, Object::GetProperty(&it),
Object);
if (it.IsFound()) {
return result;
} else if (!ShouldThrowReferenceError(object)) {
@ -900,9 +898,7 @@ Handle<Code> KeyedLoadIC::initialize_stub_in_optimized_code(
if (initialization_state != MEGAMORPHIC) {
return KeyedLoadICStub(isolate, LoadICState(extra_state)).GetCode();
}
return is_strong(LoadICState::GetLanguageMode(extra_state))
? isolate->builtins()->KeyedLoadIC_Megamorphic_Strong()
: isolate->builtins()->KeyedLoadIC_Megamorphic();
return isolate->builtins()->KeyedLoadIC_Megamorphic();
}
@ -1025,7 +1021,7 @@ void LoadIC::UpdateCaches(LookupIterator* lookup) {
lookup->state() == LookupIterator::ACCESS_CHECK) {
code = slow_stub();
} else if (!lookup->IsFound()) {
if (kind() == Code::LOAD_IC && !is_strong(language_mode())) {
if (kind() == Code::LOAD_IC) {
code = NamedLoadHandlerCompiler::ComputeLoadNonexistent(lookup->name(),
receiver_map());
// TODO(jkummerow/verwaest): Introduce a builtin that handles this case.
@ -1232,9 +1228,7 @@ Handle<Code> LoadIC::CompileHandler(LookupIterator* lookup,
// property must be found in the object for the stub to be
// applicable.
if (!receiver_is_holder) break;
return is_strong(language_mode())
? isolate()->builtins()->LoadIC_Normal_Strong()
: isolate()->builtins()->LoadIC_Normal();
return isolate()->builtins()->LoadIC_Normal();
}
// -------------- Fields --------------
@ -1344,8 +1338,7 @@ Handle<Code> KeyedLoadIC::LoadElementStub(Handle<HeapObject> receiver) {
CodeHandleList handlers(target_receiver_maps.length());
ElementHandlerCompiler compiler(isolate());
compiler.CompileElementHandlers(&target_receiver_maps, &handlers,
language_mode());
compiler.CompileElementHandlers(&target_receiver_maps, &handlers);
ConfigureVectorState(Handle<Name>::null(), &target_receiver_maps, &handlers);
return null_handle;
}
@ -1356,8 +1349,7 @@ MaybeHandle<Object> KeyedLoadIC::Load(Handle<Object> object,
if (MigrateDeprecated(object)) {
Handle<Object> result;
ASSIGN_RETURN_ON_EXCEPTION(
isolate(), result,
Runtime::GetObjectProperty(isolate(), object, key, language_mode()),
isolate(), result, Runtime::GetObjectProperty(isolate(), object, key),
Object);
return result;
}
@ -1395,10 +1387,9 @@ MaybeHandle<Object> KeyedLoadIC::Load(Handle<Object> object,
if (!load_handle.is_null()) return load_handle;
Handle<Object> result;
ASSIGN_RETURN_ON_EXCEPTION(
isolate(), result,
Runtime::GetObjectProperty(isolate(), object, key, language_mode()),
Object);
ASSIGN_RETURN_ON_EXCEPTION(isolate(), result,
Runtime::GetObjectProperty(isolate(), object, key),
Object);
return result;
}
@ -2919,11 +2910,8 @@ RUNTIME_FUNCTION(Runtime_LoadElementWithInterceptor) {
DCHECK(args.smi_at(1) >= 0);
uint32_t index = args.smi_at(1);
Handle<Object> result;
// TODO(conradw): Investigate strong mode semantics for this.
LanguageMode language_mode = SLOPPY;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, result,
Object::GetElement(isolate, receiver, index, language_mode));
isolate, result, Object::GetElement(isolate, receiver, index));
return *result;
}

View File

@ -296,19 +296,14 @@ class CallIC : public IC {
class LoadIC : public IC {
public:
static ExtraICState ComputeExtraICState(TypeofMode typeof_mode,
LanguageMode language_mode) {
return LoadICState(typeof_mode, language_mode).GetExtraICState();
static ExtraICState ComputeExtraICState(TypeofMode typeof_mode) {
return LoadICState(typeof_mode).GetExtraICState();
}
TypeofMode typeof_mode() const {
return LoadICState::GetTypeofMode(extra_ic_state());
}
LanguageMode language_mode() const {
return LoadICState::GetLanguageMode(extra_ic_state());
}
LoadIC(FrameDepth depth, Isolate* isolate, FeedbackNexus* nexus = NULL)
: IC(depth, isolate, nexus) {
DCHECK(nexus != NULL);
@ -323,9 +318,8 @@ class LoadIC : public IC {
static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); }
static void GenerateMiss(MacroAssembler* masm);
static void GenerateRuntimeGetProperty(MacroAssembler* masm,
LanguageMode language_mode);
static void GenerateNormal(MacroAssembler* masm, LanguageMode language_mode);
static void GenerateRuntimeGetProperty(MacroAssembler* masm);
static void GenerateNormal(MacroAssembler* masm);
static Handle<Code> initialize_stub(Isolate* isolate,
ExtraICState extra_state);
@ -342,14 +336,10 @@ class LoadIC : public IC {
Handle<Code> slow_stub() const {
if (kind() == Code::LOAD_IC) {
return is_strong(language_mode())
? isolate()->builtins()->LoadIC_Slow_Strong()
: isolate()->builtins()->LoadIC_Slow();
return isolate()->builtins()->LoadIC_Slow();
} else {
DCHECK_EQ(Code::KEYED_LOAD_IC, kind());
return is_strong(language_mode())
? isolate()->builtins()->KeyedLoadIC_Slow_Strong()
: isolate()->builtins()->KeyedLoadIC_Slow();
return isolate()->builtins()->KeyedLoadIC_Slow();
}
}
@ -379,9 +369,8 @@ class KeyedLoadIC : public LoadIC {
: public BitField<IcCheckType, LoadICState::kNextBitFieldOffset, 1> {};
static ExtraICState ComputeExtraICState(TypeofMode typeof_mode,
LanguageMode language_mode,
IcCheckType key_type) {
return LoadICState(typeof_mode, language_mode).GetExtraICState() |
return LoadICState(typeof_mode).GetExtraICState() |
IcCheckTypeField::encode(key_type);
}
@ -401,11 +390,9 @@ class KeyedLoadIC : public LoadIC {
// Code generator routines.
static void GenerateMiss(MacroAssembler* masm);
static void GenerateRuntimeGetProperty(MacroAssembler* masm,
LanguageMode language_mode);
static void GenerateRuntimeGetProperty(MacroAssembler* masm);
static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); }
static void GenerateMegamorphic(MacroAssembler* masm,
LanguageMode language_mode);
static void GenerateMegamorphic(MacroAssembler* masm);
// Bit mask to be tested against bit field for the cases when
// generic stub should go into slow case.

View File

@ -159,8 +159,7 @@ static void GenerateKeyedLoadReceiverCheck(MacroAssembler* masm,
static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver,
Register key, Register elements,
Register scratch1, Register scratch2,
Register result, Label* slow,
LanguageMode language_mode) {
Register result, Label* slow) {
// Register use:
//
// receiver - holds the receiver on entry.
@ -216,13 +215,8 @@ static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver,
__ Branch(&check_next_prototype);
__ bind(&absent);
if (is_strong(language_mode)) {
// Strong mode accesses must throw in this case, so call the runtime.
__ Branch(slow);
} else {
__ LoadRoot(result, Heap::kUndefinedValueRootIndex);
__ Branch(&done);
}
__ LoadRoot(result, Heap::kUndefinedValueRootIndex);
__ Branch(&done);
__ bind(&in_bounds);
// Fast case: Do the load.
@ -270,8 +264,7 @@ static void GenerateKeyNameCheck(MacroAssembler* masm, Register key,
__ bind(&unique);
}
void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) {
void LoadIC::GenerateNormal(MacroAssembler* masm) {
Register dictionary = a0;
DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister()));
DCHECK(!dictionary.is(LoadDescriptor::NameRegister()));
@ -286,7 +279,7 @@ void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) {
// Dictionary load failed, go slow (but don't miss).
__ bind(&slow);
GenerateRuntimeGetProperty(masm, language_mode);
GenerateRuntimeGetProperty(masm);
}
@ -318,17 +311,14 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kLoadIC_Miss);
}
void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
LanguageMode language_mode) {
void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
// The return address is in ra.
__ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister());
__ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister());
// Do tail-call to runtime routine.
__ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong
: Runtime::kGetProperty);
__ TailCallRuntime(Runtime::kGetProperty);
}
@ -346,21 +336,16 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kKeyedLoadIC_Miss);
}
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
LanguageMode language_mode) {
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
// The return address is in ra.
__ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister());
// Do tail-call to runtime routine.
__ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong
: Runtime::kKeyedGetProperty);
__ TailCallRuntime(Runtime::kKeyedGetProperty);
}
void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm,
LanguageMode language_mode) {
void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm) {
// The return address is in ra.
Label slow, check_name, index_smi, index_name, property_array_property;
Label probe_dictionary, check_number_dictionary;
@ -384,8 +369,7 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm,
// Check the receiver's map to see if it has fast elements.
__ CheckFastElements(a0, a3, &check_number_dictionary);
GenerateFastArrayLoad(masm, receiver, key, a0, a3, t0, v0, &slow,
language_mode);
GenerateFastArrayLoad(masm, receiver, key, a0, a3, t0, v0, &slow);
__ IncrementCounter(isolate->counters()->ic_keyed_load_generic_smi(), 1, t0,
a3);
__ Ret();
@ -407,7 +391,7 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm,
__ bind(&slow);
__ IncrementCounter(isolate->counters()->ic_keyed_load_generic_slow(), 1, t0,
a3);
GenerateRuntimeGetProperty(masm, language_mode);
GenerateRuntimeGetProperty(masm);
__ bind(&check_name);
GenerateKeyNameCheck(masm, key, a0, a3, &index_name, &slow);

View File

@ -158,8 +158,7 @@ static void GenerateKeyedLoadReceiverCheck(MacroAssembler* masm,
static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver,
Register key, Register elements,
Register scratch1, Register scratch2,
Register result, Label* slow,
LanguageMode language_mode) {
Register result, Label* slow) {
// Register use:
//
// receiver - holds the receiver on entry.
@ -215,12 +214,8 @@ static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver,
__ Branch(&check_next_prototype);
__ bind(&absent);
if (is_strong(language_mode)) {
__ Branch(slow);
} else {
__ LoadRoot(result, Heap::kUndefinedValueRootIndex);
__ Branch(&done);
}
__ LoadRoot(result, Heap::kUndefinedValueRootIndex);
__ Branch(&done);
__ bind(&in_bounds);
// Fast case: Do the load.
@ -269,8 +264,7 @@ static void GenerateKeyNameCheck(MacroAssembler* masm, Register key,
__ bind(&unique);
}
void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) {
void LoadIC::GenerateNormal(MacroAssembler* masm) {
Register dictionary = a0;
DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister()));
DCHECK(!dictionary.is(LoadDescriptor::NameRegister()));
@ -284,7 +278,7 @@ void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) {
// Dictionary load failed, go slow (but don't miss).
__ bind(&slow);
GenerateRuntimeGetProperty(masm, language_mode);
GenerateRuntimeGetProperty(masm);
}
@ -316,17 +310,14 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kLoadIC_Miss);
}
void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
LanguageMode language_mode) {
void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
// The return address is in ra.
__ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister());
__ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister());
// Do tail-call to runtime routine.
__ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong
: Runtime::kGetProperty);
__ TailCallRuntime(Runtime::kGetProperty);
}
@ -344,21 +335,16 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kKeyedLoadIC_Miss);
}
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
LanguageMode language_mode) {
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
// The return address is in ra.
__ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister());
// Do tail-call to runtime routine.
__ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong
: Runtime::kKeyedGetProperty);
__ TailCallRuntime(Runtime::kKeyedGetProperty);
}
void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm,
LanguageMode language_mode) {
void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm) {
// The return address is in ra.
Label slow, check_name, index_smi, index_name, property_array_property;
Label probe_dictionary, check_number_dictionary;
@ -382,8 +368,7 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm,
// Check the receiver's map to see if it has fast elements.
__ CheckFastElements(a0, a3, &check_number_dictionary);
GenerateFastArrayLoad(masm, receiver, key, a0, a3, a4, v0, &slow,
language_mode);
GenerateFastArrayLoad(masm, receiver, key, a0, a3, a4, v0, &slow);
__ IncrementCounter(isolate->counters()->ic_keyed_load_generic_smi(), 1, a4,
a3);
__ Ret();
@ -405,7 +390,7 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm,
__ bind(&slow);
__ IncrementCounter(isolate->counters()->ic_keyed_load_generic_slow(), 1, a4,
a3);
GenerateRuntimeGetProperty(masm, language_mode);
GenerateRuntimeGetProperty(masm);
__ bind(&check_name);
GenerateKeyNameCheck(masm, key, a0, a3, &index_name, &slow);

View File

@ -163,8 +163,7 @@ static void GenerateKeyedLoadReceiverCheck(MacroAssembler* masm,
static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver,
Register key, Register elements,
Register scratch1, Register scratch2,
Register result, Label* slow,
LanguageMode language_mode) {
Register result, Label* slow) {
// Register use:
//
// receiver - holds the receiver on entry.
@ -221,13 +220,8 @@ static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver,
__ jmp(&check_next_prototype);
__ bind(&absent);
if (is_strong(language_mode)) {
// Strong mode accesses must throw in this case, so call the runtime.
__ jmp(slow);
} else {
__ LoadRoot(result, Heap::kUndefinedValueRootIndex);
__ jmp(&done);
}
__ LoadRoot(result, Heap::kUndefinedValueRootIndex);
__ jmp(&done);
__ bind(&in_bounds);
// Fast case: Do the load.
@ -274,8 +268,7 @@ static void GenerateKeyNameCheck(MacroAssembler* masm, Register key,
__ bind(&unique);
}
void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) {
void LoadIC::GenerateNormal(MacroAssembler* masm) {
Register dictionary = r3;
DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister()));
DCHECK(!dictionary.is(LoadDescriptor::NameRegister()));
@ -290,7 +283,7 @@ void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) {
// Dictionary load failed, go slow (but don't miss).
__ bind(&slow);
GenerateRuntimeGetProperty(masm, language_mode);
GenerateRuntimeGetProperty(masm);
}
@ -322,17 +315,14 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kLoadIC_Miss);
}
void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
LanguageMode language_mode) {
void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
// The return address is in lr.
__ mr(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister());
__ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister());
// Do tail-call to runtime routine.
__ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong
: Runtime::kGetProperty);
__ TailCallRuntime(Runtime::kGetProperty);
}
@ -350,21 +340,16 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kKeyedLoadIC_Miss);
}
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
LanguageMode language_mode) {
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
// The return address is in lr.
__ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister());
// Do tail-call to runtime routine.
__ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong
: Runtime::kKeyedGetProperty);
__ TailCallRuntime(Runtime::kKeyedGetProperty);
}
void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm,
LanguageMode language_mode) {
void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm) {
// The return address is in lr.
Label slow, check_name, index_smi, index_name, property_array_property;
Label probe_dictionary, check_number_dictionary;
@ -388,8 +373,7 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm,
// Check the receiver's map to see if it has fast elements.
__ CheckFastElements(r3, r6, &check_number_dictionary);
GenerateFastArrayLoad(masm, receiver, key, r3, r6, r7, r3, &slow,
language_mode);
GenerateFastArrayLoad(masm, receiver, key, r3, r6, r7, r3, &slow);
__ IncrementCounter(isolate->counters()->ic_keyed_load_generic_smi(), 1, r7,
r6);
__ Ret();
@ -412,7 +396,7 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm,
__ bind(&slow);
__ IncrementCounter(isolate->counters()->ic_keyed_load_generic_slow(), 1, r7,
r6);
GenerateRuntimeGetProperty(masm, language_mode);
GenerateRuntimeGetProperty(masm);
__ bind(&check_name);
GenerateKeyNameCheck(masm, key, r3, r6, &index_name, &slow);

View File

@ -167,7 +167,7 @@ static void GenerateKeyedLoadReceiverCheck(MacroAssembler* masm,
static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver,
Register key, Register elements,
Register scratch, Register result,
Label* slow, LanguageMode language_mode) {
Label* slow) {
// Register use:
//
// receiver - holds the receiver on entry.
@ -222,13 +222,8 @@ static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver,
__ jmp(&check_next_prototype);
__ bind(&absent);
if (is_strong(language_mode)) {
// Strong mode accesses must throw in this case, so call the runtime.
__ jmp(slow);
} else {
__ LoadRoot(result, Heap::kUndefinedValueRootIndex);
__ jmp(&done);
}
__ LoadRoot(result, Heap::kUndefinedValueRootIndex);
__ jmp(&done);
__ bind(&in_bounds);
// Fast case: Do the load.
@ -274,9 +269,7 @@ static void GenerateKeyNameCheck(MacroAssembler* masm, Register key,
__ bind(&unique);
}
void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm,
LanguageMode language_mode) {
void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm) {
// The return address is on the stack.
Label slow, check_name, index_smi, index_name, property_array_property;
Label probe_dictionary, check_number_dictionary;
@ -298,8 +291,7 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm,
// Check the receiver's map to see if it has fast elements.
__ CheckFastElements(rax, &check_number_dictionary);
GenerateFastArrayLoad(masm, receiver, key, rax, rbx, rax, &slow,
language_mode);
GenerateFastArrayLoad(masm, receiver, key, rax, rbx, rax, &slow);
Counters* counters = masm->isolate()->counters();
__ IncrementCounter(counters->ic_keyed_load_generic_smi(), 1);
__ ret(0);
@ -320,7 +312,7 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm,
__ bind(&slow);
// Slow case: Jump to runtime.
__ IncrementCounter(counters->ic_keyed_load_generic_slow(), 1);
KeyedLoadIC::GenerateRuntimeGetProperty(masm, language_mode);
KeyedLoadIC::GenerateRuntimeGetProperty(masm);
__ bind(&check_name);
GenerateKeyNameCheck(masm, key, rax, rbx, &index_name, &slow);
@ -626,8 +618,7 @@ void KeyedStoreIC::GenerateMegamorphic(MacroAssembler* masm,
GenerateMiss(masm);
}
void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) {
void LoadIC::GenerateNormal(MacroAssembler* masm) {
Register dictionary = rax;
DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister()));
DCHECK(!dictionary.is(LoadDescriptor::NameRegister()));
@ -642,7 +633,7 @@ void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) {
// Dictionary load failed, go slow (but don't miss).
__ bind(&slow);
LoadIC::GenerateRuntimeGetProperty(masm, language_mode);
LoadIC::GenerateRuntimeGetProperty(masm);
}
@ -675,9 +666,7 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kLoadIC_Miss);
}
void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
LanguageMode language_mode) {
void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
// The return address is on the stack.
Register receiver = LoadDescriptor::ReceiverRegister();
Register name = LoadDescriptor::NameRegister();
@ -690,8 +679,7 @@ void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
__ PushReturnAddressFrom(rbx);
// Do tail-call to runtime routine.
__ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong
: Runtime::kGetProperty);
__ TailCallRuntime(Runtime::kGetProperty);
}
@ -706,9 +694,7 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kKeyedLoadIC_Miss);
}
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
LanguageMode language_mode) {
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
// The return address is on the stack.
Register receiver = LoadDescriptor::ReceiverRegister();
Register name = LoadDescriptor::NameRegister();
@ -721,8 +707,7 @@ void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
__ PushReturnAddressFrom(rbx);
// Do tail-call to runtime routine.
__ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong
: Runtime::kKeyedGetProperty);
__ TailCallRuntime(Runtime::kKeyedGetProperty);
}

View File

@ -167,7 +167,7 @@ static void GenerateKeyedLoadReceiverCheck(MacroAssembler* masm,
static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver,
Register key, Register scratch,
Register scratch2, Register result,
Label* slow, LanguageMode language_mode) {
Label* slow) {
// Register use:
// receiver - holds the receiver and is unchanged.
// key - holds the key and is unchanged (must be a smi).
@ -211,13 +211,8 @@ static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver,
__ jmp(&check_next_prototype);
__ bind(&absent);
if (is_strong(language_mode)) {
// Strong mode accesses must throw in this case, so call the runtime.
__ jmp(slow);
} else {
__ mov(result, masm->isolate()->factory()->undefined_value());
__ jmp(&done);
}
__ mov(result, masm->isolate()->factory()->undefined_value());
__ jmp(&done);
__ bind(&in_bounds);
// Fast case: Do the load.
@ -262,9 +257,7 @@ static void GenerateKeyNameCheck(MacroAssembler* masm, Register key,
__ bind(&unique);
}
void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm,
LanguageMode language_mode) {
void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm) {
// The return address is on the stack.
Label slow, check_name, index_smi, index_name, property_array_property;
Label probe_dictionary, check_number_dictionary;
@ -286,8 +279,7 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm,
// Check the receiver's map to see if it has fast elements.
__ CheckFastElements(eax, &check_number_dictionary);
GenerateFastArrayLoad(masm, receiver, key, eax, ebx, eax, &slow,
language_mode);
GenerateFastArrayLoad(masm, receiver, key, eax, ebx, eax, &slow);
Isolate* isolate = masm->isolate();
Counters* counters = isolate->counters();
__ IncrementCounter(counters->ic_keyed_load_generic_smi(), 1);
@ -319,7 +311,7 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm,
__ bind(&slow);
// Slow case: jump to runtime.
__ IncrementCounter(counters->ic_keyed_load_generic_slow(), 1);
GenerateRuntimeGetProperty(masm, language_mode);
GenerateRuntimeGetProperty(masm);
__ bind(&check_name);
GenerateKeyNameCheck(masm, key, eax, ebx, &index_name, &slow);
@ -628,8 +620,7 @@ void KeyedStoreIC::GenerateMegamorphic(MacroAssembler* masm,
GenerateMiss(masm);
}
void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) {
void LoadIC::GenerateNormal(MacroAssembler* masm) {
Register dictionary = eax;
DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister()));
DCHECK(!dictionary.is(LoadDescriptor::NameRegister()));
@ -644,7 +635,7 @@ void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) {
// Dictionary load failed, go slow (but don't miss).
__ bind(&slow);
GenerateRuntimeGetProperty(masm, language_mode);
GenerateRuntimeGetProperty(masm);
}
@ -675,9 +666,7 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kLoadIC_Miss);
}
void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
LanguageMode language_mode) {
void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
// Return address is on the stack.
Register receiver = LoadDescriptor::ReceiverRegister();
Register name = LoadDescriptor::NameRegister();
@ -689,8 +678,7 @@ void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
__ push(ebx);
// Do tail-call to runtime routine.
__ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong
: Runtime::kGetProperty);
__ TailCallRuntime(Runtime::kGetProperty);
}
@ -704,9 +692,7 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kKeyedLoadIC_Miss);
}
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
LanguageMode language_mode) {
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
// Return address is on the stack.
Register receiver = LoadDescriptor::ReceiverRegister();
Register name = LoadDescriptor::NameRegister();
@ -718,8 +704,7 @@ void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
__ push(ebx);
// Do tail-call to runtime routine.
__ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong
: Runtime::kKeyedGetProperty);
__ TailCallRuntime(Runtime::kKeyedGetProperty);
}

View File

@ -364,11 +364,10 @@ void BytecodeArrayBuilder::MoveRegisterUntranslated(Register from,
}
BytecodeArrayBuilder& BytecodeArrayBuilder::LoadGlobal(
const Handle<String> name, int feedback_slot, LanguageMode language_mode,
TypeofMode typeof_mode) {
// TODO(rmcilroy): Potentially store language and typeof information in an
const Handle<String> name, int feedback_slot, TypeofMode typeof_mode) {
// TODO(rmcilroy): Potentially store typeof information in an
// operand rather than having extra bytecodes.
Bytecode bytecode = BytecodeForLoadGlobal(language_mode, typeof_mode);
Bytecode bytecode = BytecodeForLoadGlobal(typeof_mode);
size_t name_index = GetConstantPoolEntry(name);
if (FitsInIdx8Operand(name_index) && FitsInIdx8Operand(feedback_slot)) {
Output(bytecode, static_cast<uint8_t>(name_index),
@ -468,16 +467,15 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::StoreLookupSlot(
}
BytecodeArrayBuilder& BytecodeArrayBuilder::LoadNamedProperty(
Register object, const Handle<Name> name, int feedback_slot,
LanguageMode language_mode) {
Bytecode bytecode = BytecodeForLoadIC(language_mode);
Register object, const Handle<Name> name, int feedback_slot) {
size_t name_index = GetConstantPoolEntry(name);
if (FitsInIdx8Operand(name_index) && FitsInIdx8Operand(feedback_slot)) {
Output(bytecode, object.ToRawOperand(), static_cast<uint8_t>(name_index),
Output(Bytecode::kLoadIC, object.ToRawOperand(),
static_cast<uint8_t>(name_index),
static_cast<uint8_t>(feedback_slot));
} else if (FitsInIdx16Operand(name_index) &&
FitsInIdx16Operand(feedback_slot)) {
Output(BytecodeForWideOperands(bytecode), object.ToRawOperand(),
Output(Bytecode::kLoadICWide, object.ToRawOperand(),
static_cast<uint16_t>(name_index),
static_cast<uint16_t>(feedback_slot));
} else {
@ -486,15 +484,13 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::LoadNamedProperty(
return *this;
}
BytecodeArrayBuilder& BytecodeArrayBuilder::LoadKeyedProperty(
Register object, int feedback_slot, LanguageMode language_mode) {
Bytecode bytecode = BytecodeForKeyedLoadIC(language_mode);
Register object, int feedback_slot) {
if (FitsInIdx8Operand(feedback_slot)) {
Output(bytecode, object.ToRawOperand(),
Output(Bytecode::kKeyedLoadIC, object.ToRawOperand(),
static_cast<uint8_t>(feedback_slot));
} else if (FitsInIdx16Operand(feedback_slot)) {
Output(BytecodeForWideOperands(bytecode), object.ToRawOperand(),
Output(Bytecode::kKeyedLoadICWide, object.ToRawOperand(),
static_cast<uint16_t>(feedback_slot));
} else {
UNIMPLEMENTED();
@ -1429,14 +1425,10 @@ Bytecode BytecodeArrayBuilder::BytecodeForCompareOperation(Token::Value op) {
// static
Bytecode BytecodeArrayBuilder::BytecodeForWideOperands(Bytecode bytecode) {
switch (bytecode) {
case Bytecode::kLoadICSloppy:
return Bytecode::kLoadICSloppyWide;
case Bytecode::kLoadICStrict:
return Bytecode::kLoadICStrictWide;
case Bytecode::kKeyedLoadICSloppy:
return Bytecode::kKeyedLoadICSloppyWide;
case Bytecode::kKeyedLoadICStrict:
return Bytecode::kKeyedLoadICStrictWide;
case Bytecode::kLoadIC:
return Bytecode::kLoadICWide;
case Bytecode::kKeyedLoadIC:
return Bytecode::kKeyedLoadICWide;
case Bytecode::kStoreICSloppy:
return Bytecode::kStoreICSloppyWide;
case Bytecode::kStoreICStrict:
@ -1445,14 +1437,10 @@ Bytecode BytecodeArrayBuilder::BytecodeForWideOperands(Bytecode bytecode) {
return Bytecode::kKeyedStoreICSloppyWide;
case Bytecode::kKeyedStoreICStrict:
return Bytecode::kKeyedStoreICStrictWide;
case Bytecode::kLdaGlobalSloppy:
return Bytecode::kLdaGlobalSloppyWide;
case Bytecode::kLdaGlobalStrict:
return Bytecode::kLdaGlobalStrictWide;
case Bytecode::kLdaGlobalInsideTypeofSloppy:
return Bytecode::kLdaGlobalInsideTypeofSloppyWide;
case Bytecode::kLdaGlobalInsideTypeofStrict:
return Bytecode::kLdaGlobalInsideTypeofStrictWide;
case Bytecode::kLdaGlobal:
return Bytecode::kLdaGlobalWide;
case Bytecode::kLdaGlobalInsideTypeof:
return Bytecode::kLdaGlobalInsideTypeofWide;
case Bytecode::kStaGlobalSloppy:
return Bytecode::kStaGlobalSloppyWide;
case Bytecode::kStaGlobalStrict:
@ -1472,39 +1460,6 @@ Bytecode BytecodeArrayBuilder::BytecodeForWideOperands(Bytecode bytecode) {
}
// static
Bytecode BytecodeArrayBuilder::BytecodeForLoadIC(LanguageMode language_mode) {
switch (language_mode) {
case SLOPPY:
return Bytecode::kLoadICSloppy;
case STRICT:
return Bytecode::kLoadICStrict;
case STRONG:
UNIMPLEMENTED();
default:
UNREACHABLE();
}
return static_cast<Bytecode>(-1);
}
// static
Bytecode BytecodeArrayBuilder::BytecodeForKeyedLoadIC(
LanguageMode language_mode) {
switch (language_mode) {
case SLOPPY:
return Bytecode::kKeyedLoadICSloppy;
case STRICT:
return Bytecode::kKeyedLoadICStrict;
case STRONG:
UNIMPLEMENTED();
default:
UNREACHABLE();
}
return static_cast<Bytecode>(-1);
}
// static
Bytecode BytecodeArrayBuilder::BytecodeForStoreIC(LanguageMode language_mode) {
switch (language_mode) {
@ -1539,23 +1494,9 @@ Bytecode BytecodeArrayBuilder::BytecodeForKeyedStoreIC(
// static
Bytecode BytecodeArrayBuilder::BytecodeForLoadGlobal(LanguageMode language_mode,
TypeofMode typeof_mode) {
switch (language_mode) {
case SLOPPY:
return typeof_mode == INSIDE_TYPEOF
? Bytecode::kLdaGlobalInsideTypeofSloppy
: Bytecode::kLdaGlobalSloppy;
case STRICT:
return typeof_mode == INSIDE_TYPEOF
? Bytecode::kLdaGlobalInsideTypeofStrict
: Bytecode::kLdaGlobalStrict;
case STRONG:
UNIMPLEMENTED();
default:
UNREACHABLE();
}
return static_cast<Bytecode>(-1);
Bytecode BytecodeArrayBuilder::BytecodeForLoadGlobal(TypeofMode typeof_mode) {
return typeof_mode == INSIDE_TYPEOF ? Bytecode::kLdaGlobalInsideTypeof
: Bytecode::kLdaGlobal;
}

View File

@ -93,7 +93,6 @@ class BytecodeArrayBuilder final : public ZoneObject, private RegisterMover {
// Global loads to the accumulator and stores from the accumulator.
BytecodeArrayBuilder& LoadGlobal(const Handle<String> name, int feedback_slot,
LanguageMode language_mode,
TypeofMode typeof_mode);
BytecodeArrayBuilder& StoreGlobal(const Handle<String> name,
int feedback_slot,
@ -115,11 +114,9 @@ class BytecodeArrayBuilder final : public ZoneObject, private RegisterMover {
// Named load property.
BytecodeArrayBuilder& LoadNamedProperty(Register object,
const Handle<Name> name,
int feedback_slot,
LanguageMode language_mode);
int feedback_slot);
// Keyed load property. The key should be in the accumulator.
BytecodeArrayBuilder& LoadKeyedProperty(Register object, int feedback_slot,
LanguageMode language_mode);
BytecodeArrayBuilder& LoadKeyedProperty(Register object, int feedback_slot);
// Store properties. The value to be stored should be in the accumulator.
BytecodeArrayBuilder& StoreNamedProperty(Register object,
@ -276,12 +273,9 @@ class BytecodeArrayBuilder final : public ZoneObject, private RegisterMover {
static Bytecode BytecodeForCountOperation(Token::Value op);
static Bytecode BytecodeForCompareOperation(Token::Value op);
static Bytecode BytecodeForWideOperands(Bytecode bytecode);
static Bytecode BytecodeForLoadIC(LanguageMode language_mode);
static Bytecode BytecodeForKeyedLoadIC(LanguageMode language_mode);
static Bytecode BytecodeForStoreIC(LanguageMode language_mode);
static Bytecode BytecodeForKeyedStoreIC(LanguageMode language_mode);
static Bytecode BytecodeForLoadGlobal(LanguageMode language_mode,
TypeofMode typeof_mode);
static Bytecode BytecodeForLoadGlobal(TypeofMode typeof_mode);
static Bytecode BytecodeForStoreGlobal(LanguageMode language_mode);
static Bytecode BytecodeForStoreLookupSlot(LanguageMode language_mode);
static Bytecode BytecodeForCreateArguments(CreateArgumentsType type);

View File

@ -1312,7 +1312,7 @@ void BytecodeGenerator::VisitClassLiteralContents(ClassLiteral* expr) {
FeedbackVectorSlot slot = expr->PrototypeSlot();
builder()
->StoreAccumulatorInRegister(literal)
.LoadNamedProperty(literal, name, feedback_index(slot), language_mode())
.LoadNamedProperty(literal, name, feedback_index(slot))
.StoreAccumulatorInRegister(prototype);
VisitClassLiteralProperties(expr, literal, prototype);
@ -1781,7 +1781,7 @@ void BytecodeGenerator::VisitVariableLoad(Variable* variable,
case VariableLocation::GLOBAL:
case VariableLocation::UNALLOCATED: {
builder()->LoadGlobal(variable->name(), feedback_index(slot),
language_mode(), typeof_mode);
typeof_mode);
execution_result()->SetResultInAccumulator();
break;
}
@ -1864,20 +1864,15 @@ void BytecodeGenerator::PrepareKeyedSuperPropertyArguments(
void BytecodeGenerator::BuildNamedSuperPropertyLoad(
SuperPropertyArguments* super_args) {
builder()
->LoadLiteral(Smi::FromInt(static_cast<int>(language_mode())))
.StoreAccumulatorInRegister(super_args->language_mode());
builder()->CallRuntime(Runtime::kLoadFromSuper, super_args->receiver(),
super_args->count());
// TODO(oth): Abstraction not suitable for 3 args, will over-allocate regs.
builder()->CallRuntime(Runtime::kLoadFromSuper, super_args->receiver(), 3);
}
void BytecodeGenerator::BuildKeyedSuperPropertyLoad(
SuperPropertyArguments* super_args) {
builder()
->LoadLiteral(Smi::FromInt(static_cast<int>(language_mode())))
.StoreAccumulatorInRegister(super_args->language_mode());
// TODO(oth): Abstraction not suitable for 3 args, will over-allocate regs.
builder()->CallRuntime(Runtime::kLoadKeyedFromSuper, super_args->receiver(),
super_args->count());
3);
}
void BytecodeGenerator::BuildNamedSuperPropertyStore(
@ -2168,8 +2163,7 @@ void BytecodeGenerator::VisitAssignment(Assignment* expr) {
FeedbackVectorSlot slot = property->PropertyFeedbackSlot();
old_value = register_allocator()->NewRegister();
builder()
->LoadNamedProperty(object, name, feedback_index(slot),
language_mode())
->LoadNamedProperty(object, name, feedback_index(slot))
.StoreAccumulatorInRegister(old_value);
break;
}
@ -2179,7 +2173,7 @@ void BytecodeGenerator::VisitAssignment(Assignment* expr) {
FeedbackVectorSlot slot = property->PropertyFeedbackSlot();
old_value = register_allocator()->NewRegister();
builder()
->LoadKeyedProperty(object, feedback_index(slot), language_mode())
->LoadKeyedProperty(object, feedback_index(slot))
.StoreAccumulatorInRegister(old_value);
break;
}
@ -2256,12 +2250,12 @@ void BytecodeGenerator::VisitPropertyLoad(Register obj, Property* expr) {
case NAMED_PROPERTY: {
builder()->LoadNamedProperty(obj,
expr->key()->AsLiteral()->AsPropertyName(),
feedback_index(slot), language_mode());
feedback_index(slot));
break;
}
case KEYED_PROPERTY: {
VisitForAccumulatorValue(expr->key());
builder()->LoadKeyedProperty(obj, feedback_index(slot), language_mode());
builder()->LoadKeyedProperty(obj, feedback_index(slot));
break;
}
case NAMED_SUPER_PROPERTY:
@ -2680,8 +2674,7 @@ void BytecodeGenerator::VisitCountOperation(CountOperation* expr) {
FeedbackVectorSlot slot = property->PropertyFeedbackSlot();
object = VisitForRegisterValue(property->obj());
name = property->key()->AsLiteral()->AsPropertyName();
builder()->LoadNamedProperty(object, name, feedback_index(slot),
language_mode());
builder()->LoadNamedProperty(object, name, feedback_index(slot));
break;
}
case KEYED_PROPERTY: {
@ -2692,7 +2685,7 @@ void BytecodeGenerator::VisitCountOperation(CountOperation* expr) {
key = register_allocator()->NewRegister();
VisitForAccumulatorValue(property->key());
builder()->StoreAccumulatorInRegister(key).LoadKeyedProperty(
object, feedback_index(slot), language_mode());
object, feedback_index(slot));
break;
}
case NAMED_SUPER_PROPERTY: {

View File

@ -75,14 +75,10 @@ namespace interpreter {
V(LdaConstantWide, OperandType::kIdx16) \
\
/* Globals */ \
V(LdaGlobalSloppy, OperandType::kIdx8, OperandType::kIdx8) \
V(LdaGlobalStrict, OperandType::kIdx8, OperandType::kIdx8) \
V(LdaGlobalInsideTypeofSloppy, OperandType::kIdx8, OperandType::kIdx8) \
V(LdaGlobalInsideTypeofStrict, OperandType::kIdx8, OperandType::kIdx8) \
V(LdaGlobalSloppyWide, OperandType::kIdx16, OperandType::kIdx16) \
V(LdaGlobalStrictWide, OperandType::kIdx16, OperandType::kIdx16) \
V(LdaGlobalInsideTypeofSloppyWide, OperandType::kIdx16, OperandType::kIdx16) \
V(LdaGlobalInsideTypeofStrictWide, OperandType::kIdx16, OperandType::kIdx16) \
V(LdaGlobal, OperandType::kIdx8, OperandType::kIdx8) \
V(LdaGlobalInsideTypeof, OperandType::kIdx8, OperandType::kIdx8) \
V(LdaGlobalWide, OperandType::kIdx16, OperandType::kIdx16) \
V(LdaGlobalInsideTypeofWide, OperandType::kIdx16, OperandType::kIdx16) \
V(StaGlobalSloppy, OperandType::kIdx8, OperandType::kIdx8) \
V(StaGlobalStrict, OperandType::kIdx8, OperandType::kIdx8) \
V(StaGlobalSloppyWide, OperandType::kIdx16, OperandType::kIdx16) \
@ -115,16 +111,10 @@ namespace interpreter {
V(MovWide, OperandType::kReg16, OperandType::kRegOut16) \
\
/* LoadIC operations */ \
V(LoadICSloppy, OperandType::kReg8, OperandType::kIdx8, OperandType::kIdx8) \
V(LoadICStrict, OperandType::kReg8, OperandType::kIdx8, OperandType::kIdx8) \
V(KeyedLoadICSloppy, OperandType::kReg8, OperandType::kIdx8) \
V(KeyedLoadICStrict, OperandType::kReg8, OperandType::kIdx8) \
V(LoadICSloppyWide, OperandType::kReg8, OperandType::kIdx16, \
OperandType::kIdx16) \
V(LoadICStrictWide, OperandType::kReg8, OperandType::kIdx16, \
OperandType::kIdx16) \
V(KeyedLoadICSloppyWide, OperandType::kReg8, OperandType::kIdx16) \
V(KeyedLoadICStrictWide, OperandType::kReg8, OperandType::kIdx16) \
V(LoadIC, OperandType::kReg8, OperandType::kIdx8, OperandType::kIdx8) \
V(KeyedLoadIC, OperandType::kReg8, OperandType::kIdx8) \
V(LoadICWide, OperandType::kReg8, OperandType::kIdx16, OperandType::kIdx16) \
V(KeyedLoadICWide, OperandType::kReg8, OperandType::kIdx16) \
\
/* StoreIC operations */ \
V(StoreICSloppy, OperandType::kReg8, OperandType::kIdx8, OperandType::kIdx8) \

View File

@ -263,98 +263,47 @@ void Interpreter::DoLoadGlobal(Callable ic, InterpreterAssembler* assembler) {
__ Dispatch();
}
// LdaGlobalSloppy <name_index> <slot>
// LdaGlobal <name_index> <slot>
//
// Load the global with name in constant pool entry <name_index> into the
// accumulator using FeedBackVector slot <slot> in sloppy mode.
void Interpreter::DoLdaGlobalSloppy(InterpreterAssembler* assembler) {
// accumulator using FeedBackVector slot <slot> outside of a typeof.
void Interpreter::DoLdaGlobal(InterpreterAssembler* assembler) {
Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF,
SLOPPY, UNINITIALIZED);
UNINITIALIZED);
DoLoadGlobal(ic, assembler);
}
// LdaGlobalSloppy <name_index> <slot>
// LdaGlobalInsideTypeof <name_index> <slot>
//
// Load the global with name in constant pool entry <name_index> into the
// accumulator using FeedBackVector slot <slot> in strict mode.
void Interpreter::DoLdaGlobalStrict(InterpreterAssembler* assembler) {
// accumulator using FeedBackVector slot <slot> inside of a typeof.
void Interpreter::DoLdaGlobalInsideTypeof(InterpreterAssembler* assembler) {
Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, INSIDE_TYPEOF,
UNINITIALIZED);
DoLoadGlobal(ic, assembler);
}
// LdaGlobalWide <name_index> <slot>
//
// Load the global with name in constant pool entry <name_index> into the
// accumulator using FeedBackVector slot <slot> outside of a typeof.
void Interpreter::DoLdaGlobalWide(InterpreterAssembler* assembler) {
Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF,
STRICT, UNINITIALIZED);
UNINITIALIZED);
DoLoadGlobal(ic, assembler);
}
// LdaGlobalInsideTypeofSloppy <name_index> <slot>
// LdaGlobalInsideTypeofWide <name_index> <slot>
//
// Load the global with name in constant pool entry <name_index> into the
// accumulator using FeedBackVector slot <slot> in sloppy mode.
void Interpreter::DoLdaGlobalInsideTypeofSloppy(
InterpreterAssembler* assembler) {
// accumulator using FeedBackVector slot <slot> inside of a typeof.
void Interpreter::DoLdaGlobalInsideTypeofWide(InterpreterAssembler* assembler) {
Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, INSIDE_TYPEOF,
SLOPPY, UNINITIALIZED);
UNINITIALIZED);
DoLoadGlobal(ic, assembler);
}
// LdaGlobalInsideTypeofStrict <name_index> <slot>
//
// Load the global with name in constant pool entry <name_index> into the
// accumulator using FeedBackVector slot <slot> in strict mode.
void Interpreter::DoLdaGlobalInsideTypeofStrict(
InterpreterAssembler* assembler) {
Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, INSIDE_TYPEOF,
STRICT, UNINITIALIZED);
DoLoadGlobal(ic, assembler);
}
// LdaGlobalSloppyWide <name_index> <slot>
//
// Load the global with name in constant pool entry <name_index> into the
// accumulator using FeedBackVector slot <slot> in sloppy mode.
void Interpreter::DoLdaGlobalSloppyWide(InterpreterAssembler* assembler) {
Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF,
SLOPPY, UNINITIALIZED);
DoLoadGlobal(ic, assembler);
}
// LdaGlobalSloppyWide <name_index> <slot>
//
// Load the global with name in constant pool entry <name_index> into the
// accumulator using FeedBackVector slot <slot> in strict mode.
void Interpreter::DoLdaGlobalStrictWide(InterpreterAssembler* assembler) {
Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF,
STRICT, UNINITIALIZED);
DoLoadGlobal(ic, assembler);
}
// LdaGlobalInsideTypeofSloppyWide <name_index> <slot>
//
// Load the global with name in constant pool entry <name_index> into the
// accumulator using FeedBackVector slot <slot> in sloppy mode.
void Interpreter::DoLdaGlobalInsideTypeofSloppyWide(
InterpreterAssembler* assembler) {
Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, INSIDE_TYPEOF,
SLOPPY, UNINITIALIZED);
DoLoadGlobal(ic, assembler);
}
// LdaGlobalInsideTypeofSloppyWide <name_index> <slot>
//
// Load the global with name in constant pool entry <name_index> into the
// accumulator using FeedBackVector slot <slot> in strict mode.
void Interpreter::DoLdaGlobalInsideTypeofStrictWide(
InterpreterAssembler* assembler) {
Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, INSIDE_TYPEOF,
STRICT, UNINITIALIZED);
DoLoadGlobal(ic, assembler);
}
void Interpreter::DoStoreGlobal(Callable ic, InterpreterAssembler* assembler) {
// Get the global object.
Node* context = __ GetContext();
@ -575,50 +524,27 @@ void Interpreter::DoLoadIC(Callable ic, InterpreterAssembler* assembler) {
__ Dispatch();
}
// LoadICSloppy <object> <name_index> <slot>
// LoadIC <object> <name_index> <slot>
//
// Calls the sloppy mode LoadIC at FeedBackVector slot <slot> for <object> and
// the name at constant pool entry <name_index>.
void Interpreter::DoLoadICSloppy(InterpreterAssembler* assembler) {
// Calls the LoadIC at FeedBackVector slot <slot> for <object> and the name at
// constant pool entry <name_index>.
void Interpreter::DoLoadIC(InterpreterAssembler* assembler) {
Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF,
SLOPPY, UNINITIALIZED);
UNINITIALIZED);
DoLoadIC(ic, assembler);
}
// LoadICStrict <object> <name_index> <slot>
// LoadICWide <object> <name_index> <slot>
//
// Calls the sloppy mode LoadIC at FeedBackVector slot <slot> for <object> and
// the name at constant pool entry <name_index>.
void Interpreter::DoLoadICStrict(InterpreterAssembler* assembler) {
// Calls the LoadIC at FeedBackVector slot <slot> for <object> and the name at
// constant pool entry <name_index>.
void Interpreter::DoLoadICWide(InterpreterAssembler* assembler) {
Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF,
STRICT, UNINITIALIZED);
UNINITIALIZED);
DoLoadIC(ic, assembler);
}
// LoadICSloppyWide <object> <name_index> <slot>
//
// Calls the sloppy mode LoadIC at FeedBackVector slot <slot> for <object> and
// the name at constant pool entry <name_index>.
void Interpreter::DoLoadICSloppyWide(InterpreterAssembler* assembler) {
Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF,
SLOPPY, UNINITIALIZED);
DoLoadIC(ic, assembler);
}
// LoadICStrictWide <object> <name_index> <slot>
//
// Calls the sloppy mode LoadIC at FeedBackVector slot <slot> for <object> and
// the name at constant pool entry <name_index>.
void Interpreter::DoLoadICStrictWide(InterpreterAssembler* assembler) {
Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF,
STRICT, UNINITIALIZED);
DoLoadIC(ic, assembler);
}
void Interpreter::DoKeyedLoadIC(Callable ic, InterpreterAssembler* assembler) {
Node* code_target = __ HeapConstant(ic.code());
Node* reg_index = __ BytecodeOperandReg(0);
@ -634,50 +560,27 @@ void Interpreter::DoKeyedLoadIC(Callable ic, InterpreterAssembler* assembler) {
__ Dispatch();
}
// KeyedLoadICSloppy <object> <slot>
// KeyedLoadIC <object> <slot>
//
// Calls the sloppy mode KeyedLoadIC at FeedBackVector slot <slot> for <object>
// and the key in the accumulator.
void Interpreter::DoKeyedLoadICSloppy(InterpreterAssembler* assembler) {
// Calls the KeyedLoadIC at FeedBackVector slot <slot> for <object> and the key
// in the accumulator.
void Interpreter::DoKeyedLoadIC(InterpreterAssembler* assembler) {
Callable ic =
CodeFactory::KeyedLoadICInOptimizedCode(isolate_, SLOPPY, UNINITIALIZED);
CodeFactory::KeyedLoadICInOptimizedCode(isolate_, UNINITIALIZED);
DoKeyedLoadIC(ic, assembler);
}
// KeyedLoadICStrict <object> <slot>
// KeyedLoadICWide <object> <slot>
//
// Calls the strict mode KeyedLoadIC at FeedBackVector slot <slot> for <object>
// and the key in the accumulator.
void Interpreter::DoKeyedLoadICStrict(InterpreterAssembler* assembler) {
// Calls the KeyedLoadIC at FeedBackVector slot <slot> for <object> and the key
// in the accumulator.
void Interpreter::DoKeyedLoadICWide(InterpreterAssembler* assembler) {
Callable ic =
CodeFactory::KeyedLoadICInOptimizedCode(isolate_, STRICT, UNINITIALIZED);
CodeFactory::KeyedLoadICInOptimizedCode(isolate_, UNINITIALIZED);
DoKeyedLoadIC(ic, assembler);
}
// KeyedLoadICSloppyWide <object> <slot>
//
// Calls the sloppy mode KeyedLoadIC at FeedBackVector slot <slot> for <object>
// and the key in the accumulator.
void Interpreter::DoKeyedLoadICSloppyWide(InterpreterAssembler* assembler) {
Callable ic =
CodeFactory::KeyedLoadICInOptimizedCode(isolate_, SLOPPY, UNINITIALIZED);
DoKeyedLoadIC(ic, assembler);
}
// KeyedLoadICStrictWide <object> <slot>
//
// Calls the strict mode KeyedLoadIC at FeedBackVector slot <slot> for <object>
// and the key in the accumulator.
void Interpreter::DoKeyedLoadICStrictWide(InterpreterAssembler* assembler) {
Callable ic =
CodeFactory::KeyedLoadICInOptimizedCode(isolate_, STRICT, UNINITIALIZED);
DoKeyedLoadIC(ic, assembler);
}
void Interpreter::DoStoreIC(Callable ic, InterpreterAssembler* assembler) {
Node* code_target = __ HeapConstant(ic.code());
Node* object_reg_index = __ BytecodeOperandReg(0);

View File

@ -1018,20 +1018,16 @@ bool Object::HasSpecificClassOf(String* name) {
return this->IsJSObject() && (JSObject::cast(this)->class_name() == name);
}
MaybeHandle<Object> Object::GetProperty(Handle<Object> object,
Handle<Name> name,
LanguageMode language_mode) {
Handle<Name> name) {
LookupIterator it(object, name);
return GetProperty(&it, language_mode);
return GetProperty(&it);
}
MaybeHandle<Object> Object::GetElement(Isolate* isolate, Handle<Object> object,
uint32_t index,
LanguageMode language_mode) {
uint32_t index) {
LookupIterator it(isolate, object, index);
return GetProperty(&it, language_mode);
return GetProperty(&it);
}
@ -1057,12 +1053,10 @@ MaybeHandle<Object> JSReceiver::GetPrototype(Isolate* isolate,
return PrototypeIterator::GetCurrent(iter);
}
MaybeHandle<Object> Object::GetProperty(Isolate* isolate, Handle<Object> object,
const char* name,
LanguageMode language_mode) {
const char* name) {
Handle<String> str = isolate->factory()->InternalizeUtf8String(name);
return GetProperty(object, str, language_mode);
return GetProperty(object, str);
}
@ -6924,22 +6918,19 @@ Maybe<bool> Object::LessThanOrEqual(Handle<Object> x, Handle<Object> y) {
return Nothing<bool>();
}
MaybeHandle<Object> Object::GetPropertyOrElement(Handle<Object> object,
Handle<Name> name,
LanguageMode language_mode) {
Handle<Name> name) {
LookupIterator it =
LookupIterator::PropertyOrElement(name->GetIsolate(), object, name);
return GetProperty(&it, language_mode);
return GetProperty(&it);
}
MaybeHandle<Object> Object::GetPropertyOrElement(Handle<Object> receiver,
Handle<Name> name,
Handle<JSReceiver> holder,
LanguageMode language_mode) {
Handle<JSReceiver> holder) {
LookupIterator it = LookupIterator::PropertyOrElement(
name->GetIsolate(), receiver, name, holder);
return GetProperty(&it, language_mode);
return GetProperty(&it);
}

View File

@ -708,8 +708,7 @@ Maybe<bool> JSReceiver::HasProperty(LookupIterator* it) {
// static
MaybeHandle<Object> Object::GetProperty(LookupIterator* it,
LanguageMode language_mode) {
MaybeHandle<Object> Object::GetProperty(LookupIterator* it) {
for (; it->IsFound(); it->Next()) {
switch (it->state()) {
case LookupIterator::NOT_FOUND:
@ -717,8 +716,7 @@ MaybeHandle<Object> Object::GetProperty(LookupIterator* it,
UNREACHABLE();
case LookupIterator::JSPROXY:
return JSProxy::GetProperty(it->isolate(), it->GetHolder<JSProxy>(),
it->GetName(), it->GetReceiver(),
language_mode);
it->GetName(), it->GetReceiver());
case LookupIterator::INTERCEPTOR: {
bool done;
Handle<Object> result;
@ -732,14 +730,14 @@ MaybeHandle<Object> Object::GetProperty(LookupIterator* it,
if (it->HasAccess()) break;
return JSObject::GetPropertyWithFailedAccessCheck(it);
case LookupIterator::ACCESSOR:
return GetPropertyWithAccessor(it, language_mode);
return GetPropertyWithAccessor(it);
case LookupIterator::INTEGER_INDEXED_EXOTIC:
return ReadAbsentProperty(it, language_mode);
return ReadAbsentProperty(it);
case LookupIterator::DATA:
return it->GetDataValue();
}
}
return ReadAbsentProperty(it, language_mode);
return ReadAbsentProperty(it);
}
@ -758,8 +756,7 @@ MaybeHandle<Object> Object::GetProperty(LookupIterator* it,
MaybeHandle<Object> JSProxy::GetProperty(Isolate* isolate,
Handle<JSProxy> proxy,
Handle<Name> name,
Handle<Object> receiver,
LanguageMode language_mode) {
Handle<Object> receiver) {
if (receiver->IsJSGlobalObject()) {
THROW_NEW_ERROR(
isolate,
@ -792,7 +789,7 @@ MaybeHandle<Object> JSProxy::GetProperty(Isolate* isolate,
// 7.a Return target.[[Get]](P, Receiver).
LookupIterator it =
LookupIterator::PropertyOrElement(isolate, receiver, name, target);
return Object::GetProperty(&it, language_mode);
return Object::GetProperty(&it);
}
// 8. Let trapResult be ? Call(trap, handler, «target, P, Receiver»).
Handle<Object> trap_result;
@ -1062,9 +1059,7 @@ MaybeHandle<Object> JSProxy::GetPrototype(Handle<JSProxy> proxy) {
return handler_proto;
}
MaybeHandle<Object> Object::GetPropertyWithAccessor(
LookupIterator* it, LanguageMode language_mode) {
MaybeHandle<Object> Object::GetPropertyWithAccessor(LookupIterator* it) {
Isolate* isolate = it->isolate();
Handle<Object> structure = it->GetAccessors();
Handle<Object> receiver = it->GetReceiver();
@ -1095,7 +1090,7 @@ MaybeHandle<Object> Object::GetPropertyWithAccessor(
v8::Local<v8::Value> result = args.Call(call_fun, v8::Utils::ToLocal(name));
RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object);
if (result.IsEmpty()) {
return ReadAbsentProperty(isolate, receiver, name, language_mode);
return ReadAbsentProperty(isolate, receiver, name);
}
Handle<Object> return_value = v8::Utils::OpenHandle(*result);
return_value->VerifyApiCallResultType();
@ -1122,7 +1117,7 @@ MaybeHandle<Object> Object::GetPropertyWithAccessor(
receiver, Handle<JSReceiver>::cast(getter));
}
// Getter is not a function.
return ReadAbsentProperty(isolate, receiver, it->GetName(), language_mode);
return ReadAbsentProperty(isolate, receiver, it->GetName());
}
@ -1272,7 +1267,7 @@ MaybeHandle<Object> JSObject::GetPropertyWithFailedAccessCheck(
Handle<JSObject> checked = it->GetHolder<JSObject>();
while (AllCanRead(it)) {
if (it->state() == LookupIterator::ACCESSOR) {
return GetPropertyWithAccessor(it, SLOPPY);
return GetPropertyWithAccessor(it);
}
DCHECK_EQ(LookupIterator::INTERCEPTOR, it->state());
bool done;
@ -4343,28 +4338,13 @@ Maybe<bool> Object::SetSuperProperty(LookupIterator* it, Handle<Object> value,
store_mode);
}
MaybeHandle<Object> Object::ReadAbsentProperty(LookupIterator* it,
LanguageMode language_mode) {
if (is_strong(language_mode)) {
THROW_NEW_ERROR(it->isolate(),
NewTypeError(MessageTemplate::kStrongPropertyAccess,
it->GetName(), it->GetReceiver()),
Object);
}
MaybeHandle<Object> Object::ReadAbsentProperty(LookupIterator* it) {
return it->isolate()->factory()->undefined_value();
}
MaybeHandle<Object> Object::ReadAbsentProperty(Isolate* isolate,
Handle<Object> receiver,
Handle<Object> name,
LanguageMode language_mode) {
if (is_strong(language_mode)) {
THROW_NEW_ERROR(
isolate,
NewTypeError(MessageTemplate::kStrongPropertyAccess, name, receiver),
Object);
}
Handle<Object> name) {
return isolate->factory()->undefined_value();
}
@ -8964,7 +8944,7 @@ MaybeHandle<FixedArray> GetOwnValuesOrEntries(Isolate* isolate,
Handle<Object> value;
ASSIGN_RETURN_ON_EXCEPTION_VALUE(
isolate, value, JSReceiver::GetPropertyOrElement(object, key, STRICT),
isolate, value, JSReceiver::GetPropertyOrElement(object, key),
MaybeHandle<FixedArray>());
if (get_entries) {

View File

@ -1215,8 +1215,7 @@ class Object {
Handle<Object> lhs,
Handle<Object> rhs);
MUST_USE_RESULT static MaybeHandle<Object> GetProperty(
LookupIterator* it, LanguageMode language_mode = SLOPPY);
MUST_USE_RESULT static MaybeHandle<Object> GetProperty(LookupIterator* it);
// ES6 [[Set]] (when passed DONT_THROW)
// Invariants for this and related functions (unless stated otherwise):
@ -1239,10 +1238,9 @@ class Object {
StoreFromKeyed store_mode);
MUST_USE_RESULT static MaybeHandle<Object> ReadAbsentProperty(
LookupIterator* it, LanguageMode language_mode);
LookupIterator* it);
MUST_USE_RESULT static MaybeHandle<Object> ReadAbsentProperty(
Isolate* isolate, Handle<Object> receiver, Handle<Object> name,
LanguageMode language_mode);
Isolate* isolate, Handle<Object> receiver, Handle<Object> name);
MUST_USE_RESULT static Maybe<bool> CannotCreateProperty(
Isolate* isolate, Handle<Object> receiver, Handle<Object> name,
Handle<Object> value, ShouldThrow should_throw);
@ -1260,20 +1258,16 @@ class Object {
LookupIterator* it, Handle<Object> value, PropertyAttributes attributes,
ShouldThrow should_throw, StoreFromKeyed store_mode);
MUST_USE_RESULT static inline MaybeHandle<Object> GetPropertyOrElement(
Handle<Object> object, Handle<Name> name,
LanguageMode language_mode = SLOPPY);
Handle<Object> object, Handle<Name> name);
MUST_USE_RESULT static inline MaybeHandle<Object> GetPropertyOrElement(
Handle<Object> receiver, Handle<Name> name, Handle<JSReceiver> holder,
LanguageMode language_mode = SLOPPY);
Handle<Object> receiver, Handle<Name> name, Handle<JSReceiver> holder);
MUST_USE_RESULT static inline MaybeHandle<Object> GetProperty(
Isolate* isolate, Handle<Object> object, const char* key,
LanguageMode language_mode = SLOPPY);
Isolate* isolate, Handle<Object> object, const char* key);
MUST_USE_RESULT static inline MaybeHandle<Object> GetProperty(
Handle<Object> object, Handle<Name> name,
LanguageMode language_mode = SLOPPY);
Handle<Object> object, Handle<Name> name);
MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithAccessor(
LookupIterator* it, LanguageMode language_mode);
LookupIterator* it);
MUST_USE_RESULT static Maybe<bool> SetPropertyWithAccessor(
LookupIterator* it, Handle<Object> value, ShouldThrow should_throw);
@ -1285,8 +1279,7 @@ class Object {
ShouldThrow should_throw);
MUST_USE_RESULT static inline MaybeHandle<Object> GetElement(
Isolate* isolate, Handle<Object> object, uint32_t index,
LanguageMode language_mode = SLOPPY);
Isolate* isolate, Handle<Object> object, uint32_t index);
MUST_USE_RESULT static inline MaybeHandle<Object> SetElement(
Isolate* isolate, Handle<Object> object, uint32_t index,
@ -9745,7 +9738,7 @@ class JSProxy: public JSReceiver {
// ES6 9.5.8
MUST_USE_RESULT static MaybeHandle<Object> GetProperty(
Isolate* isolate, Handle<JSProxy> proxy, Handle<Name> name,
Handle<Object> receiver, LanguageMode language_mode);
Handle<Object> receiver);
// ES6 9.5.9
MUST_USE_RESULT static Maybe<bool> SetProperty(Handle<JSProxy> proxy,

View File

@ -104,8 +104,7 @@ static MaybeHandle<Object> DefineClass(Isolate* isolate,
ASSIGN_RETURN_ON_EXCEPTION(
isolate, prototype_parent,
Runtime::GetObjectProperty(isolate, super_class,
isolate->factory()->prototype_string(),
SLOPPY),
isolate->factory()->prototype_string()),
Object);
if (!prototype_parent->IsNull() && !prototype_parent->IsJSReceiver()) {
THROW_NEW_ERROR(
@ -223,12 +222,10 @@ RUNTIME_FUNCTION(Runtime_FinalizeClassDefinition) {
return *constructor;
}
static MaybeHandle<Object> LoadFromSuper(Isolate* isolate,
Handle<Object> receiver,
Handle<JSObject> home_object,
Handle<Name> name,
LanguageMode language_mode) {
Handle<Name> name) {
if (home_object->IsAccessCheckNeeded() &&
!isolate->MayAccess(handle(isolate->context()), home_object)) {
isolate->ReportFailedAccessCheck(home_object);
@ -238,22 +235,19 @@ static MaybeHandle<Object> LoadFromSuper(Isolate* isolate,
PrototypeIterator iter(isolate, home_object);
Handle<Object> proto = PrototypeIterator::GetCurrent(iter);
if (!proto->IsJSReceiver()) {
return Object::ReadAbsentProperty(isolate, proto, name, language_mode);
return Object::ReadAbsentProperty(isolate, proto, name);
}
LookupIterator it(receiver, name, Handle<JSReceiver>::cast(proto));
Handle<Object> result;
ASSIGN_RETURN_ON_EXCEPTION(isolate, result,
Object::GetProperty(&it, language_mode), Object);
ASSIGN_RETURN_ON_EXCEPTION(isolate, result, Object::GetProperty(&it), Object);
return result;
}
static MaybeHandle<Object> LoadElementFromSuper(Isolate* isolate,
Handle<Object> receiver,
Handle<JSObject> home_object,
uint32_t index,
LanguageMode language_mode) {
uint32_t index) {
if (home_object->IsAccessCheckNeeded() &&
!isolate->MayAccess(handle(isolate->context()), home_object)) {
isolate->ReportFailedAccessCheck(home_object);
@ -264,50 +258,44 @@ static MaybeHandle<Object> LoadElementFromSuper(Isolate* isolate,
Handle<Object> proto = PrototypeIterator::GetCurrent(iter);
if (!proto->IsJSReceiver()) {
Handle<Object> name = isolate->factory()->NewNumberFromUint(index);
return Object::ReadAbsentProperty(isolate, proto, name, language_mode);
return Object::ReadAbsentProperty(isolate, proto, name);
}
LookupIterator it(isolate, receiver, index, Handle<JSReceiver>::cast(proto));
Handle<Object> result;
ASSIGN_RETURN_ON_EXCEPTION(isolate, result,
Object::GetProperty(&it, language_mode), Object);
ASSIGN_RETURN_ON_EXCEPTION(isolate, result, Object::GetProperty(&it), Object);
return result;
}
// TODO(conradw): It would be more efficient to have a separate runtime function
// for strong mode.
RUNTIME_FUNCTION(Runtime_LoadFromSuper) {
HandleScope scope(isolate);
DCHECK(args.length() == 4);
DCHECK_EQ(3, args.length());
CONVERT_ARG_HANDLE_CHECKED(Object, receiver, 0);
CONVERT_ARG_HANDLE_CHECKED(JSObject, home_object, 1);
CONVERT_ARG_HANDLE_CHECKED(Name, name, 2);
CONVERT_LANGUAGE_MODE_ARG_CHECKED(language_mode, 3);
Handle<Object> result;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, result,
LoadFromSuper(isolate, receiver, home_object, name, language_mode));
isolate, result, LoadFromSuper(isolate, receiver, home_object, name));
return *result;
}
RUNTIME_FUNCTION(Runtime_LoadKeyedFromSuper) {
HandleScope scope(isolate);
DCHECK(args.length() == 4);
DCHECK_EQ(3, args.length());
CONVERT_ARG_HANDLE_CHECKED(Object, receiver, 0);
CONVERT_ARG_HANDLE_CHECKED(JSObject, home_object, 1);
CONVERT_ARG_HANDLE_CHECKED(Object, key, 2);
CONVERT_LANGUAGE_MODE_ARG_CHECKED(language_mode, 3);
uint32_t index = 0;
Handle<Object> result;
if (key->ToArrayIndex(&index)) {
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, result, LoadElementFromSuper(isolate, receiver, home_object,
index, language_mode));
isolate, result,
LoadElementFromSuper(isolate, receiver, home_object, index));
return *result;
}
@ -317,13 +305,12 @@ RUNTIME_FUNCTION(Runtime_LoadKeyedFromSuper) {
// TODO(verwaest): Unify using LookupIterator.
if (name->AsArrayIndex(&index)) {
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, result, LoadElementFromSuper(isolate, receiver, home_object,
index, language_mode));
isolate, result,
LoadElementFromSuper(isolate, receiver, home_object, index));
return *result;
}
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, result,
LoadFromSuper(isolate, receiver, home_object, name, language_mode));
isolate, result, LoadFromSuper(isolate, receiver, home_object, name));
return *result;
}

View File

@ -82,7 +82,7 @@ static Handle<Object> DebugGetProperty(LookupIterator* it,
return it->isolate()->factory()->undefined_value();
}
MaybeHandle<Object> maybe_result =
JSObject::GetPropertyWithAccessor(it, SLOPPY);
JSObject::GetPropertyWithAccessor(it);
Handle<Object> result;
if (!maybe_result.ToHandle(&result)) {
result = handle(it->isolate()->pending_exception(), it->isolate());

View File

@ -15,11 +15,9 @@
namespace v8 {
namespace internal {
MaybeHandle<Object> Runtime::GetObjectProperty(Isolate* isolate,
Handle<Object> object,
Handle<Object> key,
LanguageMode language_mode) {
Handle<Object> key) {
if (object->IsUndefined() || object->IsNull()) {
THROW_NEW_ERROR(
isolate,
@ -32,14 +30,12 @@ MaybeHandle<Object> Runtime::GetObjectProperty(Isolate* isolate,
LookupIterator::PropertyOrElement(isolate, object, key, &success);
if (!success) return MaybeHandle<Object>();
return Object::GetProperty(&it, language_mode);
return Object::GetProperty(&it);
}
static MaybeHandle<Object> KeyedGetObjectProperty(Isolate* isolate,
Handle<Object> receiver_obj,
Handle<Object> key_obj,
LanguageMode language_mode) {
Handle<Object> key_obj) {
// Fast cases for getting named properties of the receiver JSObject
// itself.
//
@ -113,8 +109,7 @@ static MaybeHandle<Object> KeyedGetObjectProperty(Isolate* isolate,
}
// Fall back to GetObjectProperty.
return Runtime::GetObjectProperty(isolate, receiver_obj, key_obj,
language_mode);
return Runtime::GetObjectProperty(isolate, receiver_obj, key_obj);
}
@ -386,23 +381,7 @@ RUNTIME_FUNCTION(Runtime_GetProperty) {
Handle<Object> result;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, result,
Runtime::GetObjectProperty(isolate, object, key, SLOPPY));
return *result;
}
RUNTIME_FUNCTION(Runtime_GetPropertyStrong) {
HandleScope scope(isolate);
DCHECK(args.length() == 2);
CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
CONVERT_ARG_HANDLE_CHECKED(Object, key, 1);
Handle<Object> result;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, result,
Runtime::GetObjectProperty(isolate, object, key, STRONG));
isolate, result, Runtime::GetObjectProperty(isolate, object, key));
return *result;
}
@ -417,23 +396,7 @@ RUNTIME_FUNCTION(Runtime_KeyedGetProperty) {
Handle<Object> result;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, result,
KeyedGetObjectProperty(isolate, receiver_obj, key_obj, SLOPPY));
return *result;
}
RUNTIME_FUNCTION(Runtime_KeyedGetPropertyStrong) {
HandleScope scope(isolate);
DCHECK(args.length() == 2);
CONVERT_ARG_HANDLE_CHECKED(Object, receiver_obj, 0);
CONVERT_ARG_HANDLE_CHECKED(Object, key_obj, 1);
Handle<Object> result;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, result,
KeyedGetObjectProperty(isolate, receiver_obj, key_obj, STRONG));
isolate, result, KeyedGetObjectProperty(isolate, receiver_obj, key_obj));
return *result;
}

View File

@ -84,8 +84,8 @@ namespace internal {
F(HomeObjectSymbol, 0, 1) \
F(DefineClass, 4, 1) \
F(FinalizeClassDefinition, 2, 1) \
F(LoadFromSuper, 4, 1) \
F(LoadKeyedFromSuper, 4, 1) \
F(LoadFromSuper, 3, 1) \
F(LoadKeyedFromSuper, 3, 1) \
F(StoreToSuper_Strict, 4, 1) \
F(StoreToSuper_Sloppy, 4, 1) \
F(StoreKeyedToSuper_Strict, 4, 1) \
@ -419,9 +419,7 @@ namespace internal {
F(GetOwnProperty_Legacy, 2, 1) \
F(OptimizeObjectForAddingMultipleProperties, 2, 1) \
F(GetProperty, 2, 1) \
F(GetPropertyStrong, 2, 1) \
F(KeyedGetProperty, 2, 1) \
F(KeyedGetPropertyStrong, 2, 1) \
F(LoadGlobalViaContext, 1, 1) \
F(StoreGlobalViaContext_Sloppy, 2, 1) \
F(StoreGlobalViaContext_Strict, 2, 1) \
@ -1134,8 +1132,7 @@ class Runtime : public AllStatic {
Handle<Object> value, LanguageMode language_mode);
MUST_USE_RESULT static MaybeHandle<Object> GetObjectProperty(
Isolate* isolate, Handle<Object> object, Handle<Object> key,
LanguageMode language_mode = SLOPPY);
Isolate* isolate, Handle<Object> object, Handle<Object> key);
enum TypedArrayId {
// arrayIds below should be synchronized with typedarray.js natives.

View File

@ -89,6 +89,10 @@
'test-func-name-inference/UpperCaseClass': [FAIL],
'test-func-name-inference/LowerCaseClass': [FAIL],
# BUG(3956). Strong mode is being deprecated. Decide about these tests.
'test-api/StrongModeAccessCheckAllowed': [FAIL],
'test-api/StrongModeAccessCheckBlocked': [FAIL],
##############################################################################
# TurboFan compiler failures.
@ -514,13 +518,8 @@
'test-api/IsGeneratorFunctionOrObject': [FAIL],
# TODO(rmcilroy,4680): Strong mode failures.
'test-parsing/StrongModeFreeVariablesDeclaredByLanguage': [FAIL],
'test-parsing/StrongModeFreeVariablesDeclaredInGlobalPrototype': [FAIL],
'test-parsing/StrongModeFreeVariablesDeclaredByPreviousScript': [FAIL],
'test-api/StrongModeAccessCheckBlocked': [FAIL],
'test-api/AccessorShouldThrowOnError': [FAIL],
'test-api/InterceptorShouldThrowOnError': [FAIL],
'test-api/StrongModeAccessCheckAllowed': [FAIL],
# TODO(rmcilroy,4680): The function_data field should be a BytecodeArray on interpreter entry
'test-api/SetFunctionEntryHook': [FAIL],

View File

@ -1065,8 +1065,6 @@ TEST(PropertyLoads) {
// These are a hack used by the LoadICXXXWide tests below.
int wide_idx_1 = vector->GetIndex(slot1) - 2;
int wide_idx_2 = vector->GetIndex(slot1) - 2;
int wide_idx_3 = vector->GetIndex(slot1) - 2;
int wide_idx_4 = vector->GetIndex(slot1) - 2;
// clang-format off
ExpectedSnippet<const char*> snippets[] = {
@ -1078,7 +1076,7 @@ TEST(PropertyLoads) {
B(StackCheck), //
B(Ldar), A(1, 2), //
B(Star), R(0), //
B(LoadICSloppy), R(0), U8(0), U8(vector->GetIndex(slot1)), //
B(LoadIC), R(0), U8(0), U8(vector->GetIndex(slot1)), //
B(Return), //
},
1,
@ -1091,7 +1089,7 @@ TEST(PropertyLoads) {
B(StackCheck), //
B(Ldar), A(1, 2), //
B(Star), R(0), //
B(LoadICSloppy), R(0), U8(0), U8(vector->GetIndex(slot1)), //
B(LoadIC), R(0), U8(0), U8(vector->GetIndex(slot1)), //
B(Return) //
},
1,
@ -1105,7 +1103,7 @@ TEST(PropertyLoads) {
B(Ldar), A(1, 2), //
B(Star), R(0), //
B(LdaSmi8), U8(100), //
B(KeyedLoadICSloppy), R(0), U8(vector->GetIndex(slot1)), //
B(KeyedLoadIC), R(0), U8(vector->GetIndex(slot1)), //
B(Return) //
},
0},
@ -1118,7 +1116,7 @@ TEST(PropertyLoads) {
B(Ldar), A(1, 3), //
B(Star), R(0), //
B(Ldar), A(1, 2), //
B(KeyedLoadICSloppy), R(0), U8(vector->GetIndex(slot1)), //
B(KeyedLoadIC), R(0), U8(vector->GetIndex(slot1)), //
B(Return) //
},
0},
@ -1131,43 +1129,16 @@ TEST(PropertyLoads) {
B(StackCheck), //
B(Ldar), A(1, 2), //
B(Star), R(1), //
B(LoadICSloppy), R(1), U8(0), U8(vector->GetIndex(slot1)), //
B(LoadIC), R(1), U8(0), U8(vector->GetIndex(slot1)), //
B(Star), R(0), //
B(Ldar), A(1, 2), //
B(Star), R(1), //
B(LdaSmi8), U8(-124), //
B(KeyedLoadICSloppy), R(1), U8(vector->GetIndex(slot2)), //
B(KeyedLoadIC), R(1), U8(vector->GetIndex(slot2)), //
B(Return), //
},
1,
{"name"}},
{"function f(a) { \"use strict\"; return a.name; }\nf({name : \"test\"})",
1 * kPointerSize,
2,
10,
{
B(StackCheck), //
B(Ldar), A(1, 2), //
B(Star), R(0), //
B(LoadICStrict), R(0), U8(0), U8(vector->GetIndex(slot1)), //
B(Return), //
},
1,
{"name"}},
{"function f(a, b) { \"use strict\"; return a[b]; }\n"
"f({arg : \"test\"}, \"arg\")",
1 * kPointerSize,
3,
11,
{
B(StackCheck), //
B(Ldar), A(1, 3), //
B(Star), R(0), //
B(Ldar), A(2, 3), //
B(KeyedLoadICStrict), R(0), U8(vector->GetIndex(slot1)), //
B(Return), //
},
0},
{"function f(a) {\n"
" var b;\n"
"b = a.name;"
@ -1181,45 +1152,17 @@ TEST(PropertyLoads) {
B(StackCheck), //
B(Ldar), A(1, 2), //
B(Star), R(1), //
B(LoadICSloppy), R(1), U8(0), U8(wide_idx_1 += 2), //
B(LoadIC), R(1), U8(0), U8(wide_idx_1 += 2), //
B(Star), R(0), //
REPEAT_127(COMMA, //
B(Ldar), A(1, 2), //
B(Star), R(1), //
B(LoadICSloppy), R(1), U8(0), //
B(LoadIC), R(1), U8(0), //
U8((wide_idx_1 += 2)), //
B(Star), R(0)), //
B(Ldar), A(1, 2), //
B(Star), R(1), //
B(LoadICSloppyWide), R(1), U16(0), U16(wide_idx_1 + 2), //
B(Return), //
},
1,
{"name"}},
{"function f(a) {\n"
" 'use strict'; var b;\n"
" b = a.name;\n"
REPEAT_127(SPACE, " b = a.name; ")
" return a.name; }\n"
"f({name : \"test\"})\n",
2 * kPointerSize,
2,
1292,
{
B(StackCheck), //
B(Ldar), A(1, 2), //
B(Star), R(1), //
B(LoadICStrict), R(1), U8(0), U8((wide_idx_2 += 2)), //
B(Star), R(0), //
REPEAT_127(COMMA, //
B(Ldar), A(1, 2), //
B(Star), R(1), //
B(LoadICStrict), R(1), U8(0), //
U8((wide_idx_2 += 2)), //
B(Star), R(0)), //
B(Ldar), A(1, 2), //
B(Star), R(1), //
B(LoadICStrictWide), R(1), U16(0), U16(wide_idx_2 + 2), //
B(LoadICWide), R(1), U16(0), U16(wide_idx_1 + 2), //
B(Return), //
},
1,
@ -1238,46 +1181,18 @@ TEST(PropertyLoads) {
B(Ldar), A(1, 3), //
B(Star), R(1), //
B(Ldar), A(2, 3), //
B(KeyedLoadICSloppy), R(1), U8((wide_idx_3 += 2)), //
B(KeyedLoadIC), R(1), U8((wide_idx_2 += 2)), //
B(Star), R(0), //
REPEAT_127(COMMA, //
B(Ldar), A(1, 3), //
B(Star), R(1), //
B(Ldar), A(2, 3), //
B(KeyedLoadICSloppy), R(1), U8((wide_idx_3 += 2)), //
B(KeyedLoadIC), R(1), U8((wide_idx_2 += 2)), //
B(Star), R(0)), //
B(Ldar), A(1, 3), //
B(Star), R(1), //
B(Ldar), A(2, 3), //
B(KeyedLoadICSloppyWide), R(1), U16(wide_idx_3 + 2), //
B(Return), //
}},
{"function f(a, b) {\n"
" 'use strict'; var c;\n"
" c = a[b];"
REPEAT_127(SPACE, " c = a[b]; ")
" return a[b]; }\n"
"f({name : \"test\"}, \"name\")\n",
2 * kPointerSize,
3,
1420,
{
B(StackCheck), //
B(Ldar), A(1, 3), //
B(Star), R(1), //
B(Ldar), A(2, 3), //
B(KeyedLoadICStrict), R(1), U8((wide_idx_4 += 2)), //
B(Star), R(0), //
REPEAT_127(COMMA, //
B(Ldar), A(1, 3), //
B(Star), R(1), //
B(Ldar), A(2, 3), //
B(KeyedLoadICStrict), R(1), U8((wide_idx_4 += 2)), //
B(Star), R(0)), //
B(Ldar), A(1, 3), //
B(Star), R(1), //
B(Ldar), A(2, 3), //
B(KeyedLoadICStrictWide), R(1), U16(wide_idx_4 + 2), //
B(KeyedLoadICWide), R(1), U16(wide_idx_2 + 2), //
B(Return), //
}},
};
@ -1389,7 +1304,7 @@ TEST(PropertyStores) {
B(Ldar), A(1, 2), //
B(Star), R(1), //
B(LdaSmi8), U8(-124), //
B(KeyedLoadICSloppy), R(1), U8(vector->GetIndex(slot1)), //
B(KeyedLoadIC), R(1), U8(vector->GetIndex(slot1)), //
B(StoreICSloppy), R(0), U8(0), U8(vector->GetIndex(slot2)), //
B(LdaUndefined), //
B(Return), //
@ -1595,7 +1510,7 @@ TEST(PropertyCall) {
B(StackCheck), //
B(Ldar), A(1, 2), //
B(Star), R(1), //
B(LoadICSloppy), R(1), U8(0), U8(vector->GetIndex(slot2)), //
B(LoadIC), R(1), U8(0), U8(vector->GetIndex(slot2)), //
B(Star), R(0), //
B(Call), R(0), R(1), U8(1), U8(vector->GetIndex(slot1)), //
B(Return), //
@ -1610,7 +1525,7 @@ TEST(PropertyCall) {
B(StackCheck), //
B(Ldar), A(1, 4), //
B(Star), R(1), //
B(LoadICSloppy), R(1), U8(0), U8(vector->GetIndex(slot2)), //
B(LoadIC), R(1), U8(0), U8(vector->GetIndex(slot2)), //
B(Star), R(0), //
B(Ldar), A(2, 4), //
B(Star), R(2), //
@ -1629,7 +1544,7 @@ TEST(PropertyCall) {
B(StackCheck), //
B(Ldar), A(1, 3), //
B(Star), R(1), //
B(LoadICSloppy), R(1), U8(0), U8(vector->GetIndex(slot2)), //
B(LoadIC), R(1), U8(0), U8(vector->GetIndex(slot2)), //
B(Star), R(0), //
B(Ldar), A(2, 3), //
B(Star), R(3), //
@ -1653,14 +1568,14 @@ TEST(PropertyCall) {
B(StackCheck), //
B(Ldar), A(1, 2), //
B(Star), R(0), //
B(LoadICSloppy), R(0), U8(0), U8(wide_idx += 2), //
B(LoadIC), R(0), U8(0), U8(wide_idx += 2), //
REPEAT_127(COMMA, //
B(Ldar), A(1, 2), //
B(Star), R(0), //
B(LoadICSloppy), R(0), U8(0), U8((wide_idx += 2))), //
B(LoadIC), R(0), U8(0), U8((wide_idx += 2))), //
B(Ldar), A(1, 2), //
B(Star), R(1), //
B(LoadICSloppyWide), R(1), U16(0), U16(wide_idx + 4), //
B(LoadICWide), R(1), U16(0), U16(wide_idx + 4), //
B(Star), R(0), //
B(CallWide), R16(0), R16(1), U16(1), U16(wide_idx + 2), //
B(Return), //
@ -1691,7 +1606,6 @@ TEST(LoadGlobal) {
// These are a hack used by the LdaGlobalXXXWide tests below.
int wide_idx_1 = vector->GetIndex(slot) - 2;
int wide_idx_2 = vector->GetIndex(slot) - 2;
// clang-format off
ExpectedSnippet<const char*> snippets[] = {
@ -1701,7 +1615,7 @@ TEST(LoadGlobal) {
5,
{
B(StackCheck), //
B(LdaGlobalSloppy), U8(0), U8(vector->GetIndex(slot)), //
B(LdaGlobal), U8(0), U8(vector->GetIndex(slot)), //
B(Return) //
},
1,
@ -1712,29 +1626,18 @@ TEST(LoadGlobal) {
5,
{
B(StackCheck), //
B(LdaGlobalSloppy), U8(0), U8(vector->GetIndex(slot)), //
B(LdaGlobal), U8(0), U8(vector->GetIndex(slot)), //
B(Return) //
},
1,
{"t"}},
{"'use strict'; var a = 1;\nfunction f() { return a; }\nf()",
0,
1,
5,
{
B(StackCheck), //
B(LdaGlobalStrict), U8(0), U8(vector->GetIndex(slot)), //
B(Return) //
},
1,
{"a"}},
{"a = 1;\nfunction f() { return a; }\nf()",
0,
1,
5,
{
B(StackCheck), //
B(LdaGlobalSloppy), U8(0), U8(vector->GetIndex(slot)), //
B(LdaGlobal), U8(0), U8(vector->GetIndex(slot)), //
B(Return) //
},
1,
@ -1752,36 +1655,12 @@ TEST(LoadGlobal) {
B(StackCheck), //
B(Ldar), A(1, 2), //
B(Star), R(0), //
B(LoadICSloppy), R(0), U8(0), U8(wide_idx_1 += 2), //
B(LoadIC), R(0), U8(0), U8(wide_idx_1 += 2), //
REPEAT_127(COMMA, //
B(Ldar), A(1, 2), //
B(Star), R(0), //
B(LoadICSloppy), R(0), U8(0), U8(wide_idx_1 += 2)), //
B(LdaGlobalSloppyWide), U16(1), U16(wide_idx_1 + 2), //
B(Return), //
},
2,
{"name", "a"}},
{"a = 1;"
"function f(b) {\n"
" 'use strict';\n"
" b.name\n"
REPEAT_127(SPACE, "b.name; ")
" return a;"
"}\nf({name: 1});",
kPointerSize,
2,
1031,
{
B(StackCheck), //
B(Ldar), A(1, 2), //
B(Star), R(0), //
B(LoadICStrict), R(0), U8(0), U8(wide_idx_2 += 2), //
REPEAT_127(COMMA, //
B(Ldar), A(1, 2), //
B(Star), R(0), //
B(LoadICStrict), R(0), U8(0), U8(wide_idx_2 += 2)), //
B(LdaGlobalStrictWide), U16(1), U16(wide_idx_2 + 2), //
B(LoadIC), R(0), U8(0), U8(wide_idx_1 += 2)), //
B(LdaGlobalWide), U16(1), U16(wide_idx_1 + 2), //
B(Return), //
},
2,
@ -1879,11 +1758,11 @@ TEST(StoreGlobal) {
B(StackCheck), //
B(Ldar), A(1, 2), //
B(Star), R(0), //
B(LoadICSloppy), R(0), U8(0), U8(wide_idx_1 += 2), //
B(LoadIC), R(0), U8(0), U8(wide_idx_1 += 2), //
REPEAT_127(COMMA, //
B(Ldar), A(1, 2), //
B(Star), R(0), //
B(LoadICSloppy), R(0), U8(0), U8(wide_idx_1 += 2)), //
B(LoadIC), R(0), U8(0), U8(wide_idx_1 += 2)), //
B(LdaSmi8), U8(2), //
B(StaGlobalSloppyWide), U16(1), U16(wide_idx_1 + 2), //
B(LdaUndefined), //
@ -1905,11 +1784,11 @@ TEST(StoreGlobal) {
B(StackCheck), //
B(Ldar), A(1, 2), //
B(Star), R(0), //
B(LoadICStrict), R(0), U8(0), U8(wide_idx_2 += 2), //
B(LoadIC), R(0), U8(0), U8(wide_idx_2 += 2), //
REPEAT_127(COMMA, //
B(Ldar), A(1, 2), //
B(Star), R(0), //
B(LoadICStrict), R(0), U8(0), U8(wide_idx_2 += 2)), //
B(LoadIC), R(0), U8(0), U8(wide_idx_2 += 2)), //
B(LdaSmi8), U8(2), //
B(StaGlobalStrictWide), U16(1), U16(wide_idx_2 + 2), //
B(LdaUndefined), //
@ -1950,7 +1829,7 @@ TEST(CallGlobal) {
B(StackCheck), //
B(LdaUndefined), //
B(Star), R(1), //
B(LdaGlobalSloppy), U8(0), U8(vector->GetIndex(slot2)), //
B(LdaGlobal), U8(0), U8(vector->GetIndex(slot2)), //
B(Star), R(0), //
B(Call), R(0), R(1), U8(1), U8(vector->GetIndex(slot1)), //
B(Return) //
@ -1965,7 +1844,7 @@ TEST(CallGlobal) {
B(StackCheck), //
B(LdaUndefined), //
B(Star), R(1), //
B(LdaGlobalSloppy), U8(0), U8(vector->GetIndex(slot2)), //
B(LdaGlobal), U8(0), U8(vector->GetIndex(slot2)), //
B(Star), R(0), //
B(LdaSmi8), U8(1), //
B(Star), R(2), //
@ -2419,8 +2298,7 @@ TEST(DeclareGlobals) {
B(StackCheck), //
B(LdaUndefined), //
B(Star), R(2), //
B(LdaGlobalSloppy), U8(1), //
/* */ U8(load_vector->GetIndex(load_slot_1)), //
B(LdaGlobal), U8(1), U8(load_vector->GetIndex(load_slot_1)), //
B(Star), R(1), //
B(Call), R(1), R(2), U8(1), //
/* */ U8(load_vector->GetIndex(call_slot_1)), //
@ -3659,28 +3537,10 @@ TEST(Typeof) {
1,
6,
{
B(StackCheck), //
B(LdaGlobalInsideTypeofSloppy), U8(0), //
/* */ U8(vector->GetIndex(slot)), //
B(TypeOf), //
B(Return), //
},
1,
{"x"}},
{"var x = 13;\n"
"function f() {\n"
" 'use strict';\n"
" return typeof(x);\n"
"}; f();",
0,
1,
6,
{
B(StackCheck), //
B(LdaGlobalInsideTypeofStrict), U8(0), //
/* */ U8(vector->GetIndex(slot)), //
B(TypeOf), //
B(Return), //
B(StackCheck), //
B(LdaGlobalInsideTypeof), U8(0), U8(vector->GetIndex(slot)), //
B(TypeOf), //
B(Return), //
},
1,
{"x"}},
@ -3825,7 +3685,7 @@ TEST(GlobalDelete) {
1,
11,
{B(StackCheck), //
B(LdaGlobalSloppy), U8(0), U8(vector->GetIndex(slot)), //
B(LdaGlobal), U8(0), U8(vector->GetIndex(slot)), //
B(Star), R(0), //
B(LdaConstant), U8(1), //
B(DeletePropertySloppy), R(0), //
@ -3839,7 +3699,7 @@ TEST(GlobalDelete) {
1,
11,
{B(StackCheck), //
B(LdaGlobalStrict), U8(0), U8(vector->GetIndex(slot)), //
B(LdaGlobal), U8(0), U8(vector->GetIndex(slot)), //
B(Star), R(0), //
B(LdaSmi8), U8(1), //
B(DeletePropertyStrict), R(0), //
@ -3997,7 +3857,7 @@ TEST(RegExpLiterals) {
B(StackCheck), //
B(CreateRegExpLiteral), U8(0), U8(0), U8(0), //
B(Star), R(1), //
B(LoadICSloppy), R(1), U8(1), U8(vector->GetIndex(slot2)), //
B(LoadIC), R(1), U8(1), U8(vector->GetIndex(slot2)), //
B(Star), R(0), //
B(LdaConstant), U8(2), //
B(Star), R(2), //
@ -5036,7 +4896,7 @@ TEST(CallNew) {
11,
{
B(StackCheck), //
B(LdaGlobalSloppy), U8(0), U8(vector->GetIndex(slot2)), //
B(LdaGlobal), U8(0), U8(vector->GetIndex(slot2)), //
B(Star), R(0), //
B(New), R(0), R(0), U8(0), //
B(Return), //
@ -5051,7 +4911,7 @@ TEST(CallNew) {
17,
{
B(StackCheck), //
B(LdaGlobalSloppy), U8(0), U8(vector->GetIndex(slot2)), //
B(LdaGlobal), U8(0), U8(vector->GetIndex(slot2)), //
B(Star), R(0), //
B(LdaSmi8), U8(3), //
B(Star), R(1), //
@ -5074,7 +4934,7 @@ TEST(CallNew) {
25,
{
B(StackCheck), //
B(LdaGlobalSloppy), U8(0), U8(vector->GetIndex(slot2)), //
B(LdaGlobal), U8(0), U8(vector->GetIndex(slot2)), //
B(Star), R(0), //
B(LdaSmi8), U8(3), //
B(Star), R(1), //
@ -5244,7 +5104,7 @@ TEST(ContextVariables) {
B(StaContextSlot), R(context), U8(wide_slot++)), //
B(LdaUndefined), //
B(Star), R(2), //
B(LdaGlobalStrict), U8(0), U8(1), //
B(LdaGlobal), U8(0), U8(1), //
B(Star), R(1), //
B(Call), R(1), R(2), U8(1), U8(0), //
B(LdaSmi8), U8(100), //
@ -5514,7 +5374,7 @@ TEST(CountOperators) {
B(Star), R(1), //
B(Star), R(0), //
B(Star), R(1), //
B(LoadICSloppy), R(1), U8(1), U8(vector->GetIndex(slot1)), //
B(LoadIC), R(1), U8(1), U8(vector->GetIndex(slot1)), //
B(ToNumber), //
B(Star), R(2), //
B(Inc), //
@ -5535,7 +5395,7 @@ TEST(CountOperators) {
B(Star), R(1), //
B(Star), R(0), //
B(Star), R(1), //
B(LoadICSloppy), R(1), U8(1), U8(vector->GetIndex(slot1)), //
B(LoadIC), R(1), U8(1), U8(vector->GetIndex(slot1)), //
B(ToNumber), //
B(Dec), //
B(StoreICSloppy), R(1), U8(1), U8(vector->GetIndex(slot2)), //
@ -5558,7 +5418,7 @@ TEST(CountOperators) {
B(Star), R(2), //
B(Ldar), R(0), //
B(Star), R(3), //
B(KeyedLoadICSloppy), R(2), U8(vector->GetIndex(slot1)), //
B(KeyedLoadIC), R(2), U8(vector->GetIndex(slot1)), //
B(ToNumber), //
B(Star), R(4), //
B(Dec), //
@ -5583,7 +5443,7 @@ TEST(CountOperators) {
B(Star), R(2), //
B(Ldar), R(0), //
B(Star), R(3), //
B(KeyedLoadICSloppy), R(2), U8(vector->GetIndex(slot1)), //
B(KeyedLoadIC), R(2), U8(vector->GetIndex(slot1)), //
B(ToNumber), //
B(Inc), //
B(KeyedStoreICSloppy), R(2), R(3), U8(vector->GetIndex(slot2)), //
@ -5690,7 +5550,7 @@ TEST(GlobalCountOperators) {
10,
{
B(StackCheck), //
B(LdaGlobalSloppy), U8(0), U8(vector->GetIndex(slot1)), //
B(LdaGlobal), U8(0), U8(vector->GetIndex(slot1)), //
B(ToNumber), //
B(Inc), //
B(StaGlobalSloppy), U8(0), U8(vector->GetIndex(slot2)), //
@ -5704,7 +5564,7 @@ TEST(GlobalCountOperators) {
14,
{
B(StackCheck), //
B(LdaGlobalSloppy), U8(0), U8(vector->GetIndex(slot1)), //
B(LdaGlobal), U8(0), U8(vector->GetIndex(slot1)), //
B(ToNumber), //
B(Star), R(0), //
B(Dec), //
@ -5721,7 +5581,7 @@ TEST(GlobalCountOperators) {
10,
{
B(StackCheck), //
B(LdaGlobalStrict), U8(0), U8(vector->GetIndex(slot1)), //
B(LdaGlobal), U8(0), U8(vector->GetIndex(slot1)), //
B(ToNumber), //
B(Dec), //
B(StaGlobalStrict), U8(0), U8(vector->GetIndex(slot2)), //
@ -5735,7 +5595,7 @@ TEST(GlobalCountOperators) {
14,
{
B(StackCheck), //
B(LdaGlobalSloppy), U8(0), U8(vector->GetIndex(slot1)), //
B(LdaGlobal), U8(0), U8(vector->GetIndex(slot1)), //
B(ToNumber), //
B(Star), R(0), //
B(Inc), //
@ -5817,7 +5677,7 @@ TEST(CompoundExpressions) {
B(Star), R(1), //
B(Star), R(0), //
B(Star), R(1), //
B(LoadICSloppy), R(1), U8(1), U8(vector->GetIndex(slot1)), //
B(LoadIC), R(1), U8(1), U8(vector->GetIndex(slot1)), //
B(Star), R(2), //
B(LdaSmi8), U8(2), //
B(Mul), R(2), //
@ -5840,7 +5700,7 @@ TEST(CompoundExpressions) {
B(Star), R(1), //
B(LdaSmi8), U8(1), //
B(Star), R(2), //
B(KeyedLoadICSloppy), R(1), U8(vector->GetIndex(slot1)), //
B(KeyedLoadIC), R(1), U8(vector->GetIndex(slot1)), //
B(Star), R(3), //
B(LdaSmi8), U8(2), //
B(BitwiseXor), R(3), //
@ -5903,7 +5763,7 @@ TEST(GlobalCompoundExpressions) {
14,
{
B(StackCheck), //
B(LdaGlobalSloppy), U8(0), U8(vector->GetIndex(slot1)), //
B(LdaGlobal), U8(0), U8(vector->GetIndex(slot1)), //
B(Star), R(0), //
B(LdaSmi8), U8(1), //
B(BitwiseAnd), R(0), //
@ -5918,7 +5778,7 @@ TEST(GlobalCompoundExpressions) {
14,
{
B(StackCheck), //
B(LdaGlobalSloppy), U8(0), U8(vector->GetIndex(slot1)), //
B(LdaGlobal), U8(0), U8(vector->GetIndex(slot1)), //
B(Star), R(0), //
B(LdaSmi8), U8(1), //
B(Add), R(0), //
@ -5977,7 +5837,7 @@ TEST(CreateArguments) {
B(Ldar), R(0), //
B(Star), R(1), //
B(LdaZero), //
B(KeyedLoadICSloppy), R(1), U8(vector->GetIndex(slot)), //
B(KeyedLoadIC), R(1), U8(vector->GetIndex(slot)), //
B(Return), //
}},
{"function f() { 'use strict'; return arguments; }",
@ -6007,7 +5867,7 @@ TEST(CreateArguments) {
B(Ldar), R(0), //
B(Star), R(2), //
B(LdaZero), //
B(KeyedLoadICSloppy), R(2), U8(vector->GetIndex(slot)), //
B(KeyedLoadIC), R(2), U8(vector->GetIndex(slot)), //
B(Return), //
}},
{"function f(a, b, c) { return arguments; }",
@ -6110,7 +5970,7 @@ TEST(CreateRestParameter) {
B(Ldar), R(0), //
B(Star), R(2), //
B(LdaZero), //
B(KeyedLoadICSloppy), R(2), U8(vector->GetIndex(slot)), //
B(KeyedLoadIC), R(2), U8(vector->GetIndex(slot)), //
B(Return), //
},
0,
@ -6132,12 +5992,12 @@ TEST(CreateRestParameter) {
B(Ldar), R(1), //
B(Star), R(3), //
B(LdaZero), //
B(KeyedLoadICSloppy), R(3), U8(vector->GetIndex(slot)), //
B(KeyedLoadIC), R(3), U8(vector->GetIndex(slot)), //
B(Star), R(4), //
B(Ldar), R(0), //
B(Star), R(3), //
B(LdaZero), //
B(KeyedLoadICSloppy), R(3), U8(vector->GetIndex(slot1)), //
B(KeyedLoadIC), R(3), U8(vector->GetIndex(slot1)), //
B(Add), R(4), //
B(Return), //
},
@ -6350,7 +6210,7 @@ TEST(ForIn) {
B(StackCheck), //
B(Ldar), R(0), //
B(Star), R(6), //
B(LoadICSloppy), R(6), U8(2), U8(vector->GetIndex(slot2)), //
B(LoadIC), R(6), U8(2), U8(vector->GetIndex(slot2)), //
B(Star), R(7), //
B(LdaSmi8), U8(10), //
B(TestEqual), R(7), //
@ -6358,7 +6218,7 @@ TEST(ForIn) {
B(Jump), U8(20), //
B(Ldar), R(0), //
B(Star), R(6), //
B(LoadICSloppy), R(6), U8(2), U8(vector->GetIndex(slot3)), //
B(LoadIC), R(6), U8(2), U8(vector->GetIndex(slot3)), //
B(Star), R(7), //
B(LdaSmi8), U8(20), //
B(TestEqual), R(7), //
@ -6406,7 +6266,7 @@ TEST(ForIn) {
B(Ldar), R(0), //
B(Star), R(6), //
B(LdaSmi8), U8(3), //
B(KeyedLoadICSloppy), R(6), U8(vector->GetIndex(slot2)), //
B(KeyedLoadIC), R(6), U8(vector->GetIndex(slot2)), //
B(Return), //
B(ForInStep), R(5), //
B(Star), R(5), //
@ -6460,13 +6320,13 @@ TEST(ForOf) {
B(CreateArrayLiteral), U8(0), U8(0), U8(array_literal_flags), //
B(Star), R(5), //
B(LdaConstant), U8(1), //
B(KeyedLoadICSloppy), R(5), U8(vector->GetIndex(slot2)), //
B(KeyedLoadIC), R(5), U8(vector->GetIndex(slot2)), //
B(Star), R(4), //
B(Call), R(4), R(5), U8(1), U8(vector->GetIndex(slot1)), //
B(Star), R(1), //
B(Ldar), R(1), //
B(Star), R(6), //
B(LoadICSloppy), R(6), U8(2), U8(vector->GetIndex(slot4)), //
B(LoadIC), R(6), U8(2), U8(vector->GetIndex(slot4)), //
B(Star), R(5), //
B(Call), R(5), R(6), U8(1), U8(vector->GetIndex(slot3)), //
B(Star), R(2), //
@ -6480,11 +6340,11 @@ TEST(ForOf) {
/* */ R(4), U8(1), //
B(Ldar), R(2), //
B(Star), R(4), //
B(LoadICSloppy), R(4), U8(3), U8(vector->GetIndex(slot5)), //
B(LoadIC), R(4), U8(3), U8(vector->GetIndex(slot5)), //
B(JumpIfToBooleanTrue), U8(19), //
B(Ldar), R(2), //
B(Star), R(4), //
B(LoadICSloppy), R(4), U8(4), U8(vector->GetIndex(slot6)), //
B(LoadIC), R(4), U8(4), U8(vector->GetIndex(slot6)), //
B(Star), R(0), //
B(StackCheck), //
B(Ldar), R(0), //
@ -6509,13 +6369,13 @@ TEST(ForOf) {
B(Star), R(3), //
B(Star), R(6), //
B(LdaConstant), U8(1), //
B(KeyedLoadICSloppy), R(6), U8(vector->GetIndex(slot2)), //
B(KeyedLoadIC), R(6), U8(vector->GetIndex(slot2)), //
B(Star), R(5), //
B(Call), R(5), R(6), U8(1), U8(vector->GetIndex(slot1)), //
B(Star), R(1), //
B(Ldar), R(1), //
B(Star), R(7), //
B(LoadICSloppy), R(7), U8(2), U8(vector->GetIndex(slot4)), //
B(LoadIC), R(7), U8(2), U8(vector->GetIndex(slot4)), //
B(Star), R(6), //
B(Call), R(6), R(7), U8(1), U8(vector->GetIndex(slot3)), //
B(Star), R(2), //
@ -6529,11 +6389,11 @@ TEST(ForOf) {
/* */ R(5), U8(1), //
B(Ldar), R(2), //
B(Star), R(5), //
B(LoadICSloppy), R(5), U8(3), U8(vector->GetIndex(slot5)), //
B(LoadIC), R(5), U8(3), U8(vector->GetIndex(slot5)), //
B(JumpIfToBooleanTrue), U8(18), //
B(Ldar), R(2), //
B(Star), R(5), //
B(LoadICSloppy), R(5), U8(4), U8(vector->GetIndex(slot6)), //
B(LoadIC), R(5), U8(4), U8(vector->GetIndex(slot6)), //
B(Star), R(0), //
B(StackCheck), //
B(Ldar), R(0), //
@ -6560,13 +6420,13 @@ TEST(ForOf) {
B(CreateArrayLiteral), U8(0), U8(0), U8(array_literal_flags), //
B(Star), R(5), //
B(LdaConstant), U8(1), //
B(KeyedLoadICSloppy), R(5), U8(vector->GetIndex(slot2)), //
B(KeyedLoadIC), R(5), U8(vector->GetIndex(slot2)), //
B(Star), R(4), //
B(Call), R(4), R(5), U8(1), U8(vector->GetIndex(slot1)), //
B(Star), R(1), //
B(Ldar), R(1), //
B(Star), R(6), //
B(LoadICSloppy), R(6), U8(2), U8(vector->GetIndex(slot4)), //
B(LoadIC), R(6), U8(2), U8(vector->GetIndex(slot4)), //
B(Star), R(5), //
B(Call), R(5), R(6), U8(1), U8(vector->GetIndex(slot3)), //
B(Star), R(2), //
@ -6580,11 +6440,11 @@ TEST(ForOf) {
/* */ R(4), U8(1), //
B(Ldar), R(2), //
B(Star), R(4), //
B(LoadICSloppy), R(4), U8(3), U8(vector->GetIndex(slot5)), //
B(LoadIC), R(4), U8(3), U8(vector->GetIndex(slot5)), //
B(JumpIfToBooleanTrue), U8(41), //
B(Ldar), R(2), //
B(Star), R(4), //
B(LoadICSloppy), R(4), U8(4), U8(vector->GetIndex(slot6)), //
B(LoadIC), R(4), U8(4), U8(vector->GetIndex(slot6)), //
B(Star), R(0), //
B(StackCheck), //
B(Ldar), R(0), //
@ -6622,13 +6482,13 @@ TEST(ForOf) {
B(CreateArrayLiteral), U8(1), U8(1), U8(array_literal_flags), //
B(Star), R(4), //
B(LdaConstant), U8(2), //
B(KeyedLoadICSloppy), R(4), U8(vector->GetIndex(slot2)), //
B(KeyedLoadIC), R(4), U8(vector->GetIndex(slot2)), //
B(Star), R(3), //
B(Call), R(3), R(4), U8(1), U8(vector->GetIndex(slot1)), //
B(Star), R(0), //
B(Ldar), R(0), //
B(Star), R(5), //
B(LoadICSloppy), R(5), U8(3), U8(vector->GetIndex(slot4)), //
B(LoadIC), R(5), U8(3), U8(vector->GetIndex(slot4)), //
B(Star), R(4), //
B(Call), R(4), R(5), U8(1), U8(vector->GetIndex(slot3)), //
B(Star), R(1), //
@ -6642,18 +6502,18 @@ TEST(ForOf) {
/* */ R(3), U8(1), //
B(Ldar), R(1), //
B(Star), R(3), //
B(LoadICSloppy), R(3), U8(4), U8(vector->GetIndex(slot5)), //
B(LoadIC), R(3), U8(4), U8(vector->GetIndex(slot5)), //
B(JumpIfToBooleanTrue), U8(28), //
B(Ldar), R(2), //
B(Star), R(3), //
B(Ldar), R(1), //
B(Star), R(4), //
B(LoadICSloppy), R(4), U8(5), U8(vector->GetIndex(slot6)), //
B(LoadIC), R(4), U8(5), U8(vector->GetIndex(slot6)), //
B(StoreICSloppy), R(3), U8(6), U8(vector->GetIndex(slot7)), //
B(StackCheck), //
B(Ldar), R(2), //
B(Star), R(3), //
B(LoadICSloppy), R(3), U8(6), U8(vector->GetIndex(slot8)), //
B(LoadIC), R(3), U8(6), U8(vector->GetIndex(slot8)), //
B(Return), //
B(LdaUndefined), //
B(Return), //
@ -9040,7 +8900,7 @@ TEST(ClassDeclarations) {
B(Star), R(5), //
B(CallRuntime), U16(Runtime::kDefineClass), R(2), U8(4), //
B(Star), R(2), //
B(LoadICSloppy), R(2), U8(2), U8(1), //
B(LoadIC), R(2), U8(2), U8(1), //
B(Star), R(3), //
B(Mov), R(3), R(4), //
B(LdaConstant), U8(3), //
@ -9086,7 +8946,7 @@ TEST(ClassDeclarations) {
B(Star), R(5), //
B(CallRuntime), U16(Runtime::kDefineClass), R(2), U8(4), //
B(Star), R(2), //
B(LoadICSloppy), R(2), U8(2), U8(1), //
B(LoadIC), R(2), U8(2), U8(1), //
B(Star), R(3), //
B(Mov), R(3), R(4), //
B(LdaConstant), U8(3), //
@ -9141,7 +9001,7 @@ TEST(ClassDeclarations) {
B(Star), R(6), //
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(4), //
B(Star), R(3), //
B(LoadICSloppy), R(3), U8(3), U8(1), //
B(LoadIC), R(3), U8(3), U8(1), //
B(Star), R(4), //
B(Mov), R(4), R(5), //
B(LdaContextSlot), R(context), U8(4), //
@ -9207,7 +9067,7 @@ TEST(ClassDeclarations) {
B(Star), R(6), //
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(4), //
B(Star), R(3), //
B(LoadICSloppy), R(3), U8(1), U8(1), //
B(LoadIC), R(3), U8(1), U8(1), //
B(Star), R(4), //
B(CallRuntime), U16(Runtime::kFinalizeClassDefinition), R(3), U8(2), //
B(Star), R(0), //

View File

@ -744,8 +744,7 @@ TEST(InterpreterLoadNamedProperty) {
BytecodeArrayBuilder builder(handles.main_isolate(), handles.main_zone(), 1,
0, 0);
builder.LoadNamedProperty(builder.Parameter(0), name, vector->GetIndex(slot),
i::SLOPPY)
builder.LoadNamedProperty(builder.Parameter(0), name, vector->GetIndex(slot))
.Return();
Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray();
@ -799,8 +798,7 @@ TEST(InterpreterLoadKeyedProperty) {
BytecodeArrayBuilder builder(handles.main_isolate(), handles.main_zone(), 1,
0, 1);
builder.LoadLiteral(key)
.LoadKeyedProperty(builder.Parameter(0), vector->GetIndex(slot),
i::STRICT)
.LoadKeyedProperty(builder.Parameter(0), vector->GetIndex(slot))
.Return();
Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray();
@ -951,7 +949,7 @@ TEST(InterpreterCall) {
{
BytecodeArrayBuilder builder(handles.main_isolate(), handles.main_zone(), 1,
0, 1);
builder.LoadNamedProperty(builder.Parameter(0), name, slot_index, i::SLOPPY)
builder.LoadNamedProperty(builder.Parameter(0), name, slot_index)
.StoreAccumulatorInRegister(Register(0))
.Call(Register(0), builder.Parameter(0), 1, 0)
.Return();
@ -970,7 +968,7 @@ TEST(InterpreterCall) {
{
BytecodeArrayBuilder builder(handles.main_isolate(), handles.main_zone(), 1,
0, 1);
builder.LoadNamedProperty(builder.Parameter(0), name, slot_index, i::SLOPPY)
builder.LoadNamedProperty(builder.Parameter(0), name, slot_index)
.StoreAccumulatorInRegister(Register(0))
.Call(Register(0), builder.Parameter(0), 1, 0)
.Return();
@ -992,7 +990,7 @@ TEST(InterpreterCall) {
{
BytecodeArrayBuilder builder(handles.main_isolate(), handles.main_zone(), 1,
0, 4);
builder.LoadNamedProperty(builder.Parameter(0), name, slot_index, i::SLOPPY)
builder.LoadNamedProperty(builder.Parameter(0), name, slot_index)
.StoreAccumulatorInRegister(Register(0))
.LoadAccumulatorWithRegister(builder.Parameter(0))
.StoreAccumulatorInRegister(Register(1))
@ -1019,7 +1017,7 @@ TEST(InterpreterCall) {
{
BytecodeArrayBuilder builder(handles.main_isolate(), handles.main_zone(), 1,
0, 12);
builder.LoadNamedProperty(builder.Parameter(0), name, slot_index, i::SLOPPY)
builder.LoadNamedProperty(builder.Parameter(0), name, slot_index)
.StoreAccumulatorInRegister(Register(0))
.LoadAccumulatorWithRegister(builder.Parameter(0))
.StoreAccumulatorInRegister(Register(1))

View File

@ -122,12 +122,18 @@
'debug-listbreakpoints': [PASS, NO_VARIANTS], # arm64 nosnap with turbofan
'debug-enable-disable-breakpoints': [PASS, NO_VARIANTS], #arm64 nosnap with turbofan.
# TODO(rossberg)
# TODO(mstarzinger): Strong mode is deprecating. The expectations inside the
# Issue 3956: Strong mode is deprecating. The expectations inside the
# following tests should be updated once deprecation is complete.
'strong/destructuring': [SKIP],
'strong/implicit-conversions': [SKIP],
'strong/implicit-conversions-count': [SKIP],
'strong/implicit-conversions-inlining': [SKIP],
'strong/load-builtins': [SKIP],
'strong/load-element': [SKIP],
'strong/load-element-mutate-backing-store': [SKIP],
'strong/load-property': [SKIP],
'strong/load-property-mutate-backing-store': [SKIP],
'strong/load-super': [SKIP],
'strong/literals': [SKIP], # Rest arguments do not respect strongness in Turbofan.
# Issue 4035: unexpected frame->context() in debugger
@ -290,7 +296,6 @@
'readonly': [PASS, SLOW],
'regress/regress-1200351': [PASS, ['mode == debug', SLOW]],
'regress/regress-crbug-474297': [PASS, ['mode == debug', SLOW]],
'strong/load-element-mutate-backing-store': [PASS, SLOW],
# TODO(titzer): correct WASM adapter frame alignment on arm64
'wasm/*': [PASS, ['arch == arm64', SKIP]],

View File

@ -600,37 +600,34 @@ TEST_F(JSTypedLoweringTest, JSLoadPropertyFromExternalTypedArray) {
NewArrayBuffer(backing_store, sizeof(backing_store));
VectorSlotPair feedback;
TRACED_FOREACH(ExternalArrayType, type, kExternalArrayTypes) {
TRACED_FOREACH(LanguageMode, language_mode, kLanguageModes) {
Handle<JSTypedArray> array =
factory()->NewJSTypedArray(type, buffer, 0, kLength);
int const element_size = static_cast<int>(array->element_size());
Handle<JSTypedArray> array =
factory()->NewJSTypedArray(type, buffer, 0, kLength);
int const element_size = static_cast<int>(array->element_size());
Node* key = Parameter(
Type::Range(kMinInt / element_size, kMaxInt / element_size, zone()));
Node* base = HeapConstant(array);
Node* vector = UndefinedConstant();
Node* context = UndefinedConstant();
Node* effect = graph()->start();
Node* control = graph()->start();
Reduction r = Reduce(
graph()->NewNode(javascript()->LoadProperty(language_mode, feedback),
base, key, vector, context, EmptyFrameState(),
EmptyFrameState(), effect, control));
Node* key = Parameter(
Type::Range(kMinInt / element_size, kMaxInt / element_size, zone()));
Node* base = HeapConstant(array);
Node* vector = UndefinedConstant();
Node* context = UndefinedConstant();
Node* effect = graph()->start();
Node* control = graph()->start();
Reduction r = Reduce(graph()->NewNode(
javascript()->LoadProperty(feedback), base, key, vector, context,
EmptyFrameState(), EmptyFrameState(), effect, control));
Matcher<Node*> offset_matcher =
element_size == 1
? key
: IsWord32Shl(key, IsInt32Constant(WhichPowerOf2(element_size)));
Matcher<Node*> offset_matcher =
element_size == 1
? key
: IsWord32Shl(key, IsInt32Constant(WhichPowerOf2(element_size)));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(
r.replacement(),
IsLoadBuffer(BufferAccess(type),
IsIntPtrConstant(bit_cast<intptr_t>(&backing_store[0])),
offset_matcher,
IsNumberConstant(array->byte_length()->Number()), effect,
control));
}
ASSERT_TRUE(r.Changed());
EXPECT_THAT(
r.replacement(),
IsLoadBuffer(BufferAccess(type),
IsIntPtrConstant(bit_cast<intptr_t>(&backing_store[0])),
offset_matcher,
IsNumberConstant(array->byte_length()->Number()), effect,
control));
}
}
@ -642,32 +639,29 @@ TEST_F(JSTypedLoweringTest, JSLoadPropertyFromExternalTypedArrayWithSafeKey) {
NewArrayBuffer(backing_store, sizeof(backing_store));
VectorSlotPair feedback;
TRACED_FOREACH(ExternalArrayType, type, kExternalArrayTypes) {
TRACED_FOREACH(LanguageMode, language_mode, kLanguageModes) {
Handle<JSTypedArray> array =
factory()->NewJSTypedArray(type, buffer, 0, kLength);
ElementAccess access = AccessBuilder::ForTypedArrayElement(type, true);
Handle<JSTypedArray> array =
factory()->NewJSTypedArray(type, buffer, 0, kLength);
ElementAccess access = AccessBuilder::ForTypedArrayElement(type, true);
int min = random_number_generator()->NextInt(static_cast<int>(kLength));
int max = random_number_generator()->NextInt(static_cast<int>(kLength));
if (min > max) std::swap(min, max);
Node* key = Parameter(Type::Range(min, max, zone()));
Node* base = HeapConstant(array);
Node* vector = UndefinedConstant();
Node* context = UndefinedConstant();
Node* effect = graph()->start();
Node* control = graph()->start();
Reduction r = Reduce(
graph()->NewNode(javascript()->LoadProperty(language_mode, feedback),
base, key, vector, context, EmptyFrameState(),
EmptyFrameState(), effect, control));
int min = random_number_generator()->NextInt(static_cast<int>(kLength));
int max = random_number_generator()->NextInt(static_cast<int>(kLength));
if (min > max) std::swap(min, max);
Node* key = Parameter(Type::Range(min, max, zone()));
Node* base = HeapConstant(array);
Node* vector = UndefinedConstant();
Node* context = UndefinedConstant();
Node* effect = graph()->start();
Node* control = graph()->start();
Reduction r = Reduce(graph()->NewNode(
javascript()->LoadProperty(feedback), base, key, vector, context,
EmptyFrameState(), EmptyFrameState(), effect, control));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(
r.replacement(),
IsLoadElement(access,
IsIntPtrConstant(bit_cast<intptr_t>(&backing_store[0])),
key, effect, control));
}
ASSERT_TRUE(r.Changed());
EXPECT_THAT(
r.replacement(),
IsLoadElement(access,
IsIntPtrConstant(bit_cast<intptr_t>(&backing_store[0])),
key, effect, control));
}
}
@ -820,15 +814,12 @@ TEST_F(JSTypedLoweringTest, JSLoadNamedStringLength) {
Node* const context = UndefinedConstant();
Node* const effect = graph()->start();
Node* const control = graph()->start();
TRACED_FOREACH(LanguageMode, language_mode, kLanguageModes) {
Reduction const r = Reduce(
graph()->NewNode(javascript()->LoadNamed(language_mode, name, feedback),
receiver, vector, context, EmptyFrameState(),
EmptyFrameState(), effect, control));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(), IsLoadField(AccessBuilder::ForStringLength(),
receiver, effect, control));
}
Reduction const r = Reduce(graph()->NewNode(
javascript()->LoadNamed(name, feedback), receiver, vector, context,
EmptyFrameState(), EmptyFrameState(), effect, control));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(), IsLoadField(AccessBuilder::ForStringLength(),
receiver, effect, control));
}
@ -842,14 +833,11 @@ TEST_F(JSTypedLoweringTest, JSLoadNamedFunctionPrototype) {
Node* const context = Parameter(Type::Internal(), 2);
Node* const effect = graph()->start();
Node* const control = graph()->start();
TRACED_FOREACH(LanguageMode, language_mode, kLanguageModes) {
Reduction const r = Reduce(
graph()->NewNode(javascript()->LoadNamed(language_mode, name, feedback),
receiver, vector, context, EmptyFrameState(),
EmptyFrameState(), effect, control));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(), IsHeapConstant(function_prototype));
}
Reduction const r = Reduce(graph()->NewNode(
javascript()->LoadNamed(name, feedback), receiver, vector, context,
EmptyFrameState(), EmptyFrameState(), effect, control));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(), IsHeapConstant(function_prototype));
}

View File

@ -57,11 +57,8 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
// Emit global load / store operations.
Factory* factory = isolate()->factory();
Handle<String> name = factory->NewStringFromStaticChars("var_name");
builder.LoadGlobal(name, 1, LanguageMode::SLOPPY,
TypeofMode::NOT_INSIDE_TYPEOF)
.LoadGlobal(name, 1, LanguageMode::STRICT, TypeofMode::NOT_INSIDE_TYPEOF)
.LoadGlobal(name, 1, LanguageMode::SLOPPY, TypeofMode::INSIDE_TYPEOF)
.LoadGlobal(name, 1, LanguageMode::STRICT, TypeofMode::INSIDE_TYPEOF)
builder.LoadGlobal(name, 1, TypeofMode::NOT_INSIDE_TYPEOF)
.LoadGlobal(name, 1, TypeofMode::INSIDE_TYPEOF)
.StoreGlobal(name, 1, LanguageMode::SLOPPY)
.StoreGlobal(name, 1, LanguageMode::STRICT);
@ -72,12 +69,10 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
.StoreContextSlot(reg, 1);
// Emit load / store property operations.
builder.LoadNamedProperty(reg, name, 0, LanguageMode::SLOPPY)
.LoadKeyedProperty(reg, 0, LanguageMode::SLOPPY)
builder.LoadNamedProperty(reg, name, 0)
.LoadKeyedProperty(reg, 0)
.StoreNamedProperty(reg, name, 0, LanguageMode::SLOPPY)
.StoreKeyedProperty(reg, reg, 0, LanguageMode::SLOPPY)
.LoadNamedProperty(reg, name, 0, LanguageMode::STRICT)
.LoadKeyedProperty(reg, 0, LanguageMode::STRICT)
.StoreNamedProperty(reg, name, 0, LanguageMode::STRICT)
.StoreKeyedProperty(reg, reg, 0, LanguageMode::STRICT);
@ -224,22 +219,16 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
Handle<String> wide_name = factory->NewStringFromStaticChars("var_wide_name");
// Emit wide global load / store operations.
builder.LoadGlobal(name, 1024, LanguageMode::SLOPPY,
TypeofMode::NOT_INSIDE_TYPEOF)
.LoadGlobal(wide_name, 1, LanguageMode::STRICT,
TypeofMode::NOT_INSIDE_TYPEOF)
.LoadGlobal(name, 1024, LanguageMode::SLOPPY, TypeofMode::INSIDE_TYPEOF)
.LoadGlobal(wide_name, 1, LanguageMode::STRICT, TypeofMode::INSIDE_TYPEOF)
builder.LoadGlobal(name, 1024, TypeofMode::NOT_INSIDE_TYPEOF)
.LoadGlobal(name, 1024, TypeofMode::INSIDE_TYPEOF)
.StoreGlobal(name, 1024, LanguageMode::SLOPPY)
.StoreGlobal(wide_name, 1, LanguageMode::STRICT);
// Emit wide load / store property operations.
builder.LoadNamedProperty(reg, wide_name, 0, LanguageMode::SLOPPY)
.LoadKeyedProperty(reg, 2056, LanguageMode::SLOPPY)
builder.LoadNamedProperty(reg, wide_name, 0)
.LoadKeyedProperty(reg, 2056)
.StoreNamedProperty(reg, wide_name, 0, LanguageMode::SLOPPY)
.StoreKeyedProperty(reg, reg, 2056, LanguageMode::SLOPPY)
.LoadNamedProperty(reg, wide_name, 0, LanguageMode::STRICT)
.LoadKeyedProperty(reg, 2056, LanguageMode::STRICT)
.StoreNamedProperty(reg, wide_name, 0, LanguageMode::STRICT)
.StoreKeyedProperty(reg, reg, 2056, LanguageMode::STRICT);

View File

@ -42,7 +42,7 @@ TEST_F(BytecodeArrayIteratorTest, IteratesBytecodeArray) {
.LoadLiteral(smi_0)
.LoadLiteral(smi_1)
.LoadAccumulatorWithRegister(reg_0)
.LoadNamedProperty(reg_1, name, feedback_slot, LanguageMode::SLOPPY)
.LoadNamedProperty(reg_1, name, feedback_slot)
.StoreAccumulatorInRegister(reg_2)
.CallRuntime(Runtime::kLoadIC_Miss, reg_0, 1)
.Debugger()
@ -79,7 +79,7 @@ TEST_F(BytecodeArrayIteratorTest, IteratesBytecodeArray) {
CHECK(!iterator.done());
iterator.Advance();
CHECK_EQ(iterator.current_bytecode(), Bytecode::kLoadICSloppy);
CHECK_EQ(iterator.current_bytecode(), Bytecode::kLoadIC);
CHECK_EQ(iterator.GetRegisterOperand(0).index(), reg_1.index());
CHECK_EQ(iterator.GetIndexOperand(1), name_index);
CHECK_EQ(iterator.GetIndexOperand(2), feedback_slot);