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

Side by Side Diff: src/bootstrapper.cc

Issue 1581033002: [es7] implement Object.values() / Object.entries() proposal (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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/builtins.h » ('j') | src/flag-definitions.h » ('J')
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 2419 matching lines...) Expand 10 before | Expand all | Expand 10 after
2430 Handle<JSFunction> type##_function = InstallFunction( \ 2430 Handle<JSFunction> type##_function = InstallFunction( \
2431 simd_object, #Type, JS_VALUE_TYPE, JSValue::kSize, \ 2431 simd_object, #Type, JS_VALUE_TYPE, JSValue::kSize, \
2432 isolate->initial_object_prototype(), Builtins::kIllegal); \ 2432 isolate->initial_object_prototype(), Builtins::kIllegal); \
2433 native_context()->set_##type##_function(*type##_function); \ 2433 native_context()->set_##type##_function(*type##_function); \
2434 type##_function->shared()->set_instance_class_name(*factory->Type##_string()); 2434 type##_function->shared()->set_instance_class_name(*factory->Type##_string());
2435 SIMD128_TYPES(SIMD128_INSTALL_FUNCTION) 2435 SIMD128_TYPES(SIMD128_INSTALL_FUNCTION)
2436 #undef SIMD128_INSTALL_FUNCTION 2436 #undef SIMD128_INSTALL_FUNCTION
2437 } 2437 }
2438 2438
2439 2439
2440 void Genesis::InitializeGlobal_harmony_object_values() {
2441 if (!FLAG_harmony_object_values) return;
2442
2443 Handle<JSGlobalObject> global(
2444 JSGlobalObject::cast(native_context()->global_object()));
2445 Isolate* isolate = global->GetIsolate();
2446 Factory* factory = isolate->factory();
2447
2448 Handle<JSFunction> object_function = isolate->object_function();
2449 SimpleInstallFunction(object_function, factory->entries_string(),
2450 Builtins::kObjectEntries, 1, false);
2451 SimpleInstallFunction(object_function, factory->values_string(),
2452 Builtins::kObjectValues, 1, false);
2453 }
2454
2455
2440 void Genesis::InstallJSProxyMaps() { 2456 void Genesis::InstallJSProxyMaps() {
2441 // Allocate the different maps for all Proxy types. 2457 // Allocate the different maps for all Proxy types.
2442 // Next to the default proxy, we need maps indicating callable and 2458 // Next to the default proxy, we need maps indicating callable and
2443 // constructable proxies. 2459 // constructable proxies.
2444 2460
2445 Handle<Map> proxy_function_map = 2461 Handle<Map> proxy_function_map =
2446 Map::Copy(isolate()->sloppy_function_without_prototype_map(), "Proxy"); 2462 Map::Copy(isolate()->sloppy_function_without_prototype_map(), "Proxy");
2447 proxy_function_map->set_is_constructor(); 2463 proxy_function_map->set_is_constructor();
2448 native_context()->set_proxy_function_map(*proxy_function_map); 2464 native_context()->set_proxy_function_map(*proxy_function_map);
2449 2465
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
2835 static const char* harmony_simd_natives[] = {"native harmony-simd.js", 2851 static const char* harmony_simd_natives[] = {"native harmony-simd.js",
2836 nullptr}; 2852 nullptr};
2837 static const char* harmony_tolength_natives[] = {nullptr}; 2853 static const char* harmony_tolength_natives[] = {nullptr};
2838 static const char* harmony_completion_natives[] = {nullptr}; 2854 static const char* harmony_completion_natives[] = {nullptr};
2839 static const char* harmony_do_expressions_natives[] = {nullptr}; 2855 static const char* harmony_do_expressions_natives[] = {nullptr};
2840 static const char* harmony_regexp_subclass_natives[] = {nullptr}; 2856 static const char* harmony_regexp_subclass_natives[] = {nullptr};
2841 static const char* harmony_regexp_lookbehind_natives[] = {nullptr}; 2857 static const char* harmony_regexp_lookbehind_natives[] = {nullptr};
2842 static const char* harmony_function_name_natives[] = {nullptr}; 2858 static const char* harmony_function_name_natives[] = {nullptr};
2843 static const char* promise_extra_natives[] = {"native promise-extra.js", 2859 static const char* promise_extra_natives[] = {"native promise-extra.js",
2844 nullptr}; 2860 nullptr};
2861 static const char* harmony_object_values_natives[] = {nullptr};
2845 2862
2846 for (int i = ExperimentalNatives::GetDebuggerCount(); 2863 for (int i = ExperimentalNatives::GetDebuggerCount();
2847 i < ExperimentalNatives::GetBuiltinsCount(); i++) { 2864 i < ExperimentalNatives::GetBuiltinsCount(); i++) {
2848 #define INSTALL_EXPERIMENTAL_NATIVES(id, desc) \ 2865 #define INSTALL_EXPERIMENTAL_NATIVES(id, desc) \
2849 if (FLAG_##id) { \ 2866 if (FLAG_##id) { \
2850 for (size_t j = 0; id##_natives[j] != NULL; j++) { \ 2867 for (size_t j = 0; id##_natives[j] != NULL; j++) { \
2851 Vector<const char> script_name = ExperimentalNatives::GetScriptName(i); \ 2868 Vector<const char> script_name = ExperimentalNatives::GetScriptName(i); \
2852 if (strncmp(script_name.start(), id##_natives[j], \ 2869 if (strncmp(script_name.start(), id##_natives[j], \
2853 script_name.length()) == 0) { \ 2870 script_name.length()) == 0) { \
2854 if (!Bootstrapper::CompileExperimentalBuiltin(isolate(), i)) { \ 2871 if (!Bootstrapper::CompileExperimentalBuiltin(isolate(), i)) { \
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
3510 } 3527 }
3511 3528
3512 3529
3513 // Called when the top-level V8 mutex is destroyed. 3530 // Called when the top-level V8 mutex is destroyed.
3514 void Bootstrapper::FreeThreadResources() { 3531 void Bootstrapper::FreeThreadResources() {
3515 DCHECK(!IsActive()); 3532 DCHECK(!IsActive());
3516 } 3533 }
3517 3534
3518 } // namespace internal 3535 } // namespace internal
3519 } // namespace v8 3536 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/builtins.h » ('j') | src/flag-definitions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698