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

Unified Diff: src/arm/ic-arm.cc

Issue 1628003: Port string stub for keyed loads to x64 and ARM (http://code.google.com/p/v8/... (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: '' Created 10 years, 8 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 | src/x64/ic-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/ic-arm.cc
===================================================================
--- src/arm/ic-arm.cc (revision 4328)
+++ src/arm/ic-arm.cc (working copy)
@@ -706,6 +706,29 @@
// -- sp[4] : receiver
// -----------------------------------
+ Label miss, index_ok;
+
+ // Get the key and receiver object from the stack.
+ __ ldm(ia, sp, r0.bit() | r1.bit());
+
+ // Check that the receiver isn't a smi.
+ __ BranchOnSmi(r1, &miss);
+
+ // Check that the receiver is a string.
+ Condition is_string = masm->IsObjectStringType(r1, r2);
+ __ b(NegateCondition(is_string), &miss);
+
+ // Check if key is a smi or a heap number.
+ __ BranchOnSmi(r0, &index_ok);
+ __ CheckMap(r0, r2, Factory::heap_number_map(), &miss, false);
+
+ __ bind(&index_ok);
+ // Duplicate receiver and key since they are expected on the stack after
+ // the KeyedLoadIC call.
+ __ stm(db_w, sp, r0.bit() | r1.bit());
+ __ InvokeBuiltin(Builtins::STRING_CHAR_AT, JUMP_JS);
+
+ __ bind(&miss);
GenerateGeneric(masm);
}
« no previous file with comments | « no previous file | src/x64/ic-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698