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

Unified Diff: src/bootstrapper.cc

Issue 1501673002: Revert of [es6] Correctify and unify ArrayBuffer and SharedArrayBuffer constructors. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 | « no previous file | 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 86d0a5fcb543a81b01c28ec5b7390f3f1854e3a2..64b37256df24cde63e055b136588cbf499ba5581 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -204,8 +204,6 @@
HARMONY_SHIPPING(DECLARE_FEATURE_INITIALIZATION)
#undef DECLARE_FEATURE_INITIALIZATION
- Handle<JSFunction> InstallArrayBuffer(Handle<JSObject> target,
- const char* name);
Handle<JSFunction> InstallInternalArray(Handle<JSObject> target,
const char* name,
ElementsKind elements_kind);
@@ -1250,7 +1248,11 @@
{ // -- A r r a y B u f f e r
Handle<JSFunction> array_buffer_fun =
- InstallArrayBuffer(global, "ArrayBuffer");
+ InstallFunction(
+ global, "ArrayBuffer", JS_ARRAY_BUFFER_TYPE,
+ JSArrayBuffer::kSizeWithInternalFields,
+ isolate->initial_object_prototype(),
+ Builtins::kIllegal);
native_context()->set_array_buffer_fun(*array_buffer_fun);
}
@@ -2065,9 +2067,13 @@
void Genesis::InitializeGlobal_harmony_sharedarraybuffer() {
if (!FLAG_harmony_sharedarraybuffer) return;
- Handle<JSGlobalObject> global(native_context()->global_object());
- Handle<JSFunction> shared_array_buffer_fun =
- InstallArrayBuffer(global, "SharedArrayBuffer");
+ Handle<JSGlobalObject> global(
+ JSGlobalObject::cast(native_context()->global_object()));
+
+ Handle<JSFunction> shared_array_buffer_fun = InstallFunction(
+ global, "SharedArrayBuffer", JS_ARRAY_BUFFER_TYPE,
+ JSArrayBuffer::kSizeWithInternalFields,
+ isolate()->initial_object_prototype(), Builtins::kIllegal);
native_context()->set_shared_array_buffer_fun(*shared_array_buffer_fun);
}
@@ -2118,39 +2124,6 @@
proxy_fun->shared()->set_internal_formal_parameter_count(2);
proxy_fun->shared()->set_length(2);
native_context()->set_proxy_function(*proxy_fun);
-}
-
-
-Handle<JSFunction> Genesis::InstallArrayBuffer(Handle<JSObject> target,
- const char* name) {
- // Setup the {prototype} with the given {name} for @@toStringTag.
- Handle<JSObject> prototype =
- factory()->NewJSObject(isolate()->object_function(), TENURED);
- JSObject::AddProperty(prototype, factory()->to_string_tag_symbol(),
- factory()->NewStringFromAsciiChecked(name),
- static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY));
-
- // Allocate the constructor with the given {prototype}.
- Handle<JSFunction> array_buffer_fun =
- InstallFunction(target, name, JS_ARRAY_BUFFER_TYPE,
- JSArrayBuffer::kSizeWithInternalFields, prototype,
- Builtins::kArrayBufferConstructor);
- array_buffer_fun->shared()->set_construct_stub(
- *isolate()->builtins()->ArrayBufferConstructor_ConstructStub());
- array_buffer_fun->shared()->set_internal_formal_parameter_count(1);
- array_buffer_fun->shared()->set_length(1);
-
- // Install the "constructor" property on the {prototype}.
- JSObject::AddProperty(prototype, factory()->constructor_string(),
- array_buffer_fun, DONT_ENUM);
-
- Handle<JSFunction> array_buffer_is_view_fun = InstallFunction(
- array_buffer_fun, "isView", JS_OBJECT_TYPE, JSObject::kHeaderSize,
- MaybeHandle<JSObject>(), Builtins::kArrayBufferIsView);
- array_buffer_is_view_fun->shared()->set_internal_formal_parameter_count(1);
- array_buffer_is_view_fun->shared()->set_length(1);
-
- return array_buffer_fun;
}
« no previous file with comments | « no previous file | src/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698