Commit 5eec7df9 authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Set proper representation for initial arguments length.

The JSArgumentsObject::length representation is initially Smi, so we can
record that on the initial map and use it to optimize the accesses in
TurboFan based on that. Similar for JSSloppyArgumentsObject::caller.

BUG=v8:6262
R=yangguo@chromium.org

Review-Url: https://codereview.chromium.org/2810333004
Cr-Commit-Position: refs/heads/master@{#44644}
parent c80c0f11
...@@ -3029,13 +3029,13 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object, ...@@ -3029,13 +3029,13 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
{ // length { // length
Descriptor d = Descriptor::DataField( Descriptor d = Descriptor::DataField(
factory->length_string(), JSSloppyArgumentsObject::kLengthIndex, factory->length_string(), JSSloppyArgumentsObject::kLengthIndex,
DONT_ENUM, Representation::Tagged()); DONT_ENUM, Representation::Smi());
map->AppendDescriptor(&d); map->AppendDescriptor(&d);
} }
{ // callee { // callee
Descriptor d = Descriptor::DataField( Descriptor d = Descriptor::DataField(
factory->callee_string(), JSSloppyArgumentsObject::kCalleeIndex, factory->callee_string(), JSSloppyArgumentsObject::kCalleeIndex,
DONT_ENUM, Representation::Tagged()); DONT_ENUM, Representation::HeapObject());
map->AppendDescriptor(&d); map->AppendDescriptor(&d);
} }
// @@iterator method is added later. // @@iterator method is added later.
...@@ -3086,7 +3086,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object, ...@@ -3086,7 +3086,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
{ // length { // length
Descriptor d = Descriptor::DataField( Descriptor d = Descriptor::DataField(
factory->length_string(), JSStrictArgumentsObject::kLengthIndex, factory->length_string(), JSStrictArgumentsObject::kLengthIndex,
DONT_ENUM, Representation::Tagged()); DONT_ENUM, Representation::Smi());
map->AppendDescriptor(&d); map->AppendDescriptor(&d);
} }
{ // callee { // callee
......
...@@ -716,8 +716,8 @@ FieldAccess AccessBuilder::ForValue() { ...@@ -716,8 +716,8 @@ FieldAccess AccessBuilder::ForValue() {
FieldAccess AccessBuilder::ForArgumentsLength() { FieldAccess AccessBuilder::ForArgumentsLength() {
FieldAccess access = {kTaggedBase, JSArgumentsObject::kLengthOffset, FieldAccess access = {kTaggedBase, JSArgumentsObject::kLengthOffset,
Handle<Name>(), MaybeHandle<Map>(), Handle<Name>(), MaybeHandle<Map>(),
Type::NonInternal(), MachineType::AnyTagged(), Type::SignedSmall(), MachineType::TaggedSigned(),
kFullWriteBarrier}; kNoWriteBarrier};
return access; return access;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment