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

Side by Side Diff: src/bootstrapper.cc

Issue 1781573003: Expose Array.prototype.values behind a flag and stage it (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | src/flag-definitions.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/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 2509 matching lines...) Expand 10 before | Expand all | Expand 10 after
2520 2520
2521 proxy_function->shared()->set_construct_stub( 2521 proxy_function->shared()->set_construct_stub(
2522 *isolate->builtins()->ProxyConstructor_ConstructStub()); 2522 *isolate->builtins()->ProxyConstructor_ConstructStub());
2523 proxy_function->shared()->set_internal_formal_parameter_count(2); 2523 proxy_function->shared()->set_internal_formal_parameter_count(2);
2524 proxy_function->shared()->set_length(2); 2524 proxy_function->shared()->set_length(2);
2525 2525
2526 native_context()->set_proxy_function(*proxy_function); 2526 native_context()->set_proxy_function(*proxy_function);
2527 InstallFunction(global, name, proxy_function, factory->Object_string()); 2527 InstallFunction(global, name, proxy_function, factory->Object_string());
2528 } 2528 }
2529 2529
2530 void Genesis::InitializeGlobal_harmony_array_prototype_values() {
2531 if (!FLAG_harmony_array_prototype_values) return;
2532 Handle<JSFunction> array_constructor(native_context()->array_function());
2533 Handle<JSObject> array_prototype(
2534 JSObject::cast(array_constructor->instance_prototype()));
2535 Handle<Object> values_iterator =
2536 JSObject::GetProperty(array_prototype, factory()->iterator_symbol())
2537 .ToHandleChecked();
2538 DCHECK(values_iterator->IsJSFunction());
2539 JSObject::AddProperty(array_prototype, factory()->values_string(),
2540 values_iterator, DONT_ENUM);
2541
2542 Handle<Object> unscopables =
2543 JSObject::GetProperty(array_prototype, factory()->unscopables_symbol())
2544 .ToHandleChecked();
2545 DCHECK(unscopables->IsJSObject());
2546 JSObject::AddProperty(Handle<JSObject>::cast(unscopables),
2547 factory()->values_string(), factory()->true_value(),
2548 NONE);
2549 }
2530 2550
2531 Handle<JSFunction> Genesis::InstallArrayBuffer(Handle<JSObject> target, 2551 Handle<JSFunction> Genesis::InstallArrayBuffer(Handle<JSObject> target,
2532 const char* name) { 2552 const char* name) {
2533 // Setup the {prototype} with the given {name} for @@toStringTag. 2553 // Setup the {prototype} with the given {name} for @@toStringTag.
2534 Handle<JSObject> prototype = 2554 Handle<JSObject> prototype =
2535 factory()->NewJSObject(isolate()->object_function(), TENURED); 2555 factory()->NewJSObject(isolate()->object_function(), TENURED);
2536 JSObject::AddProperty(prototype, factory()->to_string_tag_symbol(), 2556 JSObject::AddProperty(prototype, factory()->to_string_tag_symbol(),
2537 factory()->NewStringFromAsciiChecked(name), 2557 factory()->NewStringFromAsciiChecked(name),
2538 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); 2558 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY));
2539 2559
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
2960 static const char* harmony_instanceof_natives[] = {nullptr}; 2980 static const char* harmony_instanceof_natives[] = {nullptr};
2961 static const char* harmony_restrictive_declarations_natives[] = {nullptr}; 2981 static const char* harmony_restrictive_declarations_natives[] = {nullptr};
2962 static const char* harmony_regexp_property_natives[] = {nullptr}; 2982 static const char* harmony_regexp_property_natives[] = {nullptr};
2963 static const char* harmony_function_name_natives[] = {nullptr}; 2983 static const char* harmony_function_name_natives[] = {nullptr};
2964 static const char* harmony_function_sent_natives[] = {nullptr}; 2984 static const char* harmony_function_sent_natives[] = {nullptr};
2965 static const char* promise_extra_natives[] = {"native promise-extra.js", 2985 static const char* promise_extra_natives[] = {"native promise-extra.js",
2966 nullptr}; 2986 nullptr};
2967 static const char* harmony_object_values_entries_natives[] = {nullptr}; 2987 static const char* harmony_object_values_entries_natives[] = {nullptr};
2968 static const char* harmony_object_own_property_descriptors_natives[] = { 2988 static const char* harmony_object_own_property_descriptors_natives[] = {
2969 nullptr}; 2989 nullptr};
2990 static const char* harmony_array_prototype_values_natives[] = {nullptr};
2970 2991
2971 for (int i = ExperimentalNatives::GetDebuggerCount(); 2992 for (int i = ExperimentalNatives::GetDebuggerCount();
2972 i < ExperimentalNatives::GetBuiltinsCount(); i++) { 2993 i < ExperimentalNatives::GetBuiltinsCount(); i++) {
2973 #define INSTALL_EXPERIMENTAL_NATIVES(id, desc) \ 2994 #define INSTALL_EXPERIMENTAL_NATIVES(id, desc) \
2974 if (FLAG_##id) { \ 2995 if (FLAG_##id) { \
2975 for (size_t j = 0; id##_natives[j] != NULL; j++) { \ 2996 for (size_t j = 0; id##_natives[j] != NULL; j++) { \
2976 Vector<const char> script_name = ExperimentalNatives::GetScriptName(i); \ 2997 Vector<const char> script_name = ExperimentalNatives::GetScriptName(i); \
2977 if (strncmp(script_name.start(), id##_natives[j], \ 2998 if (strncmp(script_name.start(), id##_natives[j], \
2978 script_name.length()) == 0) { \ 2999 script_name.length()) == 0) { \
2979 if (!Bootstrapper::CompileExperimentalBuiltin(isolate(), i)) { \ 3000 if (!Bootstrapper::CompileExperimentalBuiltin(isolate(), i)) { \
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
3633 } 3654 }
3634 3655
3635 3656
3636 // Called when the top-level V8 mutex is destroyed. 3657 // Called when the top-level V8 mutex is destroyed.
3637 void Bootstrapper::FreeThreadResources() { 3658 void Bootstrapper::FreeThreadResources() {
3638 DCHECK(!IsActive()); 3659 DCHECK(!IsActive());
3639 } 3660 }
3640 3661
3641 } // namespace internal 3662 } // namespace internal
3642 } // namespace v8 3663 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698