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

Side by Side Diff: src/bootstrapper.cc

Issue 1106633002: Wrap messages implementation in a function. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@messages_5
Patch Set: fix and rebase Created 5 years, 8 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 | « src/api.cc ('k') | src/heap/heap.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/utils/random-number-generator.h" 9 #include "src/base/utils/random-number-generator.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 1526 matching lines...) Expand 10 before | Expand all | Expand 10 after
1537 .ToHandleChecked(); \ 1537 .ToHandleChecked(); \
1538 native_context()->set_##var(Type::cast(*var##_native)); 1538 native_context()->set_##var(Type::cast(*var##_native));
1539 1539
1540 1540
1541 void Genesis::InstallNativeFunctions() { 1541 void Genesis::InstallNativeFunctions() {
1542 HandleScope scope(isolate()); 1542 HandleScope scope(isolate());
1543 INSTALL_NATIVE(JSFunction, "$createDate", create_date_fun); 1543 INSTALL_NATIVE(JSFunction, "$createDate", create_date_fun);
1544 1544
1545 INSTALL_NATIVE(JSFunction, "ToNumber", to_number_fun); 1545 INSTALL_NATIVE(JSFunction, "ToNumber", to_number_fun);
1546 INSTALL_NATIVE(JSFunction, "ToString", to_string_fun); 1546 INSTALL_NATIVE(JSFunction, "ToString", to_string_fun);
1547 INSTALL_NATIVE(JSFunction, "ToDetailString", to_detail_string_fun); 1547 INSTALL_NATIVE(JSFunction, "$toDetailString", to_detail_string_fun);
1548 INSTALL_NATIVE(JSFunction, "ToObject", to_object_fun); 1548 INSTALL_NATIVE(JSFunction, "ToObject", to_object_fun);
1549 INSTALL_NATIVE(JSFunction, "ToInteger", to_integer_fun); 1549 INSTALL_NATIVE(JSFunction, "ToInteger", to_integer_fun);
1550 INSTALL_NATIVE(JSFunction, "ToUint32", to_uint32_fun); 1550 INSTALL_NATIVE(JSFunction, "ToUint32", to_uint32_fun);
1551 INSTALL_NATIVE(JSFunction, "ToInt32", to_int32_fun); 1551 INSTALL_NATIVE(JSFunction, "ToInt32", to_int32_fun);
1552 INSTALL_NATIVE(JSFunction, "ToLength", to_length_fun); 1552 INSTALL_NATIVE(JSFunction, "ToLength", to_length_fun);
1553 1553
1554 INSTALL_NATIVE(JSFunction, "GlobalEval", global_eval_fun); 1554 INSTALL_NATIVE(JSFunction, "GlobalEval", global_eval_fun);
1555 INSTALL_NATIVE(JSFunction, "GetStackTraceLine", get_stack_trace_line_fun); 1555 INSTALL_NATIVE(JSFunction, "$getStackTraceLine", get_stack_trace_line_fun);
1556 INSTALL_NATIVE(JSFunction, "ToCompletePropertyDescriptor", 1556 INSTALL_NATIVE(JSFunction, "ToCompletePropertyDescriptor",
1557 to_complete_property_descriptor); 1557 to_complete_property_descriptor);
1558 1558
1559 INSTALL_NATIVE(Symbol, "$promiseStatus", promise_status); 1559 INSTALL_NATIVE(Symbol, "$promiseStatus", promise_status);
1560 INSTALL_NATIVE(JSFunction, "$promiseCreate", promise_create); 1560 INSTALL_NATIVE(JSFunction, "$promiseCreate", promise_create);
1561 INSTALL_NATIVE(JSFunction, "$promiseResolve", promise_resolve); 1561 INSTALL_NATIVE(JSFunction, "$promiseResolve", promise_resolve);
1562 INSTALL_NATIVE(JSFunction, "$promiseReject", promise_reject); 1562 INSTALL_NATIVE(JSFunction, "$promiseReject", promise_reject);
1563 INSTALL_NATIVE(JSFunction, "$promiseChain", promise_chain); 1563 INSTALL_NATIVE(JSFunction, "$promiseChain", promise_chain);
1564 INSTALL_NATIVE(JSFunction, "$promiseCatch", promise_catch); 1564 INSTALL_NATIVE(JSFunction, "$promiseCatch", promise_catch);
1565 INSTALL_NATIVE(JSFunction, "$promiseThen", promise_then); 1565 INSTALL_NATIVE(JSFunction, "$promiseThen", promise_then);
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
2468 if (natives->AsArrayIndex(&dummy_index)) return true; 2468 if (natives->AsArrayIndex(&dummy_index)) return true;
2469 JSObject::AddProperty(global, natives, handle(global->builtins()), 2469 JSObject::AddProperty(global, natives, handle(global->builtins()),
2470 DONT_ENUM); 2470 DONT_ENUM);
2471 } 2471 }
2472 2472
2473 // Expose the stack trace symbol to native JS. 2473 // Expose the stack trace symbol to native JS.
2474 RETURN_ON_EXCEPTION_VALUE(isolate, 2474 RETURN_ON_EXCEPTION_VALUE(isolate,
2475 JSObject::SetOwnPropertyIgnoreAttributes( 2475 JSObject::SetOwnPropertyIgnoreAttributes(
2476 handle(native_context->builtins(), isolate), 2476 handle(native_context->builtins(), isolate),
2477 factory->InternalizeOneByteString( 2477 factory->InternalizeOneByteString(
2478 STATIC_CHAR_VECTOR("stack_trace_symbol")), 2478 STATIC_CHAR_VECTOR("$stackTraceSymbol")),
2479 factory->stack_trace_symbol(), NONE), 2479 factory->stack_trace_symbol(), NONE),
2480 false); 2480 false);
2481 2481
2482 // Expose the debug global object in global if a name for it is specified. 2482 // Expose the debug global object in global if a name for it is specified.
2483 if (FLAG_expose_debug_as != NULL && strlen(FLAG_expose_debug_as) != 0) { 2483 if (FLAG_expose_debug_as != NULL && strlen(FLAG_expose_debug_as) != 0) {
2484 // If loading fails we just bail out without installing the 2484 // If loading fails we just bail out without installing the
2485 // debugger but without tanking the whole context. 2485 // debugger but without tanking the whole context.
2486 Debug* debug = isolate->debug(); 2486 Debug* debug = isolate->debug();
2487 if (!debug->Load()) return true; 2487 if (!debug->Load()) return true;
2488 Handle<Context> debug_context = debug->debug_context(); 2488 Handle<Context> debug_context = debug->debug_context();
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
2960 return from + sizeof(NestingCounterType); 2960 return from + sizeof(NestingCounterType);
2961 } 2961 }
2962 2962
2963 2963
2964 // Called when the top-level V8 mutex is destroyed. 2964 // Called when the top-level V8 mutex is destroyed.
2965 void Bootstrapper::FreeThreadResources() { 2965 void Bootstrapper::FreeThreadResources() {
2966 DCHECK(!IsActive()); 2966 DCHECK(!IsActive());
2967 } 2967 }
2968 2968
2969 } } // namespace v8::internal 2969 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698