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

Unified Diff: src/bootstrapper.cc

Issue 112863002: Merge bleeding_edge 18021:18297 (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 7 years 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/ast.cc ('k') | src/builtins.h » ('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 67b579899fd4ea265fae4c3de22fb87e708a3afc..1d2fb8663379ebab158c6abf2c6733bd86529417 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -42,8 +42,10 @@
#include "snapshot.h"
#include "trig-table.h"
#include "extensions/externalize-string-extension.h"
+#include "extensions/free-buffer-extension.h"
#include "extensions/gc-extension.h"
#include "extensions/statistics-extension.h"
+#include "extensions/trigger-failure-extension.h"
#include "code-stubs.h"
namespace v8 {
@@ -100,9 +102,13 @@ void Bootstrapper::Initialize(bool create_heap_objects) {
void Bootstrapper::InitializeOncePerProcess() {
+#ifdef ADDRESS_SANITIZER
+ FreeBufferExtension::Register();
+#endif
GCExtension::Register();
ExternalizeStringExtension::Register();
StatisticsExtension::Register();
+ TriggerFailureExtension::Register();
}
@@ -1575,6 +1581,7 @@ void Genesis::InstallNativeFunctions() {
void Genesis::InstallExperimentalNativeFunctions() {
+ INSTALL_NATIVE(JSFunction, "RunMicrotasks", run_microtasks);
if (FLAG_harmony_proxies) {
INSTALL_NATIVE(JSFunction, "DerivedHasTrap", derived_has_trap);
INSTALL_NATIVE(JSFunction, "DerivedGetTrap", derived_get_trap);
@@ -1588,8 +1595,6 @@ void Genesis::InstallExperimentalNativeFunctions() {
observers_begin_perform_splice);
INSTALL_NATIVE(JSFunction, "EndPerformSplice",
observers_end_perform_splice);
- INSTALL_NATIVE(JSFunction, "DeliverChangeRecords",
- observers_deliver_changes);
}
}
@@ -2020,55 +2025,28 @@ bool Genesis::InstallNatives() {
}
+#define INSTALL_EXPERIMENTAL_NATIVE(i, flag, file) \
+ if (FLAG_harmony_##flag && \
+ strcmp(ExperimentalNatives::GetScriptName(i).start(), \
+ "native " file) == 0) { \
+ if (!CompileExperimentalBuiltin(isolate(), i)) return false; \
+ }
+
+
bool Genesis::InstallExperimentalNatives() {
for (int i = ExperimentalNatives::GetDebuggerCount();
i < ExperimentalNatives::GetBuiltinsCount();
i++) {
- if (FLAG_harmony_symbols &&
- strcmp(ExperimentalNatives::GetScriptName(i).start(),
- "native symbol.js") == 0) {
- if (!CompileExperimentalBuiltin(isolate(), i)) return false;
- }
- if (FLAG_harmony_proxies &&
- strcmp(ExperimentalNatives::GetScriptName(i).start(),
- "native proxy.js") == 0) {
- if (!CompileExperimentalBuiltin(isolate(), i)) return false;
- }
- if (FLAG_harmony_collections &&
- strcmp(ExperimentalNatives::GetScriptName(i).start(),
- "native collection.js") == 0) {
- if (!CompileExperimentalBuiltin(isolate(), i)) return false;
- }
- if (FLAG_harmony_observation &&
- strcmp(ExperimentalNatives::GetScriptName(i).start(),
- "native object-observe.js") == 0) {
- if (!CompileExperimentalBuiltin(isolate(), i)) return false;
- }
- if (FLAG_harmony_generators &&
- strcmp(ExperimentalNatives::GetScriptName(i).start(),
- "native generator.js") == 0) {
- if (!CompileExperimentalBuiltin(isolate(), i)) return false;
- }
- if (FLAG_harmony_iteration &&
- strcmp(ExperimentalNatives::GetScriptName(i).start(),
- "native array-iterator.js") == 0) {
- if (!CompileExperimentalBuiltin(isolate(), i)) return false;
- }
- if (FLAG_harmony_strings &&
- strcmp(ExperimentalNatives::GetScriptName(i).start(),
- "native harmony-string.js") == 0) {
- if (!CompileExperimentalBuiltin(isolate(), i)) return false;
- }
- if (FLAG_harmony_arrays &&
- strcmp(ExperimentalNatives::GetScriptName(i).start(),
- "native harmony-array.js") == 0) {
- if (!CompileExperimentalBuiltin(isolate(), i)) return false;
- }
- if (FLAG_harmony_maths &&
- strcmp(ExperimentalNatives::GetScriptName(i).start(),
- "native harmony-math.js") == 0) {
- if (!CompileExperimentalBuiltin(isolate(), i)) return false;
- }
+ 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, observation, "object-observe.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")
+ INSTALL_EXPERIMENTAL_NATIVE(i, arrays, "harmony-array.js")
+ INSTALL_EXPERIMENTAL_NATIVE(i, maths, "harmony-math.js")
}
InstallExperimentalNativeFunctions();
@@ -2278,6 +2256,11 @@ bool Genesis::InstallExtensions(Handle<Context> native_context,
current = current->next();
}
+#ifdef ADDRESS_SANITIZER
+ if (FLAG_expose_free_buffer) {
+ InstallExtension(isolate, "v8/free-buffer", &extension_states);
+ }
+#endif
if (FLAG_expose_gc) InstallExtension(isolate, "v8/gc", &extension_states);
if (FLAG_expose_externalize_string) {
InstallExtension(isolate, "v8/externalize", &extension_states);
@@ -2285,6 +2268,9 @@ bool Genesis::InstallExtensions(Handle<Context> native_context,
if (FLAG_track_gc_object_stats) {
InstallExtension(isolate, "v8/statistics", &extension_states);
}
+ if (FLAG_expose_trigger_failure) {
+ InstallExtension(isolate, "v8/trigger-failure", &extension_states);
+ }
if (extensions == NULL) return true;
// Install required extensions
@@ -2646,7 +2632,8 @@ Genesis::Genesis(Isolate* isolate,
isolate->random_number_generator()->NextBytes(state, num_bytes);
} while (state[0] == 0 || state[1] == 0);
- v8::Local<v8::ArrayBuffer> buffer = v8::ArrayBuffer::New(state, num_bytes);
+ v8::Local<v8::ArrayBuffer> buffer = v8::ArrayBuffer::New(
+ reinterpret_cast<v8::Isolate*>(isolate), state, num_bytes);
Utils::OpenHandle(*buffer)->set_should_be_freed(true);
v8::Local<v8::Uint32Array> ta = v8::Uint32Array::New(buffer, 0, num_elems);
Handle<JSBuiltinsObject> builtins(native_context()->builtins());
@@ -2659,8 +2646,10 @@ Genesis::Genesis(Isolate* isolate,
// Initialize trigonometric lookup tables and constants.
const int table_num_bytes = TrigonometricLookupTable::table_num_bytes();
v8::Local<v8::ArrayBuffer> sin_buffer = v8::ArrayBuffer::New(
+ reinterpret_cast<v8::Isolate*>(isolate),
TrigonometricLookupTable::sin_table(), table_num_bytes);
v8::Local<v8::ArrayBuffer> cos_buffer = v8::ArrayBuffer::New(
+ reinterpret_cast<v8::Isolate*>(isolate),
TrigonometricLookupTable::cos_x_interval_table(), table_num_bytes);
v8::Local<v8::Float64Array> sin_table = v8::Float64Array::New(
sin_buffer, 0, TrigonometricLookupTable::table_size());
« no previous file with comments | « src/ast.cc ('k') | src/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698