Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Fix error introduced in r9431, which leads to redundant lookup when setting property with handler. (issue 8386030)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
u...@chromium.org  
View profile   Translate to Translated (View Original)
 More options Nov 2 2011, 7:53 am
From: u...@chromium.org
Date: Wed, 02 Nov 2011 11:53:17 +0000
Local: Wed, Nov 2 2011 7:53 am
Subject: Fix error introduced in r9431, which leads to redundant lookup when setting property with handler. (issue 8386030)
Reviewers: Rico,

Message:
Please take a look.

Description:
Fix error introduced in r9431, which leads to redundant lookup when setting
property with handler.

BUG=
TEST=

Please review this at http://codereview.chromium.org/8386030/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
   M src/objects.cc

Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index  
bbbe45a350bd07d3fecbf54c71a2376d202a3e01..b33e424f3ef7fc57d026c13a1c0e734bb 6d633fb  
100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -2148,47 +2148,35 @@ MaybeObject*  
JSObject::SetPropertyWithCallbackSetterInPrototypes(
      bool* found,
      StrictModeFlag strict_mode) {
    Heap* heap = GetHeap();
-  LookupResult result(heap->isolate());
-  LookupCallbackSetterInPrototypes(name, &result);
-  if (result.IsFound()) {
+  // We could not find a local property so let's check whether there is an
+  // accessor that wants to handle the property.
+  LookupResult accessor_result(heap->isolate());
+  LookupCallbackSetterInPrototypes(name, &accessor_result);
+  if (accessor_result.IsFound()) {
      *found = true;
-    if (result.type() == CALLBACKS) {
-      return SetPropertyWithCallback(result.GetCallbackObject(),
+    if (accessor_result.type() == CALLBACKS) {
+      return SetPropertyWithCallback(accessor_result.GetCallbackObject(),
                                       name,
                                       value,
-                                     result.holder(),
+                                     accessor_result.holder(),
                                       strict_mode);
-    } else if (result.type() == HANDLER) {
-      // We could not find a local property so let's check whether there  
is an
-      // accessor that wants to handle the property.
-      LookupResult accessor_result(heap->isolate());
-      LookupCallbackSetterInPrototypes(name, &accessor_result);
-      if (accessor_result.IsFound()) {
-        if (accessor_result.type() == CALLBACKS) {
-          return  
SetPropertyWithCallback(accessor_result.GetCallbackObject(),
-                                         name,
-                                         value,
-                                         accessor_result.holder(),
-                                         strict_mode);
-        } else if (accessor_result.type() == HANDLER) {
-          // There is a proxy in the prototype chain. Invoke its
-          // getPropertyDescriptor trap.
-          bool found = false;
-          // SetPropertyWithHandlerIfDefiningSetter can cause GC,
-          // make sure to use the handlified references after calling
-          // the function.
-          Handle<JSObject> self(this);
-          Handle<String> hname(name);
-          Handle<Object> hvalue(value);
-          MaybeObject* result =
-              
accessor_result.proxy()->SetPropertyWithHandlerIfDefiningSetter(
-                  name, value, attributes, strict_mode, &found);
-          if (found) return result;
-          // The proxy does not define the property as an accessor.
-          // Consequently, it has no effect on setting the receiver.
-          return self->AddProperty(*hname, *hvalue, attributes,  
strict_mode);
-        }
-      }
+    } else if (accessor_result.type() == HANDLER) {
+      // There is a proxy in the prototype chain. Invoke its
+      // getPropertyDescriptor trap.
+      bool found = false;
+      // SetPropertyWithHandlerIfDefiningSetter can cause GC,
+      // make sure to use the handlified references after calling
+      // the function.
+      Handle<JSObject> self(this);
+      Handle<String> hname(name);
+      Handle<Object> hvalue(value);
+      MaybeObject* result =
+          accessor_result.proxy()->SetPropertyWithHandlerIfDefiningSetter(
+              name, value, attributes, strict_mode, &found);
+      if (found) return result;
+      // The proxy does not define the property as an accessor.
+      // Consequently, it has no effect on setting the receiver.
+      return self->AddProperty(*hname, *hvalue, attributes, strict_mode);
      }
    }
    *found = false;


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ri...@chromium.org  
View profile   Translate to Translated (View Original)
 More options Nov 2 2011, 8:02 am
From: ri...@chromium.org
Date: Wed, 02 Nov 2011 12:02:51 +0000
Local: Wed, Nov 2 2011 8:02 am
Subject: Re: Fix error introduced in r9431, which leads to redundant lookup when setting property with handler. (issue 8386030)
 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »