Commit d63e29ba authored by dslomov@chromium.org's avatar dslomov@chromium.org

Revert "Promote ArrayBuffer, DataView and typed arrays to non-experimental."

This reverts commit r16137 for breaking tests on Windows.

TBR=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/22710007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16138 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 30375b09
...@@ -1064,54 +1064,6 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global, ...@@ -1064,54 +1064,6 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
native_context()->set_json_object(*json_object); 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_ { // --- arguments_boilerplate_
// Make sure we can recognize argument objects at runtime. // Make sure we can recognize argument objects at runtime.
// This is done by introducing an anonymous function with // This is done by introducing an anonymous function with
...@@ -1379,6 +1331,56 @@ void Genesis::InitializeExperimentalGlobal() { ...@@ -1379,6 +1331,56 @@ void Genesis::InitializeExperimentalGlobal() {
} }
} }
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) { if (FLAG_harmony_generators) {
// Create generator meta-objects and install them on the builtins object. // Create generator meta-objects and install them on the builtins object.
Handle<JSObject> builtins(native_context()->builtins()); Handle<JSObject> builtins(native_context()->builtins());
...@@ -2058,6 +2060,16 @@ bool Genesis::InstallExperimentalNatives() { ...@@ -2058,6 +2060,16 @@ bool Genesis::InstallExperimentalNatives() {
"native object-observe.js") == 0) { "native object-observe.js") == 0) {
if (!CompileExperimentalBuiltin(isolate(), i)) return false; 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 && if (FLAG_harmony_generators &&
strcmp(ExperimentalNatives::GetScriptName(i).start(), strcmp(ExperimentalNatives::GetScriptName(i).start(),
"native generator.js") == 0) { "native generator.js") == 0) {
......
...@@ -1556,10 +1556,11 @@ int Shell::RunMain(Isolate* isolate, int argc, char* argv[]) { ...@@ -1556,10 +1556,11 @@ int Shell::RunMain(Isolate* isolate, int argc, char* argv[]) {
#ifdef V8_SHARED #ifdef V8_SHARED
static void SetStandaloneFlagsViaCommandLine() { static void SetStandaloneFlagsViaCommandLine() {
int fake_argc = 2; int fake_argc = 3;
char **fake_argv = new char*[2]; char **fake_argv = new char*[3];
fake_argv[0] = NULL; fake_argv[0] = NULL;
fake_argv[1] = strdup("--trace-hydrogen-file=hydrogen.cfg"); fake_argv[1] = strdup("--harmony-typed-arrays");
fake_argv[2] = strdup("--trace-hydrogen-file=hydrogen.cfg");
v8::V8::SetFlagsFromCommandLine(&fake_argc, fake_argv, false); v8::V8::SetFlagsFromCommandLine(&fake_argc, fake_argv, false);
free(fake_argv[1]); free(fake_argv[1]);
delete[] fake_argv; delete[] fake_argv;
...@@ -1648,6 +1649,8 @@ int Shell::Main(int argc, char* argv[]) { ...@@ -1648,6 +1649,8 @@ int Shell::Main(int argc, char* argv[]) {
if (!SetOptions(argc, argv)) return 1; if (!SetOptions(argc, argv)) return 1;
v8::V8::InitializeICU(); v8::V8::InitializeICU();
#ifndef V8_SHARED #ifndef V8_SHARED
i::FLAG_harmony_array_buffer = true;
i::FLAG_harmony_typed_arrays = true;
i::FLAG_trace_hydrogen_file = "hydrogen.cfg"; i::FLAG_trace_hydrogen_file = "hydrogen.cfg";
#else #else
SetStandaloneFlagsViaCommandLine(); SetStandaloneFlagsViaCommandLine();
......
...@@ -164,9 +164,9 @@ DEFINE_bool(harmony_collections, false, ...@@ -164,9 +164,9 @@ DEFINE_bool(harmony_collections, false,
"enable harmony collections (sets, maps, and weak maps)") "enable harmony collections (sets, maps, and weak maps)")
DEFINE_bool(harmony_observation, false, DEFINE_bool(harmony_observation, false,
"enable harmony object observation (implies harmony collections") "enable harmony object observation (implies harmony collections")
DEFINE_bool(harmony_typed_arrays, true, DEFINE_bool(harmony_typed_arrays, false,
"enable harmony typed arrays") "enable harmony typed arrays")
DEFINE_bool(harmony_array_buffer, true, DEFINE_bool(harmony_array_buffer, false,
"enable harmony array buffer") "enable harmony array buffer")
DEFINE_implication(harmony_typed_arrays, harmony_array_buffer) DEFINE_implication(harmony_typed_arrays, harmony_array_buffer)
DEFINE_bool(harmony_generators, false, "enable harmony generators") DEFINE_bool(harmony_generators, false, "enable harmony generators")
......
...@@ -108,6 +108,8 @@ class CcTestArrayBufferAllocator : public v8::ArrayBuffer::Allocator { ...@@ -108,6 +108,8 @@ class CcTestArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
v8::internal::FlagList::SetFlagsFromCommandLine(&argc, argv, true); 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; CcTestArrayBufferAllocator array_buffer_allocator;
v8::V8::SetArrayBufferAllocator(&array_buffer_allocator); v8::V8::SetArrayBufferAllocator(&array_buffer_allocator);
......
...@@ -2682,6 +2682,9 @@ static void CheckInternalFieldsAreZero(v8::Handle<T> value) { ...@@ -2682,6 +2682,9 @@ static void CheckInternalFieldsAreZero(v8::Handle<T> value) {
THREADED_TEST(ArrayBuffer_ApiInternalToExternal) { THREADED_TEST(ArrayBuffer_ApiInternalToExternal) {
i::FLAG_harmony_array_buffer = true;
i::FLAG_harmony_typed_arrays = true;
LocalContext env; LocalContext env;
v8::Isolate* isolate = env->GetIsolate(); v8::Isolate* isolate = env->GetIsolate();
v8::HandleScope handle_scope(isolate); v8::HandleScope handle_scope(isolate);
...@@ -2718,6 +2721,9 @@ THREADED_TEST(ArrayBuffer_ApiInternalToExternal) { ...@@ -2718,6 +2721,9 @@ THREADED_TEST(ArrayBuffer_ApiInternalToExternal) {
THREADED_TEST(ArrayBuffer_JSInternalToExternal) { THREADED_TEST(ArrayBuffer_JSInternalToExternal) {
i::FLAG_harmony_array_buffer = true;
i::FLAG_harmony_typed_arrays = true;
LocalContext env; LocalContext env;
v8::Isolate* isolate = env->GetIsolate(); v8::Isolate* isolate = env->GetIsolate();
v8::HandleScope handle_scope(isolate); v8::HandleScope handle_scope(isolate);
...@@ -2760,6 +2766,9 @@ THREADED_TEST(ArrayBuffer_JSInternalToExternal) { ...@@ -2760,6 +2766,9 @@ THREADED_TEST(ArrayBuffer_JSInternalToExternal) {
THREADED_TEST(ArrayBuffer_External) { THREADED_TEST(ArrayBuffer_External) {
i::FLAG_harmony_array_buffer = true;
i::FLAG_harmony_typed_arrays = true;
LocalContext env; LocalContext env;
v8::Isolate* isolate = env->GetIsolate(); v8::Isolate* isolate = env->GetIsolate();
v8::HandleScope handle_scope(isolate); v8::HandleScope handle_scope(isolate);
...@@ -12949,6 +12958,9 @@ TEST(SetFunctionEntryHook) { ...@@ -12949,6 +12958,9 @@ TEST(SetFunctionEntryHook) {
// Experimental natives are compiled during snapshot deserialization. // Experimental natives are compiled during snapshot deserialization.
// This test breaks because InstallGetter (function from snapshot that // This test breaks because InstallGetter (function from snapshot that
// only gets called from experimental natives) is compiled with entry hooks. // 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_allow_natives_syntax = true;
i::FLAG_use_inlining = false; i::FLAG_use_inlining = false;
...@@ -16145,6 +16157,8 @@ THREADED_TEST(DataView) { ...@@ -16145,6 +16157,8 @@ THREADED_TEST(DataView) {
#define IS_ARRAY_BUFFER_VIEW_TEST(View) \ #define IS_ARRAY_BUFFER_VIEW_TEST(View) \
THREADED_TEST(Is##View) { \ THREADED_TEST(Is##View) { \
i::FLAG_harmony_array_buffer = true; \
i::FLAG_harmony_typed_arrays = true; \
LocalContext env; \ LocalContext env; \
v8::Isolate* isolate = env->GetIsolate(); \ v8::Isolate* isolate = env->GetIsolate(); \
v8::HandleScope handle_scope(isolate); \ v8::HandleScope handle_scope(isolate); \
......
...@@ -3068,6 +3068,12 @@ TEST(Regress169209) { ...@@ -3068,6 +3068,12 @@ TEST(Regress169209) {
i::FLAG_allow_natives_syntax = true; i::FLAG_allow_natives_syntax = true;
i::FLAG_flush_code_incrementally = 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 // Disable loading the i18n extension which breaks the assumptions of this
// test about the heap layout. // test about the heap layout.
i::FLAG_enable_i18n = false; i::FLAG_enable_i18n = false;
......
...@@ -890,8 +890,6 @@ ...@@ -890,8 +890,6 @@
'../../src/date.js', '../../src/date.js',
'../../src/json.js', '../../src/json.js',
'../../src/regexp.js', '../../src/regexp.js',
'../../src/arraybuffer.js',
'../../src/typedarray.js',
'../../src/macros.py', '../../src/macros.py',
], ],
'experimental_library_files': [ 'experimental_library_files': [
...@@ -900,6 +898,8 @@ ...@@ -900,6 +898,8 @@
'../../src/proxy.js', '../../src/proxy.js',
'../../src/collection.js', '../../src/collection.js',
'../../src/object-observe.js', '../../src/object-observe.js',
'../../src/arraybuffer.js',
'../../src/typedarray.js',
'../../src/generator.js', '../../src/generator.js',
'../../src/array-iterator.js', '../../src/array-iterator.js',
'../../src/harmony-string.js', '../../src/harmony-string.js',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment