Revision: 16137
Author: [email protected]
Date: Fri Aug 9 08:57:31 2013
Log: Promote ArrayBuffer, DataView and typed arrays to
non-experimental.
The primary reason for this change is to bake these guys into the
snapshot.
Flag definitions (--harmony-typed-arrays, --harmony-array-buffer) are
still there so that Blink does not complain, but they are noop and
default to true.
[email protected]
Review URL: https://codereview.chromium.org/22390008
http://code.google.com/p/v8/source/detail?r=16137
Modified:
/branches/bleeding_edge/src/bootstrapper.cc
/branches/bleeding_edge/src/d8.cc
/branches/bleeding_edge/src/flag-definitions.h
/branches/bleeding_edge/test/cctest/cctest.cc
/branches/bleeding_edge/test/cctest/test-api.cc
/branches/bleeding_edge/test/cctest/test-heap.cc
/branches/bleeding_edge/tools/gyp/v8.gyp
=======================================
--- /branches/bleeding_edge/src/bootstrapper.cc Fri Aug 2 03:57:48 2013
+++ /branches/bleeding_edge/src/bootstrapper.cc Fri Aug 9 08:57:31 2013
@@ -1063,6 +1063,54 @@
global, name, json_object, DONT_ENUM));
native_context()->set_json_object(*json_object);
}
+
+ { // -- A r r a y B u f f e r
+ Handle<JSFunction> array_buffer_fun =
+ InstallFunction(
+ global, "ArrayBuffer", JS_ARRAY_BUFFER_TYPE,
+ JSArrayBuffer::kSizeWithInternalFields,
+ isolate->initial_object_prototype(),
+ Builtins::kIllegal, true, true);
+ native_context()->set_array_buffer_fun(*array_buffer_fun);
+ }
+
+ { // -- T y p e d A r r a y s
+ Handle<JSFunction> int8_fun = InstallTypedArray("Int8Array",
+ EXTERNAL_BYTE_ELEMENTS);
+ native_context()->set_int8_array_fun(*int8_fun);
+ Handle<JSFunction> uint8_fun = InstallTypedArray("Uint8Array",
+ EXTERNAL_UNSIGNED_BYTE_ELEMENTS);
+ native_context()->set_uint8_array_fun(*uint8_fun);
+ Handle<JSFunction> int16_fun = InstallTypedArray("Int16Array",
+ EXTERNAL_SHORT_ELEMENTS);
+ native_context()->set_int16_array_fun(*int16_fun);
+ Handle<JSFunction> uint16_fun = InstallTypedArray("Uint16Array",
+ EXTERNAL_UNSIGNED_SHORT_ELEMENTS);
+ native_context()->set_uint16_array_fun(*uint16_fun);
+ Handle<JSFunction> int32_fun = InstallTypedArray("Int32Array",
+ EXTERNAL_INT_ELEMENTS);
+ native_context()->set_int32_array_fun(*int32_fun);
+ Handle<JSFunction> uint32_fun = InstallTypedArray("Uint32Array",
+ EXTERNAL_UNSIGNED_INT_ELEMENTS);
+ native_context()->set_uint32_array_fun(*uint32_fun);
+ Handle<JSFunction> float_fun = InstallTypedArray("Float32Array",
+ EXTERNAL_FLOAT_ELEMENTS);
+ native_context()->set_float_array_fun(*float_fun);
+ Handle<JSFunction> double_fun = InstallTypedArray("Float64Array",
+ EXTERNAL_DOUBLE_ELEMENTS);
+ native_context()->set_double_array_fun(*double_fun);
+ Handle<JSFunction> uint8c_fun = InstallTypedArray("Uint8ClampedArray",
+ EXTERNAL_PIXEL_ELEMENTS);
+ native_context()->set_uint8c_array_fun(*uint8c_fun);
+
+ Handle<JSFunction> data_view_fun =
+ InstallFunction(
+ global, "DataView", JS_DATA_VIEW_TYPE,
+ JSDataView::kSizeWithInternalFields,
+ isolate->initial_object_prototype(),
+ Builtins::kIllegal, true, true);
+ native_context()->set_data_view_fun(*data_view_fun);
+ }
{ // --- arguments_boilerplate_
// Make sure we can recognize argument objects at runtime.
@@ -1330,56 +1378,6 @@
Builtins::kIllegal, true, true);
}
}
-
- if (FLAG_harmony_array_buffer) {
- // -- A r r a y B u f f e r
- Handle<JSFunction> array_buffer_fun =
- InstallFunction(
- global, "ArrayBuffer", JS_ARRAY_BUFFER_TYPE,
- JSArrayBuffer::kSizeWithInternalFields,
- isolate()->initial_object_prototype(),
- Builtins::kIllegal, true, true);
- native_context()->set_array_buffer_fun(*array_buffer_fun);
- }
-
- if (FLAG_harmony_typed_arrays) {
- // -- T y p e d A r r a y s
- Handle<JSFunction> int8_fun = InstallTypedArray("Int8Array",
- EXTERNAL_BYTE_ELEMENTS);
- native_context()->set_int8_array_fun(*int8_fun);
- Handle<JSFunction> uint8_fun = InstallTypedArray("Uint8Array",
- EXTERNAL_UNSIGNED_BYTE_ELEMENTS);
- native_context()->set_uint8_array_fun(*uint8_fun);
- Handle<JSFunction> int16_fun = InstallTypedArray("Int16Array",
- EXTERNAL_SHORT_ELEMENTS);
- native_context()->set_int16_array_fun(*int16_fun);
- Handle<JSFunction> uint16_fun = InstallTypedArray("Uint16Array",
- EXTERNAL_UNSIGNED_SHORT_ELEMENTS);
- native_context()->set_uint16_array_fun(*uint16_fun);
- Handle<JSFunction> int32_fun = InstallTypedArray("Int32Array",
- EXTERNAL_INT_ELEMENTS);
- native_context()->set_int32_array_fun(*int32_fun);
- Handle<JSFunction> uint32_fun = InstallTypedArray("Uint32Array",
- EXTERNAL_UNSIGNED_INT_ELEMENTS);
- native_context()->set_uint32_array_fun(*uint32_fun);
- Handle<JSFunction> float_fun = InstallTypedArray("Float32Array",
- EXTERNAL_FLOAT_ELEMENTS);
- native_context()->set_float_array_fun(*float_fun);
- Handle<JSFunction> double_fun = InstallTypedArray("Float64Array",
- EXTERNAL_DOUBLE_ELEMENTS);
- native_context()->set_double_array_fun(*double_fun);
- Handle<JSFunction> uint8c_fun = InstallTypedArray("Uint8ClampedArray",
- EXTERNAL_PIXEL_ELEMENTS);
- native_context()->set_uint8c_array_fun(*uint8c_fun);
-
- Handle<JSFunction> data_view_fun =
- InstallFunction(
- global, "DataView", JS_DATA_VIEW_TYPE,
- JSDataView::kSizeWithInternalFields,
- isolate()->initial_object_prototype(),
- Builtins::kIllegal, true, true);
- native_context()->set_data_view_fun(*data_view_fun);
- }
if (FLAG_harmony_generators) {
// Create generator meta-objects and install them on the builtins
object.
@@ -2060,16 +2058,6 @@
"native object-observe.js") == 0) {
if (!CompileExperimentalBuiltin(isolate(), i)) return false;
}
- if (FLAG_harmony_array_buffer &&
- strcmp(ExperimentalNatives::GetScriptName(i).start(),
- "native arraybuffer.js") == 0) {
- if (!CompileExperimentalBuiltin(isolate(), i)) return false;
- }
- if (FLAG_harmony_typed_arrays &&
- strcmp(ExperimentalNatives::GetScriptName(i).start(),
- "native typedarray.js") == 0) {
- if (!CompileExperimentalBuiltin(isolate(), i)) return false;
- }
if (FLAG_harmony_generators &&
strcmp(ExperimentalNatives::GetScriptName(i).start(),
"native generator.js") == 0) {
=======================================
--- /branches/bleeding_edge/src/d8.cc Mon Aug 5 09:47:45 2013
+++ /branches/bleeding_edge/src/d8.cc Fri Aug 9 08:57:31 2013
@@ -1556,11 +1556,10 @@
#ifdef V8_SHARED
static void SetStandaloneFlagsViaCommandLine() {
- int fake_argc = 3;
- char **fake_argv = new char*[3];
+ int fake_argc = 2;
+ char **fake_argv = new char*[2];
fake_argv[0] = NULL;
- fake_argv[1] = strdup("--harmony-typed-arrays");
- fake_argv[2] = strdup("--trace-hydrogen-file=hydrogen.cfg");
+ fake_argv[1] = strdup("--trace-hydrogen-file=hydrogen.cfg");
v8::V8::SetFlagsFromCommandLine(&fake_argc, fake_argv, false);
free(fake_argv[1]);
delete[] fake_argv;
@@ -1649,8 +1648,6 @@
if (!SetOptions(argc, argv)) return 1;
v8::V8::InitializeICU();
#ifndef V8_SHARED
- i::FLAG_harmony_array_buffer = true;
- i::FLAG_harmony_typed_arrays = true;
i::FLAG_trace_hydrogen_file = "hydrogen.cfg";
#else
SetStandaloneFlagsViaCommandLine();
=======================================
--- /branches/bleeding_edge/src/flag-definitions.h Fri Aug 9 01:24:29 2013
+++ /branches/bleeding_edge/src/flag-definitions.h Fri Aug 9 08:57:31 2013
@@ -164,9 +164,9 @@
"enable harmony collections (sets, maps, and weak maps)")
DEFINE_bool(harmony_observation, false,
"enable harmony object observation (implies harmony
collections")
-DEFINE_bool(harmony_typed_arrays, false,
+DEFINE_bool(harmony_typed_arrays, true,
"enable harmony typed arrays")
-DEFINE_bool(harmony_array_buffer, false,
+DEFINE_bool(harmony_array_buffer, true,
"enable harmony array buffer")
DEFINE_implication(harmony_typed_arrays, harmony_array_buffer)
DEFINE_bool(harmony_generators, false, "enable harmony generators")
=======================================
--- /branches/bleeding_edge/test/cctest/cctest.cc Fri Aug 2 06:03:06 2013
+++ /branches/bleeding_edge/test/cctest/cctest.cc Fri Aug 9 08:57:31 2013
@@ -108,8 +108,6 @@
int main(int argc, char* argv[]) {
v8::internal::FlagList::SetFlagsFromCommandLine(&argc, argv, true);
- v8::internal::FLAG_harmony_array_buffer = true;
- v8::internal::FLAG_harmony_typed_arrays = true;
CcTestArrayBufferAllocator array_buffer_allocator;
v8::V8::SetArrayBufferAllocator(&array_buffer_allocator);
=======================================
--- /branches/bleeding_edge/test/cctest/test-api.cc Wed Aug 7 02:11:39 2013
+++ /branches/bleeding_edge/test/cctest/test-api.cc Fri Aug 9 08:57:31 2013
@@ -2682,9 +2682,6 @@
THREADED_TEST(ArrayBuffer_ApiInternalToExternal) {
- i::FLAG_harmony_array_buffer = true;
- i::FLAG_harmony_typed_arrays = true;
-
LocalContext env;
v8::Isolate* isolate = env->GetIsolate();
v8::HandleScope handle_scope(isolate);
@@ -2721,9 +2718,6 @@
THREADED_TEST(ArrayBuffer_JSInternalToExternal) {
- i::FLAG_harmony_array_buffer = true;
- i::FLAG_harmony_typed_arrays = true;
-
LocalContext env;
v8::Isolate* isolate = env->GetIsolate();
v8::HandleScope handle_scope(isolate);
@@ -2766,9 +2760,6 @@
THREADED_TEST(ArrayBuffer_External) {
- i::FLAG_harmony_array_buffer = true;
- i::FLAG_harmony_typed_arrays = true;
-
LocalContext env;
v8::Isolate* isolate = env->GetIsolate();
v8::HandleScope handle_scope(isolate);
@@ -12958,9 +12949,6 @@
// Experimental natives are compiled during snapshot deserialization.
// This test breaks because InstallGetter (function from snapshot that
// only gets called from experimental natives) is compiled with entry
hooks.
- i::FLAG_harmony_typed_arrays = false;
- i::FLAG_harmony_array_buffer = false;
-
i::FLAG_allow_natives_syntax = true;
i::FLAG_use_inlining = false;
@@ -16157,8 +16145,6 @@
#define
IS_ARRAY_BUFFER_VIEW_TEST(View) \
THREADED_TEST(Is##View)
{ \
- i::FLAG_harmony_array_buffer =
true; \
- i::FLAG_harmony_typed_arrays =
true; \
LocalContext
env; \
v8::Isolate* isolate =
env->GetIsolate(); \
v8::HandleScope
handle_scope(isolate); \
=======================================
--- /branches/bleeding_edge/test/cctest/test-heap.cc Wed Aug 7 02:33:09
2013
+++ /branches/bleeding_edge/test/cctest/test-heap.cc Fri Aug 9 08:57:31
2013
@@ -3068,12 +3068,6 @@
i::FLAG_allow_natives_syntax = true;
i::FLAG_flush_code_incrementally = true;
- // Experimental natives are compiled during snapshot deserialization.
- // This test breaks because heap layout changes in a way that closure
- // is visited before shared function info.
- i::FLAG_harmony_typed_arrays = false;
- i::FLAG_harmony_array_buffer = false;
-
// Disable loading the i18n extension which breaks the assumptions of
this
// test about the heap layout.
i::FLAG_enable_i18n = false;
=======================================
--- /branches/bleeding_edge/tools/gyp/v8.gyp Fri Aug 9 02:51:09 2013
+++ /branches/bleeding_edge/tools/gyp/v8.gyp Fri Aug 9 08:57:31 2013
@@ -890,6 +890,8 @@
'../../src/date.js',
'../../src/json.js',
'../../src/regexp.js',
+ '../../src/arraybuffer.js',
+ '../../src/typedarray.js',
'../../src/macros.py',
],
'experimental_library_files': [
@@ -898,8 +900,6 @@
'../../src/proxy.js',
'../../src/collection.js',
'../../src/object-observe.js',
- '../../src/arraybuffer.js',
- '../../src/typedarray.js',
'../../src/generator.js',
'../../src/array-iterator.js',
'../../src/harmony-string.js',
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.