[chromium] Tiny change to DomStorage v8 bindings to avoid a relatively expensive...
authormichaeln@google.com <michaeln@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Apr 2012 01:02:51 +0000 (01:02 +0000)
committermichaeln@google.com <michaeln@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Apr 2012 01:02:51 +0000 (01:02 +0000)
of places by reordering the expressions in compound conditions, if (fastTest && moreExpensiveTest)
https://bugs.webkit.org/show_bug.cgi?id=84500

Reviewed by Kentaro Hara.

No new tests, no new functionality.

* bindings/v8/custom/V8StorageCustom.cpp:
(WebCore::storageGetter):
(WebCore::V8Storage::namedPropertyQuery):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@114814 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/bindings/v8/custom/V8StorageCustom.cpp

index aa7255a..e77f603 100644 (file)
@@ -1,3 +1,17 @@
+2012-04-20  Michael Nordman  <michaeln@google.com>
+
+        [chromium] Tiny change to DomStorage v8 bindings to avoid a relatively expensive test in a couple
+        of places by reordering the expressions in compound conditions, if (fastTest && moreExpensiveTest)
+        https://bugs.webkit.org/show_bug.cgi?id=84500
+
+        Reviewed by Kentaro Hara.
+
+        No new tests, no new functionality.
+
+        * bindings/v8/custom/V8StorageCustom.cpp:
+        (WebCore::storageGetter):
+        (WebCore::V8Storage::namedPropertyQuery):
+
 2012-04-20  Dan Bernstein  <mitz@apple.com>
 
         REGRESSION (r114784): svg/text/foreignObject-text-clipping-bug.xml failing on Mountain Lion Debug Tests
index a336ca0..8963304 100644 (file)
@@ -58,7 +58,7 @@ static v8::Handle<v8::Value> storageGetter(v8::Local<v8::String> v8Name, const v
     Storage* storage = V8Storage::toNative(info.Holder());
     String name = toWebCoreString(v8Name);
 
-    if (storage->contains(name) && name != "length")
+    if (name != "length" && storage->contains(name))
         return v8String(storage->getItem(name));
 
     return notHandledByInterceptor();
@@ -86,7 +86,7 @@ v8::Handle<v8::Integer> V8Storage::namedPropertyQuery(v8::Local<v8::String> v8Na
     Storage* storage = V8Storage::toNative(info.Holder());
     String name = toWebCoreString(v8Name);
 
-    if (storage->contains(name) && name != "length")
+    if (name != "length" && storage->contains(name))
         return v8::Integer::New(v8::None);
 
     return v8::Handle<v8::Integer>();