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

Side by Side Diff: src/bootstrapper.cc

Issue 1692713005: ES6: Desugaring of instanceof to support @@hasInstance (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@blah
Patch Set: Fixed todos. Created 4 years, 10 months 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
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/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/extensions/externalize-string-extension.h" 10 #include "src/extensions/externalize-string-extension.h"
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1154 JSObject::kHeaderSize, MaybeHandle<JSObject>(), 1154 JSObject::kHeaderSize, MaybeHandle<JSObject>(),
1155 Builtins::kFunctionHasInstance, 1155 Builtins::kFunctionHasInstance,
1156 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY)); 1156 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY));
1157 1157
1158 // Set the expected parameters for @@hasInstance to 1; required by builtin. 1158 // Set the expected parameters for @@hasInstance to 1; required by builtin.
1159 has_instance->shared()->set_internal_formal_parameter_count(1); 1159 has_instance->shared()->set_internal_formal_parameter_count(1);
1160 1160
1161 // Set the length for the function to satisfy ECMA-262. 1161 // Set the length for the function to satisfy ECMA-262.
1162 has_instance->shared()->set_length(1); 1162 has_instance->shared()->set_length(1);
1163 1163
1164 // Install in the native context
1165 native_context()->set_ordinary_has_instance(*has_instance);
1166
1164 // Install the "constructor" property on the %FunctionPrototype%. 1167 // Install the "constructor" property on the %FunctionPrototype%.
1165 JSObject::AddProperty(prototype, factory->constructor_string(), 1168 JSObject::AddProperty(prototype, factory->constructor_string(),
1166 function_fun, DONT_ENUM); 1169 function_fun, DONT_ENUM);
1167 1170
1168 sloppy_function_map_writable_prototype_->SetConstructor(*function_fun); 1171 sloppy_function_map_writable_prototype_->SetConstructor(*function_fun);
1169 strict_function_map_writable_prototype_->SetConstructor(*function_fun); 1172 strict_function_map_writable_prototype_->SetConstructor(*function_fun);
1170 native_context()->strong_function_map()->SetConstructor(*function_fun); 1173 native_context()->strong_function_map()->SetConstructor(*function_fun);
1171 } 1174 }
1172 1175
1173 { // --- A r r a y --- 1176 { // --- A r r a y ---
(...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after
2482 JSGlobalObject::cast(native_context()->global_object())); 2485 JSGlobalObject::cast(native_context()->global_object()));
2483 Isolate* isolate = global->GetIsolate(); 2486 Isolate* isolate = global->GetIsolate();
2484 Factory* factory = isolate->factory(); 2487 Factory* factory = isolate->factory();
2485 2488
2486 Handle<JSFunction> object_function = isolate->object_function(); 2489 Handle<JSFunction> object_function = isolate->object_function();
2487 SimpleInstallFunction(object_function, 2490 SimpleInstallFunction(object_function,
2488 factory->getOwnPropertyDescriptors_string(), 2491 factory->getOwnPropertyDescriptors_string(),
2489 Builtins::kObjectGetOwnPropertyDescriptors, 1, false); 2492 Builtins::kObjectGetOwnPropertyDescriptors, 1, false);
2490 } 2493 }
2491 2494
2495 void Genesis::InitializeGlobal_harmony_instanceof() {
rossberg 2016/02/12 14:11:31 Use the EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE macro,
mvstanton 2016/02/18 02:12:17 Done.
2496 if (!FLAG_harmony_instanceof) return;
2497 }
2498
2492 void Genesis::InstallJSProxyMaps() { 2499 void Genesis::InstallJSProxyMaps() {
2493 // Allocate the different maps for all Proxy types. 2500 // Allocate the different maps for all Proxy types.
2494 // Next to the default proxy, we need maps indicating callable and 2501 // Next to the default proxy, we need maps indicating callable and
2495 // constructable proxies. 2502 // constructable proxies.
2496 2503
2497 Handle<Map> proxy_function_map = 2504 Handle<Map> proxy_function_map =
2498 Map::Copy(isolate()->sloppy_function_without_prototype_map(), "Proxy"); 2505 Map::Copy(isolate()->sloppy_function_without_prototype_map(), "Proxy");
2499 proxy_function_map->set_is_constructor(true); 2506 proxy_function_map->set_is_constructor(true);
2500 native_context()->set_proxy_function_map(*proxy_function_map); 2507 native_context()->set_proxy_function_map(*proxy_function_map);
2501 2508
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
2969 static const char* harmony_destructuring_assignment_natives[] = {nullptr}; 2976 static const char* harmony_destructuring_assignment_natives[] = {nullptr};
2970 static const char* harmony_object_observe_natives[] = { 2977 static const char* harmony_object_observe_natives[] = {
2971 "native harmony-object-observe.js", nullptr}; 2978 "native harmony-object-observe.js", nullptr};
2972 static const char* harmony_sharedarraybuffer_natives[] = { 2979 static const char* harmony_sharedarraybuffer_natives[] = {
2973 "native harmony-sharedarraybuffer.js", "native harmony-atomics.js", NULL}; 2980 "native harmony-sharedarraybuffer.js", "native harmony-atomics.js", NULL};
2974 static const char* harmony_simd_natives[] = {"native harmony-simd.js", 2981 static const char* harmony_simd_natives[] = {"native harmony-simd.js",
2975 nullptr}; 2982 nullptr};
2976 static const char* harmony_do_expressions_natives[] = {nullptr}; 2983 static const char* harmony_do_expressions_natives[] = {nullptr};
2977 static const char* harmony_regexp_subclass_natives[] = {nullptr}; 2984 static const char* harmony_regexp_subclass_natives[] = {nullptr};
2978 static const char* harmony_regexp_lookbehind_natives[] = {nullptr}; 2985 static const char* harmony_regexp_lookbehind_natives[] = {nullptr};
2986 static const char* harmony_instanceof_natives[] = {nullptr};
2979 static const char* harmony_regexp_property_natives[] = {nullptr}; 2987 static const char* harmony_regexp_property_natives[] = {nullptr};
2980 static const char* harmony_function_name_natives[] = {nullptr}; 2988 static const char* harmony_function_name_natives[] = {nullptr};
2981 static const char* harmony_function_sent_natives[] = {nullptr}; 2989 static const char* harmony_function_sent_natives[] = {nullptr};
2982 static const char* promise_extra_natives[] = {"native promise-extra.js", 2990 static const char* promise_extra_natives[] = {"native promise-extra.js",
2983 nullptr}; 2991 nullptr};
2984 static const char* harmony_object_values_entries_natives[] = {nullptr}; 2992 static const char* harmony_object_values_entries_natives[] = {nullptr};
2985 static const char* harmony_object_own_property_descriptors_natives[] = { 2993 static const char* harmony_object_own_property_descriptors_natives[] = {
2986 nullptr}; 2994 nullptr};
2987 2995
2988 for (int i = ExperimentalNatives::GetDebuggerCount(); 2996 for (int i = ExperimentalNatives::GetDebuggerCount();
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
3651 } 3659 }
3652 3660
3653 3661
3654 // Called when the top-level V8 mutex is destroyed. 3662 // Called when the top-level V8 mutex is destroyed.
3655 void Bootstrapper::FreeThreadResources() { 3663 void Bootstrapper::FreeThreadResources() {
3656 DCHECK(!IsActive()); 3664 DCHECK(!IsActive());
3657 } 3665 }
3658 3666
3659 } // namespace internal 3667 } // namespace internal
3660 } // namespace v8 3668 } // namespace v8
OLDNEW
« no previous file with comments | « src/ast/ast-value-factory.cc ('k') | src/contexts.h » ('j') | src/parsing/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698