Index: src/runtime/runtime-function.cc |
diff --git a/src/runtime/runtime-function.cc b/src/runtime/runtime-function.cc |
index c0a64425d4136331e64b0164207d133f254c234e..f994ee336561a3c51da186de4783480b75bf0a92 100644 |
--- a/src/runtime/runtime-function.cc |
+++ b/src/runtime/runtime-function.cc |
@@ -409,19 +409,18 @@ RUNTIME_FUNCTION(Runtime_FunctionBindArguments) { |
RUNTIME_ASSERT(bound_function->RemovePrototype()); |
// The new function should have the same [[Prototype]] as the bindee. |
- Handle<Map> bound_function_map( |
- isolate->native_context()->bound_function_map()); |
+ Handle<Map> bound_function_map = |
+ bindee->IsConstructor() |
+ ? isolate->bound_function_with_constructor_map() |
+ : isolate->bound_function_without_constructor_map(); |
PrototypeIterator iter(isolate, bindee); |
Handle<Object> proto = PrototypeIterator::GetCurrent(iter); |
if (bound_function_map->prototype() != *proto) { |
bound_function_map = Map::TransitionToPrototype(bound_function_map, proto, |
REGULAR_PROTOTYPE); |
} |
- if (bound_function_map->is_constructor() != bindee->IsConstructor()) { |
- bound_function_map = Map::Copy(bound_function_map, "IsConstructor"); |
- bound_function_map->set_is_constructor(bindee->IsConstructor()); |
- } |
JSObject::MigrateToMap(bound_function, bound_function_map); |
+ DCHECK_EQ(bindee->IsConstructor(), bound_function->IsConstructor()); |
Handle<String> length_string = isolate->factory()->length_string(); |
// These attributes must be kept in sync with how the bootstrapper |