Enable map transitions for accessor properties.

To avoid a performance regression for context creation with snapshots, we avoid
creating a useless long map chain for regular expressions, keeping the snapshot
size almost the same as before.

Review URL: https://chromiumcodereview.appspot.com/10440045

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11664 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent c2331335
......@@ -397,8 +397,6 @@ DEFINE_int(random_seed, 0,
// objects.cc
DEFINE_bool(use_verbose_printer, true, "allows verbose printing")
DEFINE_bool(fast_accessor_properties, false,
"use map transitions for JavaScript accessors")
// parser.cc
DEFINE_bool(allow_natives_syntax, false, "allow natives syntax")
......
......@@ -4456,8 +4456,7 @@ MaybeObject* JSObject::DefinePropertyAccessor(String* name,
// to do a lookup, which seems to be a bit of overkill.
Heap* heap = GetHeap();
bool only_attribute_changes = getter->IsNull() && setter->IsNull();
if (FLAG_fast_accessor_properties &&
HasFastProperties() && !only_attribute_changes) {
if (HasFastProperties() && !only_attribute_changes) {
MaybeObject* getterOk = heap->undefined_value();
if (!getter->IsNull()) {
getterOk = DefineFastAccessor(name, ACCESSOR_GETTER, getter, attributes);
......
......@@ -427,6 +427,7 @@ function SetUpRegExp() {
LAST_INPUT(lastMatchInfo) = ToString(string);
};
%OptimizeObjectForAddingMultipleProperties($RegExp, 22);
%DefineOrRedefineAccessorProperty($RegExp, 'input', RegExpGetInput,
RegExpSetInput, DONT_DELETE);
%DefineOrRedefineAccessorProperty($RegExp, '$_', RegExpGetInput,
......@@ -481,6 +482,7 @@ function SetUpRegExp() {
RegExpMakeCaptureGetter(i), NoOpSetter,
DONT_DELETE);
}
%ToFastProperties($RegExp);
}
SetUpRegExp();
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