Author: [EMAIL PROTECTED]
Date: Tue Oct 28 03:25:35 2008
New Revision: 622

Modified:
    branches/bleeding_edge/src/ic-arm.cc
    branches/bleeding_edge/src/stub-cache-ia32.cc

Log:
In my final round of refactoring, I accidentally broke my string
lenght optimization.  Here is the fix: check that the instance type
not the receiver is JS_VALUE_TYPE.

Review URL: http://codereview.chromium.org/8656

Modified: branches/bleeding_edge/src/ic-arm.cc
==============================================================================
--- branches/bleeding_edge/src/ic-arm.cc        (original)
+++ branches/bleeding_edge/src/ic-arm.cc        Tue Oct 28 03:25:35 2008
@@ -190,7 +190,8 @@

    __ ldr(r0, MemOperand(sp, 0));

-  // Check if the object is a string.
+  // Check if the object is a string leaving the instance type in the
+  // r1 register.
    GenerateStringCheck(masm, r0, r1, r3, &miss, &check_wrapper);

    // Load length directly from the string.
@@ -204,7 +205,7 @@

    // Check if the object is a JSValue wrapper.
    __ bind(&check_wrapper);
-  __ cmp(r0, Operand(JS_VALUE_TYPE));
+  __ cmp(r1, Operand(JS_VALUE_TYPE));
    __ b(ne, &miss);

    // Check if the wrapped value is a string and load the length

Modified: branches/bleeding_edge/src/stub-cache-ia32.cc
==============================================================================
--- branches/bleeding_edge/src/stub-cache-ia32.cc       (original)
+++ branches/bleeding_edge/src/stub-cache-ia32.cc       Tue Oct 28 03:25:35 2008
@@ -185,7 +185,8 @@
                                              Label* miss) {
    Label load_length, check_wrapper;

-  // Check if the object is a string.
+  // Check if the object is a string leaving the instance type in the
+  // scratch register.
    GenerateStringCheck(masm, receiver, scratch, miss, &check_wrapper);

    // Load length directly from the string.
@@ -200,7 +201,7 @@

    // Check if the object is a JSValue wrapper.
    __ bind(&check_wrapper);
-  __ cmp(receiver, JS_VALUE_TYPE);
+  __ cmp(scratch, JS_VALUE_TYPE);
    __ j(not_equal, miss, not_taken);

    // Check if the wrapped value is a string and load the length

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to