From: svenpanne@chromium.org Date: Fri, 25 May 2012 12:32:02 +0000 (+0000) Subject: Enable map transitions for accessor properties. X-Git-Tag: upstream/4.7.83~16651 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0fa7de11b5ccac9552157f9507749dbf7530513d;p=platform%2Fupstream%2Fv8.git 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 --- diff --git a/src/flag-definitions.h b/src/flag-definitions.h index d0f5ccf..fc9a1db 100644 --- a/src/flag-definitions.h +++ b/src/flag-definitions.h @@ -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") diff --git a/src/objects.cc b/src/objects.cc index 4319528..a897058 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -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); diff --git a/src/regexp.js b/src/regexp.js index 44f8dd1..3809039 100644 --- a/src/regexp.js +++ b/src/regexp.js @@ -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();