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

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: 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
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index a5b4b1b8380788c06ae70e4f74ffcc9f199b5416..079502a45712fd129bd7e67d8d3109fd4951933f 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"
@@ -1775,8 +1776,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);
@@ -1869,6 +1868,20 @@ void Bootstrapper::ImportExperimentalNatives(Isolate* isolate,
#undef INSTALL_NATIVE
+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() {}
@@ -2741,24 +2754,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

Powered by Google App Engine
This is Rietveld 408576698