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

Unified Diff: runtime/vm/intrinsifier_ia32.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_arm.cc ('k') | runtime/vm/intrinsifier_mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intrinsifier_ia32.cc
===================================================================
--- runtime/vm/intrinsifier_ia32.cc (revision 29681)
+++ runtime/vm/intrinsifier_ia32.cc (working copy)
@@ -1668,7 +1668,7 @@
}
-// Arg0: Onebyte String
+// Arg0: OneByteString (receiver)
// Arg1: Start index as Smi.
// Arg2: End index as Smi.
// The indexes must be valid.
@@ -1677,7 +1677,12 @@
const intptr_t kStartIndexOffset = 2 * kWordSize;
const intptr_t kEndIndexOffset = 1 * kWordSize;
Label fall_through, ok;
+ __ movl(EAX, Address(ESP, + kStartIndexOffset));
__ movl(EDI, Address(ESP, + kEndIndexOffset));
+ __ orl(EAX, EDI);
+ __ testl(EAX, Immediate(kSmiTagMask));
+ __ j(NOT_ZERO, &fall_through); // 'start', 'end' not Smi.
+
__ subl(EDI, Address(ESP, + kStartIndexOffset));
TryAllocateOnebyteString(assembler, &ok, &fall_through, EDI);
__ Bind(&ok);
« no previous file with comments | « runtime/vm/intrinsifier_arm.cc ('k') | runtime/vm/intrinsifier_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698