Remove last LookupOwnRealNamedProperty usage from runtime.cc
authorverwaest@chromium.org <verwaest@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 21 Aug 2014 08:19:05 +0000 (08:19 +0000)
committerverwaest@chromium.org <verwaest@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 21 Aug 2014 08:19:05 +0000 (08:19 +0000)
BUG=
R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/494663002

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

src/property.h
src/runtime.cc

index 125f927..ab2dcef 100644 (file)
@@ -252,8 +252,7 @@ class LookupResult V8_FINAL BASE_EMBEDDED {
   }
 
   bool IsNormal() const {
-    DCHECK(!(details_.type() == NORMAL && !IsFound()));
-    return IsDescriptorOrDictionary() && type() == NORMAL;
+    return IsFound() && IsDescriptorOrDictionary() && type() == NORMAL;
   }
 
   bool IsConstant() const {
index dc3fc75..3ebd6b5 100644 (file)
@@ -5027,15 +5027,12 @@ RUNTIME_FUNCTION(Runtime_DefineDataPropertyUnchecked) {
     return isolate->heap()->undefined_value();
   }
 
-  LookupResult lookup(isolate);
-  js_object->LookupOwnRealNamedProperty(name, &lookup);
+  LookupIterator it(js_object, name, LookupIterator::CHECK_PROPERTY);
 
   // Take special care when attributes are different and there is already
-  // a property. For simplicity we normalize the property which enables us
-  // to not worry about changing the instance_descriptor and creating a new
-  // map.
-  if (lookup.IsFound() &&
-      (attr != lookup.GetAttributes() || lookup.IsPropertyCallbacks())) {
+  // a property.
+  if (it.IsFound() && it.HasProperty() &&
+      it.property_kind() == LookupIterator::ACCESSOR) {
     // Use IgnoreAttributes version since a readonly property may be
     // overridden and SetProperty does not allow this.
     Handle<Object> result;