Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(982)

Unified Diff: src/stub-cache-arm.cc

Issue 16594: Fix for issue 171:... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-171.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/stub-cache-arm.cc
===================================================================
--- src/stub-cache-arm.cc (revision 1041)
+++ src/stub-cache-arm.cc (working copy)
@@ -312,20 +312,24 @@
}
+// Generate code to load the length from a string object and return the length.
+// If the receiver object is not a string or a wrapped string object the
+// execution continues at the miss label. The register containing the
+// receiver is potentially clobbered.
void StubCompiler::GenerateLoadStringLength2(MacroAssembler* masm,
Register receiver,
Register scratch1,
Register scratch2,
Label* miss) {
- Label load_length, check_wrapper;
+ Label check_string, check_wrapper;
+ __ bind(&check_string);
// Check if the object is a string leaving the instance type in the
// scratch1 register.
GenerateStringCheck(masm, receiver, scratch1, scratch2,
miss, &check_wrapper);
// Load length directly from the string.
- __ bind(&load_length);
__ and_(scratch1, scratch1, Operand(kStringSizeMask));
__ add(scratch1, scratch1, Operand(String::kHashShift));
__ ldr(r0, FieldMemOperand(receiver, String::kLengthOffset));
@@ -338,11 +342,9 @@
__ cmp(scratch1, Operand(JS_VALUE_TYPE));
__ b(ne, miss);
- // Check if the wrapped value is a string and load the length
- // directly if it is.
- __ ldr(r0, FieldMemOperand(receiver, JSValue::kValueOffset));
- GenerateStringCheck(masm, receiver, scratch1, scratch1, miss, miss);
- __ b(&load_length);
+ // Unwrap the value in place and check if the wrapped value is a string.
+ __ ldr(receiver, FieldMemOperand(receiver, JSValue::kValueOffset));
+ __ b(&check_string);
}
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-171.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698