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

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: Execution::ToObject() -> Object::ToObject(), test fixups 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') | 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 2433 matching lines...) Expand 10 before | Expand all | Expand 10 after
2444 Handle<JSFunction> type##_function = InstallFunction( \ 2444 Handle<JSFunction> type##_function = InstallFunction( \
2445 simd_object, #Type, JS_VALUE_TYPE, JSValue::kSize, \ 2445 simd_object, #Type, JS_VALUE_TYPE, JSValue::kSize, \
2446 isolate->initial_object_prototype(), Builtins::kIllegal); \ 2446 isolate->initial_object_prototype(), Builtins::kIllegal); \
2447 native_context()->set_##type##_function(*type##_function); \ 2447 native_context()->set_##type##_function(*type##_function); \
2448 type##_function->shared()->set_instance_class_name(*factory->Type##_string()); 2448 type##_function->shared()->set_instance_class_name(*factory->Type##_string());
2449 SIMD128_TYPES(SIMD128_INSTALL_FUNCTION) 2449 SIMD128_TYPES(SIMD128_INSTALL_FUNCTION)
2450 #undef SIMD128_INSTALL_FUNCTION 2450 #undef SIMD128_INSTALL_FUNCTION
2451 } 2451 }
2452 2452
2453 2453
2454 void Genesis::InitializeGlobal_harmony_object_values_entries() {
2455 if (!FLAG_harmony_object_values_entries) return;
2456
2457 Handle<JSGlobalObject> global(
2458 JSGlobalObject::cast(native_context()->global_object()));
2459 Isolate* isolate = global->GetIsolate();
2460 Factory* factory = isolate->factory();
2461
2462 Handle<JSFunction> object_function = isolate->object_function();
2463 SimpleInstallFunction(object_function, factory->entries_string(),
2464 Builtins::kObjectEntries, 1, false);
2465 SimpleInstallFunction(object_function, factory->values_string(),
2466 Builtins::kObjectValues, 1, false);
2467 }
2468
2469
2454 void Genesis::InstallJSProxyMaps() { 2470 void Genesis::InstallJSProxyMaps() {
2455 // Allocate the different maps for all Proxy types. 2471 // Allocate the different maps for all Proxy types.
2456 // Next to the default proxy, we need maps indicating callable and 2472 // Next to the default proxy, we need maps indicating callable and
2457 // constructable proxies. 2473 // constructable proxies.
2458 2474
2459 Handle<Map> proxy_function_map = 2475 Handle<Map> proxy_function_map =
2460 Map::Copy(isolate()->sloppy_function_without_prototype_map(), "Proxy"); 2476 Map::Copy(isolate()->sloppy_function_without_prototype_map(), "Proxy");
2461 proxy_function_map->set_is_constructor(true); 2477 proxy_function_map->set_is_constructor(true);
2462 native_context()->set_proxy_function_map(*proxy_function_map); 2478 native_context()->set_proxy_function_map(*proxy_function_map);
2463 2479
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
2933 static const char* harmony_simd_natives[] = {"native harmony-simd.js", 2949 static const char* harmony_simd_natives[] = {"native harmony-simd.js",
2934 nullptr}; 2950 nullptr};
2935 static const char* harmony_tolength_natives[] = {nullptr}; 2951 static const char* harmony_tolength_natives[] = {nullptr};
2936 static const char* harmony_completion_natives[] = {nullptr}; 2952 static const char* harmony_completion_natives[] = {nullptr};
2937 static const char* harmony_do_expressions_natives[] = {nullptr}; 2953 static const char* harmony_do_expressions_natives[] = {nullptr};
2938 static const char* harmony_regexp_subclass_natives[] = {nullptr}; 2954 static const char* harmony_regexp_subclass_natives[] = {nullptr};
2939 static const char* harmony_regexp_lookbehind_natives[] = {nullptr}; 2955 static const char* harmony_regexp_lookbehind_natives[] = {nullptr};
2940 static const char* harmony_function_name_natives[] = {nullptr}; 2956 static const char* harmony_function_name_natives[] = {nullptr};
2941 static const char* promise_extra_natives[] = {"native promise-extra.js", 2957 static const char* promise_extra_natives[] = {"native promise-extra.js",
2942 nullptr}; 2958 nullptr};
2959 static const char* harmony_object_values_entries_natives[] = {nullptr};
2943 2960
2944 for (int i = ExperimentalNatives::GetDebuggerCount(); 2961 for (int i = ExperimentalNatives::GetDebuggerCount();
2945 i < ExperimentalNatives::GetBuiltinsCount(); i++) { 2962 i < ExperimentalNatives::GetBuiltinsCount(); i++) {
2946 #define INSTALL_EXPERIMENTAL_NATIVES(id, desc) \ 2963 #define INSTALL_EXPERIMENTAL_NATIVES(id, desc) \
2947 if (FLAG_##id) { \ 2964 if (FLAG_##id) { \
2948 for (size_t j = 0; id##_natives[j] != NULL; j++) { \ 2965 for (size_t j = 0; id##_natives[j] != NULL; j++) { \
2949 Vector<const char> script_name = ExperimentalNatives::GetScriptName(i); \ 2966 Vector<const char> script_name = ExperimentalNatives::GetScriptName(i); \
2950 if (strncmp(script_name.start(), id##_natives[j], \ 2967 if (strncmp(script_name.start(), id##_natives[j], \
2951 script_name.length()) == 0) { \ 2968 script_name.length()) == 0) { \
2952 if (!Bootstrapper::CompileExperimentalBuiltin(isolate(), i)) { \ 2969 if (!Bootstrapper::CompileExperimentalBuiltin(isolate(), i)) { \
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
3608 } 3625 }
3609 3626
3610 3627
3611 // Called when the top-level V8 mutex is destroyed. 3628 // Called when the top-level V8 mutex is destroyed.
3612 void Bootstrapper::FreeThreadResources() { 3629 void Bootstrapper::FreeThreadResources() {
3613 DCHECK(!IsActive()); 3630 DCHECK(!IsActive());
3614 } 3631 }
3615 3632
3616 } // namespace internal 3633 } // namespace internal
3617 } // namespace v8 3634 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698