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

Unified Diff: runtime/vm/intrinsifier_x64.cc

Issue 54463004: Fix issue 14659: intrinsic method must check if the start, end arguments are Smi. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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 | « runtime/vm/intrinsifier_mips.cc ('k') | tests/language/substring_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intrinsifier_x64.cc
===================================================================
--- runtime/vm/intrinsifier_x64.cc (revision 29681)
+++ runtime/vm/intrinsifier_x64.cc (working copy)
@@ -1579,7 +1579,7 @@
}
-// Arg0: Onebyte String
+// Arg0: OneByteString (receiver).
// Arg1: Start index as Smi.
// Arg2: End index as Smi.
// The indexes must be valid.
@@ -1588,7 +1588,12 @@
const intptr_t kStartIndexOffset = 2 * kWordSize;
const intptr_t kEndIndexOffset = 1 * kWordSize;
Label fall_through, ok;
+ __ movq(RSI, Address(RSP, + kEndIndexOffset));
__ movq(RDI, Address(RSP, + kEndIndexOffset));
+ __ orq(RSI, RDI);
+ __ testq(RSI, Immediate(kSmiTagMask));
+ __ j(NOT_ZERO, &fall_through); // 'start', 'end' not Smi.
+
__ subq(RDI, Address(RSP, + kStartIndexOffset));
TryAllocateOnebyteString(assembler, &ok, &fall_through, RDI);
__ Bind(&ok);
« no previous file with comments | « runtime/vm/intrinsifier_mips.cc ('k') | tests/language/substring_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698