Commit 597af292 authored by jkummerow's avatar jkummerow Committed by Commit bot

Fix performance regression introduced in r29558

where bound functions started overriding the "name" accessor property with a data property. The bootstrapper must be kept in sync to avoid polymorphism.

BUG=chromium:509983
LOG=n
R=verwaest@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#29685}
parent 24e98281
...@@ -625,27 +625,35 @@ void Genesis::SetStrictFunctionInstanceDescriptor(Handle<Map> map, ...@@ -625,27 +625,35 @@ void Genesis::SetStrictFunctionInstanceDescriptor(Handle<Map> map,
PropertyAttributes roc_attribs = PropertyAttributes roc_attribs =
static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY); static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY);
// Add length.
if (function_mode == BOUND_FUNCTION) { if (function_mode == BOUND_FUNCTION) {
Handle<String> length_string = isolate()->factory()->length_string(); { // Add length.
DataDescriptor d(length_string, 0, roc_attribs, Representation::Tagged()); Handle<String> length_string = isolate()->factory()->length_string();
map->AppendDescriptor(&d); DataDescriptor d(length_string, 0, roc_attribs, Representation::Tagged());
map->AppendDescriptor(&d);
}
{ // Add name.
Handle<String> name_string = isolate()->factory()->name_string();
DataDescriptor d(name_string, 1, roc_attribs, Representation::Tagged());
map->AppendDescriptor(&d);
}
} else { } else {
DCHECK(function_mode == FUNCTION_WITH_WRITEABLE_PROTOTYPE || DCHECK(function_mode == FUNCTION_WITH_WRITEABLE_PROTOTYPE ||
function_mode == FUNCTION_WITH_READONLY_PROTOTYPE || function_mode == FUNCTION_WITH_READONLY_PROTOTYPE ||
function_mode == FUNCTION_WITHOUT_PROTOTYPE); function_mode == FUNCTION_WITHOUT_PROTOTYPE);
Handle<AccessorInfo> length = { // Add length.
Accessors::FunctionLengthInfo(isolate(), roc_attribs); Handle<AccessorInfo> length =
AccessorConstantDescriptor d(Handle<Name>(Name::cast(length->name())), Accessors::FunctionLengthInfo(isolate(), roc_attribs);
length, roc_attribs); AccessorConstantDescriptor d(Handle<Name>(Name::cast(length->name())),
map->AppendDescriptor(&d); length, roc_attribs);
} map->AppendDescriptor(&d);
Handle<AccessorInfo> name = }
Accessors::FunctionNameInfo(isolate(), roc_attribs); { // Add name.
{ // Add name. Handle<AccessorInfo> name =
AccessorConstantDescriptor d(Handle<Name>(Name::cast(name->name())), name, Accessors::FunctionNameInfo(isolate(), roc_attribs);
roc_attribs); AccessorConstantDescriptor d(Handle<Name>(Name::cast(name->name())), name,
map->AppendDescriptor(&d); roc_attribs);
map->AppendDescriptor(&d);
}
} }
if (IsFunctionModeWithPrototype(function_mode)) { if (IsFunctionModeWithPrototype(function_mode)) {
// Add prototype. // Add prototype.
......
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