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

Unified Diff: src/bootstrapper.cc

Issue 1293493004: Unify symbols sharing across native scripts and runtime. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/bootstrapper.h ('k') | src/collection.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index dfedc7c9aaae0c562d3444d9619408f2b58d1ed4..30e10e63b57d9a4c02c6b271ce02fead54a8086e 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -13,6 +13,7 @@
#include "src/extensions/gc-extension.h"
#include "src/extensions/statistics-extension.h"
#include "src/extensions/trigger-failure-extension.h"
+#include "src/heap/heap.h"
#include "src/snapshot/natives.h"
#include "src/snapshot/snapshot.h"
#include "third_party/fdlibm/fdlibm.h"
@@ -1795,8 +1796,6 @@ void Bootstrapper::ImportNatives(Isolate* isolate, Handle<JSObject> container) {
INSTALL_NATIVE(JSFunction, "URIError", uri_error_function);
INSTALL_NATIVE(JSFunction, "MakeError", make_error_function);
- INSTALL_NATIVE(Symbol, "promiseStatus", promise_status);
- INSTALL_NATIVE(Symbol, "promiseValue", promise_value);
INSTALL_NATIVE(JSFunction, "PromiseCreate", promise_create);
INSTALL_NATIVE(JSFunction, "PromiseResolve", promise_resolve);
INSTALL_NATIVE(JSFunction, "PromiseReject", promise_reject);
@@ -1907,6 +1906,21 @@ bool Bootstrapper::InstallJSBuiltins(Isolate* isolate,
}
+void Bootstrapper::ExportPrivateSymbols(Isolate* isolate,
+ Handle<JSObject> container) {
+ HandleScope scope(isolate);
+#define EXPORT_PRIVATE_SYMBOL(NAME) \
+ Handle<String> NAME##_name = \
+ isolate->factory()->NewStringFromAsciiChecked(#NAME); \
+ JSObject::AddProperty(container, NAME##_name, isolate->factory()->NAME(), \
+ NONE);
+
+ PRIVATE_SYMBOL_LIST(EXPORT_PRIVATE_SYMBOL)
+
+#undef EXPORT_PRIVATE_SYMBOL
+}
+
+
#define EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(id) \
void Genesis::InitializeGlobal_##id() {}
@@ -2789,24 +2803,6 @@ bool Genesis::InstallSpecialObjects(Handle<Context> native_context) {
JSObject::AddProperty(global, natives_key, natives, DONT_ENUM);
}
- // Expose the stack trace symbol to native JS.
- RETURN_ON_EXCEPTION_VALUE(isolate,
- JSObject::SetOwnPropertyIgnoreAttributes(
- handle(native_context->builtins(), isolate),
- factory->InternalizeOneByteString(
- STATIC_CHAR_VECTOR("$stackTraceSymbol")),
- factory->stack_trace_symbol(), NONE),
- false);
-
- // Expose the internal error symbol to native JS
- RETURN_ON_EXCEPTION_VALUE(isolate,
- JSObject::SetOwnPropertyIgnoreAttributes(
- handle(native_context->builtins(), isolate),
- factory->InternalizeOneByteString(
- STATIC_CHAR_VECTOR("$internalErrorSymbol")),
- factory->internal_error_symbol(), NONE),
- false);
-
// Expose the debug global object in global if a name for it is specified.
if (FLAG_expose_debug_as != NULL && strlen(FLAG_expose_debug_as) != 0) {
// If loading fails we just bail out without installing the
« no previous file with comments | « src/bootstrapper.h ('k') | src/collection.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698