Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(376)

Side by Side Diff: src/bootstrapper.cc

Issue 2504263004: [crankshaft] No need to rely on the @@hasInstance protector. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/contexts.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/bootstrapper.h" 5 #include "src/bootstrapper.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/base/ieee754.h" 9 #include "src/base/ieee754.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after
1250 Builtins::kFunctionPrototypeCall, 1, false); 1250 Builtins::kFunctionPrototypeCall, 1, false);
1251 SimpleInstallFunction(prototype, factory->toString_string(), 1251 SimpleInstallFunction(prototype, factory->toString_string(),
1252 Builtins::kFunctionPrototypeToString, 0, false); 1252 Builtins::kFunctionPrototypeToString, 0, false);
1253 1253
1254 // Install the @@hasInstance function. 1254 // Install the @@hasInstance function.
1255 Handle<JSFunction> has_instance = InstallFunction( 1255 Handle<JSFunction> has_instance = InstallFunction(
1256 prototype, factory->has_instance_symbol(), JS_OBJECT_TYPE, 1256 prototype, factory->has_instance_symbol(), JS_OBJECT_TYPE,
1257 JSObject::kHeaderSize, MaybeHandle<JSObject>(), 1257 JSObject::kHeaderSize, MaybeHandle<JSObject>(),
1258 Builtins::kFunctionPrototypeHasInstance, 1258 Builtins::kFunctionPrototypeHasInstance,
1259 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY)); 1259 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY));
1260 native_context()->set_function_has_instance(*has_instance);
1260 1261
1261 // Set the expected parameters for @@hasInstance to 1; required by builtin. 1262 // Set the expected parameters for @@hasInstance to 1; required by builtin.
1262 has_instance->shared()->set_internal_formal_parameter_count(1); 1263 has_instance->shared()->set_internal_formal_parameter_count(1);
1263 1264
1264 // Set the length for the function to satisfy ECMA-262. 1265 // Set the length for the function to satisfy ECMA-262.
1265 has_instance->shared()->set_length(1); 1266 has_instance->shared()->set_length(1);
1266 1267
1267 // Install the "constructor" property on the %FunctionPrototype%. 1268 // Install the "constructor" property on the %FunctionPrototype%.
1268 JSObject::AddProperty(prototype, factory->constructor_string(), 1269 JSObject::AddProperty(prototype, factory->constructor_string(),
1269 function_fun, DONT_ENUM); 1270 function_fun, DONT_ENUM);
(...skipping 3295 matching lines...) Expand 10 before | Expand all | Expand 10 after
4565 } 4566 }
4566 4567
4567 4568
4568 // Called when the top-level V8 mutex is destroyed. 4569 // Called when the top-level V8 mutex is destroyed.
4569 void Bootstrapper::FreeThreadResources() { 4570 void Bootstrapper::FreeThreadResources() {
4570 DCHECK(!IsActive()); 4571 DCHECK(!IsActive());
4571 } 4572 }
4572 4573
4573 } // namespace internal 4574 } // namespace internal
4574 } // namespace v8 4575 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/contexts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698