Optimize DefineOneShotAccessor in messages.js to not call DefineOwnProperty.
authorricow@chromium.org <ricow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 7 Nov 2011 09:30:28 +0000 (09:30 +0000)
committerricow@chromium.org <ricow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 7 Nov 2011 09:30:28 +0000 (09:30 +0000)
Review URL: http://codereview.chromium.org/8490008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9886 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/messages.js

index b370422d3dfa8eb84c6a396abb9f1decf63fbd54..e50f2950b8390dd8eb316dc2368a35a5c6f20f61 100644 (file)
@@ -745,12 +745,8 @@ function DefineOneShotAccessor(obj, name, fun) {
     hasBeenSet = true;
     value = v;
   }
-  var desc = { get: getter,
-               set: setter,
-               enumerable: false,
-               configurable: true };
-  desc = ToPropertyDescriptor(desc);
-  DefineOwnProperty(obj, name, desc, true);
+  %DefineOrRedefineAccessorProperty(obj, name, GETTER, getter, DONT_ENUM);
+  %DefineOrRedefineAccessorProperty(obj, name, SETTER, setter, DONT_ENUM);
 }
 
 function CallSite(receiver, fun, pos) {