Commit 2c8680cc authored by lrn@chromium.org's avatar lrn@chromium.org

Avoid size increase of snapshot.

The prototype of builtin functions is already unwritable, so we don't
have to make it so (the default map for functions changes after builtins
are initialized).

We no longer need to make the prototype non-extensible, since all properties
that are ever read by the bultins code has been added and frozen already.
Adding properties to the prototype, or changing its __proto__, cannot affect
code.

Removing these two pieces of initialization code reduces the snapshot size
by a few Kb.

Review URL: http://codereview.chromium.org/7839028

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9166 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent a6864a4d
......@@ -97,13 +97,7 @@ function SetUpLockedPrototype(constructor, fields, methods) {
%SetNativeFlag(f);
}
prototype.__proto__ = null;
%PreventExtensions(prototype);
%ToFastProperties(prototype);
var desc = GetOwnProperty(constructor, "prototype");
desc.setWritable(false);
desc.setConfigurable(false);
DefineOwnProperty(constructor, "prototype", desc, false);
}
......
......@@ -56,7 +56,6 @@ function checkConstructor(func, name) {
assertFalse(proto_desc.configurable, name);
var prototype = proto_desc.value;
assertEquals(null, prototype.__proto__, name);
assertFalse(Object.isExtensible(prototype), name);
for (var i = 0; i < propNames.length; i++) {
var propName = propNames[i];
if (propName == "constructor") continue;
......
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