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

Unified Diff: src/bootstrapper.cc

Issue 13975012: First cut at impementing ES6 TypedArrays in V8. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: CR feedback Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/messages.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 df984483f9920265f03fe0f7bed837a0ce6297b5..12f0cdac6b7faef80bc5f2d8299560696f315a47 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -199,6 +199,8 @@ class Genesis BASE_EMBEDDED {
const char* name,
ElementsKind elements_kind);
bool InstallNatives();
+
+ void InstallTypedArray(const char* name);
bool InstallExperimentalNatives();
void InstallBuiltinFunctionIds();
void InstallJSFunctionResultCaches();
@@ -1258,6 +1260,14 @@ bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
}
+void Genesis::InstallTypedArray(const char* name) {
+ Handle<JSObject> global = Handle<JSObject>(native_context()->global_object());
+ InstallFunction(global, name, JS_TYPED_ARRAY_TYPE,
+ JSTypedArray::kSize, isolate()->initial_object_prototype(),
+ Builtins::kIllegal, true);
+}
+
+
void Genesis::InitializeExperimentalGlobal() {
Handle<JSObject> global = Handle<JSObject>(native_context()->global_object());
@@ -1298,6 +1308,17 @@ void Genesis::InitializeExperimentalGlobal() {
isolate()->initial_object_prototype(),
Builtins::kIllegal, true);
}
+ {
+ // -- T y p e d A r r a y s
+ InstallTypedArray("__Int8Array");
+ InstallTypedArray("__Uint8Array");
+ InstallTypedArray("__Int16Array");
+ InstallTypedArray("__Uint16Array");
+ InstallTypedArray("__Int32Array");
+ InstallTypedArray("__Uint32Array");
+ InstallTypedArray("__Float32Array");
+ InstallTypedArray("__Float64Array");
+ }
}
if (FLAG_harmony_generators) {
« no previous file with comments | « no previous file | src/messages.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698