Index: src/bootstrapper.cc |
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc |
index 0a9caa9a8585bb15c04a339f70174a335b83f646..dc0d9021f6b8c14c542c3da1dcb141f5f7a61f6f 100644 |
--- a/src/bootstrapper.cc |
+++ b/src/bootstrapper.cc |
@@ -121,7 +121,7 @@ char* Bootstrapper::AllocateAutoDeletedArray(int bytes) { |
void Bootstrapper::TearDown() { |
if (delete_these_non_arrays_on_tear_down_ != NULL) { |
int len = delete_these_non_arrays_on_tear_down_->length(); |
- ASSERT(len < 24); // Don't use this mechanism for unbounded allocations. |
+ ASSERT(len < 20); // Don't use this mechanism for unbounded allocations. |
for (int i = 0; i < len; i++) { |
delete delete_these_non_arrays_on_tear_down_->at(i); |
delete_these_non_arrays_on_tear_down_->at(i) = NULL; |
@@ -1081,18 +1081,6 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global, |
native_context()->set_data_view_fun(*data_view_fun); |
} |
- { // -- W e a k M a p |
- InstallFunction(global, "WeakMap", JS_WEAK_MAP_TYPE, JSWeakMap::kSize, |
- isolate->initial_object_prototype(), |
- Builtins::kIllegal, true, true); |
- } |
- |
- { // -- W e a k S e t |
- InstallFunction(global, "WeakSet", JS_WEAK_SET_TYPE, JSWeakSet::kSize, |
- isolate->initial_object_prototype(), |
- Builtins::kIllegal, true, true); |
- } |
- |
{ // --- arguments_boilerplate_ |
// Make sure we can recognize argument objects at runtime. |
// This is done by introducing an anonymous function with |
@@ -1340,6 +1328,19 @@ void Genesis::InitializeExperimentalGlobal() { |
} |
} |
+ if (FLAG_harmony_weak_collections) { |
+ { // -- W e a k M a p |
+ InstallFunction(global, "WeakMap", JS_WEAK_MAP_TYPE, JSWeakMap::kSize, |
+ isolate()->initial_object_prototype(), |
+ Builtins::kIllegal, true, true); |
+ } |
+ { // -- W e a k S e t |
+ InstallFunction(global, "WeakSet", JS_WEAK_SET_TYPE, JSWeakSet::kSize, |
+ isolate()->initial_object_prototype(), |
+ Builtins::kIllegal, true, true); |
+ } |
+ } |
+ |
if (FLAG_harmony_generators) { |
// Create generator meta-objects and install them on the builtins object. |
Handle<JSObject> builtins(native_context()->builtins()); |
@@ -1534,7 +1535,6 @@ bool Genesis::CompileScriptCached(Isolate* isolate, |
void Genesis::InstallNativeFunctions() { |
HandleScope scope(isolate()); |
INSTALL_NATIVE(JSFunction, "CreateDate", create_date_fun); |
- |
INSTALL_NATIVE(JSFunction, "ToNumber", to_number_fun); |
INSTALL_NATIVE(JSFunction, "ToString", to_string_fun); |
INSTALL_NATIVE(JSFunction, "ToDetailString", to_detail_string_fun); |
@@ -1542,7 +1542,6 @@ void Genesis::InstallNativeFunctions() { |
INSTALL_NATIVE(JSFunction, "ToInteger", to_integer_fun); |
INSTALL_NATIVE(JSFunction, "ToUint32", to_uint32_fun); |
INSTALL_NATIVE(JSFunction, "ToInt32", to_int32_fun); |
- |
INSTALL_NATIVE(JSFunction, "GlobalEval", global_eval_fun); |
INSTALL_NATIVE(JSFunction, "Instantiate", instantiate_fun); |
INSTALL_NATIVE(JSFunction, "ConfigureTemplateInstance", |
@@ -1551,14 +1550,6 @@ void Genesis::InstallNativeFunctions() { |
INSTALL_NATIVE(JSObject, "functionCache", function_cache); |
INSTALL_NATIVE(JSFunction, "ToCompletePropertyDescriptor", |
to_complete_property_descriptor); |
- |
- INSTALL_NATIVE(JSFunction, "IsPromise", is_promise); |
- INSTALL_NATIVE(JSFunction, "PromiseCreate", promise_create); |
- INSTALL_NATIVE(JSFunction, "PromiseResolve", promise_resolve); |
- INSTALL_NATIVE(JSFunction, "PromiseReject", promise_reject); |
- INSTALL_NATIVE(JSFunction, "PromiseChain", promise_chain); |
- INSTALL_NATIVE(JSFunction, "PromiseCatch", promise_catch); |
- |
INSTALL_NATIVE(JSFunction, "NotifyChange", observers_notify_change); |
INSTALL_NATIVE(JSFunction, "EnqueueSpliceRecord", observers_enqueue_splice); |
INSTALL_NATIVE(JSFunction, "BeginPerformSplice", |
@@ -1573,6 +1564,15 @@ void Genesis::InstallExperimentalNativeFunctions() { |
INSTALL_NATIVE(JSFunction, "EnqueueExternalMicrotask", |
enqueue_external_microtask); |
+ if (FLAG_harmony_promises) { |
+ INSTALL_NATIVE(JSFunction, "IsPromise", is_promise); |
+ INSTALL_NATIVE(JSFunction, "PromiseCreate", promise_create); |
+ INSTALL_NATIVE(JSFunction, "PromiseResolve", promise_resolve); |
+ INSTALL_NATIVE(JSFunction, "PromiseReject", promise_reject); |
+ INSTALL_NATIVE(JSFunction, "PromiseChain", promise_chain); |
+ INSTALL_NATIVE(JSFunction, "PromiseCatch", promise_catch); |
+ } |
+ |
if (FLAG_harmony_proxies) { |
INSTALL_NATIVE(JSFunction, "DerivedHasTrap", derived_has_trap); |
INSTALL_NATIVE(JSFunction, "DerivedGetTrap", derived_get_trap); |
@@ -2022,6 +2022,8 @@ bool Genesis::InstallExperimentalNatives() { |
INSTALL_EXPERIMENTAL_NATIVE(i, symbols, "symbol.js") |
INSTALL_EXPERIMENTAL_NATIVE(i, proxies, "proxy.js") |
INSTALL_EXPERIMENTAL_NATIVE(i, collections, "collection.js") |
+ INSTALL_EXPERIMENTAL_NATIVE(i, weak_collections, "weak_collection.js") |
+ INSTALL_EXPERIMENTAL_NATIVE(i, promises, "promise.js") |
INSTALL_EXPERIMENTAL_NATIVE(i, generators, "generator.js") |
INSTALL_EXPERIMENTAL_NATIVE(i, iteration, "array-iterator.js") |
INSTALL_EXPERIMENTAL_NATIVE(i, strings, "harmony-string.js") |