Reviewers: Toon Verwaest,

Message:
Toon: PTAL.

Arv: FYI.

Description:
Fix performance regression introduced in r28961

where bound functions' length was made configurable. The bootstrapper must be
kept in sync to avoid polymorphism.

BUG=chromium:500686
LOG=n
R=verwa...@chromium.org

Please review this at https://codereview.chromium.org/1221383003/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+4, -1 lines):
  M src/bootstrapper.cc
  M src/runtime/runtime-function.cc


Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 7148eab8ba8889fafe8273417a82489b400fc8b5..983da4787fe5a3064b3369e7e8f550544c8beeea 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -598,7 +598,7 @@ void Genesis::SetStrictFunctionInstanceDescriptor(Handle<Map> map,
   // Add length.
   if (function_mode == BOUND_FUNCTION) {
     Handle<String> length_string = isolate()->factory()->length_string();
- DataDescriptor d(length_string, 0, ro_attribs, Representation::Tagged()); + DataDescriptor d(length_string, 0, roc_attribs, Representation::Tagged());
     map->AppendDescriptor(&d);
   } else {
     DCHECK(function_mode == FUNCTION_WITH_WRITEABLE_PROTOTYPE ||
Index: src/runtime/runtime-function.cc
diff --git a/src/runtime/runtime-function.cc b/src/runtime/runtime-function.cc index d644d37e42b2fff45685eb2c7604c5c68c801a3d..89dd72c074e49fcdbdac211da6b3f38236a56f43 100644
--- a/src/runtime/runtime-function.cc
+++ b/src/runtime/runtime-function.cc
@@ -447,6 +447,9 @@ RUNTIME_FUNCTION(Runtime_FunctionBindArguments) {
       isolate->native_context()->bound_function_map());
   JSObject::MigrateToMap(bound_function, bound_function_map);
   Handle<String> length_string = isolate->factory()->length_string();
+  // These attributes must be kept in sync with how the bootstrapper
+  // configures the bound_function_map retrieved above.
+  // We use ...IgnoreAttributes() here because of length's read-onliness.
   PropertyAttributes attr =
       static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY);
   RETURN_FAILURE_ON_EXCEPTION(


--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to