summaryrefslogtreecommitdiffstats
path: root/src/bootstrapper.cc
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-25 10:26:03 +0100
committerBen Murdoch <benm@google.com>2011-05-25 16:24:42 +0100
commite0cee9b3ed82e2391fd85d118aeaa4ea361c687d (patch)
tree31c7963cf0dfc88be29e765884e1f235076c03a4 /src/bootstrapper.cc
parent1e0659c275bb392c045087af4f6b0d7565cb3d77 (diff)
downloadandroid_external_v8-e0cee9b3ed82e2391fd85d118aeaa4ea361c687d.tar.gz
android_external_v8-e0cee9b3ed82e2391fd85d118aeaa4ea361c687d.tar.bz2
android_external_v8-e0cee9b3ed82e2391fd85d118aeaa4ea361c687d.zip
Update V8 to r7079 as required by WebKit r80534.
Change-Id: I487c152e485d5a40b68997d7c0d2f1fba5da0834
Diffstat (limited to 'src/bootstrapper.cc')
-rw-r--r--src/bootstrapper.cc38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 415d2dd8..8cd29b21 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1240,6 +1240,43 @@ bool Genesis::InstallNatives() {
global_context()->set_opaque_reference_function(*opaque_reference_fun);
}
+ { // --- I n t e r n a l A r r a y ---
+ // An array constructor on the builtins object that works like
+ // the public Array constructor, except that its prototype
+ // doesn't inherit from Object.prototype.
+ // To be used only for internal work by builtins. Instances
+ // must not be leaked to user code.
+ // Only works correctly when called as a constructor. The normal
+ // Array code uses Array.prototype as prototype when called as
+ // a function.
+ Handle<JSFunction> array_function =
+ InstallFunction(builtins,
+ "InternalArray",
+ JS_ARRAY_TYPE,
+ JSArray::kSize,
+ Top::initial_object_prototype(),
+ Builtins::ArrayCode,
+ true);
+ Handle<JSObject> prototype =
+ Factory::NewJSObject(Top::object_function(), TENURED);
+ SetPrototype(array_function, prototype);
+
+ array_function->shared()->set_construct_stub(
+ Builtins::builtin(Builtins::ArrayConstructCode));
+ array_function->shared()->DontAdaptArguments();
+
+ // Make "length" magic on instances.
+ Handle<DescriptorArray> array_descriptors =
+ Factory::CopyAppendProxyDescriptor(
+ Factory::empty_descriptor_array(),
+ Factory::length_symbol(),
+ Factory::NewProxy(&Accessors::ArrayLength),
+ static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE));
+
+ array_function->initial_map()->set_instance_descriptors(
+ *array_descriptors);
+ }
+
if (FLAG_disable_native_files) {
PrintF("Warning: Running without installed natives!\n");
return true;
@@ -1358,6 +1395,7 @@ bool Genesis::InstallNatives() {
global_context()->set_regexp_result_map(*initial_map);
}
+
#ifdef DEBUG
builtins->Verify();
#endif