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

Unified Diff: runtime/vm/intrinsifier_ia32.cc

Issue 9921017: Intrinsify methods early. Fix some bugs in trinsified code, mark one precision-related bug as SKIP … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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/code_generator_ia32.cc ('k') | runtime/vm/opt_code_generator_ia32.h » ('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 5980)
+++ runtime/vm/intrinsifier_ia32.cc (working copy)
@@ -105,6 +105,8 @@
// Assert that length is a Smi.
__ testl(EDI, Immediate(kSmiTagSize));
__ j(NOT_ZERO, &fall_through);
+ __ cmpl(EDI, Immediate(0));
+ __ j(LESS, &fall_through, Assembler::kNearJump);
intptr_t fixed_size = sizeof(RawArray) + kObjectAlignment - 1;
__ leal(EDI, Address(EDI, TIMES_2, fixed_size)); // EDI is a Smi.
ASSERT(kSmiTagShift == 1);
@@ -121,7 +123,7 @@
// EBX: potential next object start.
// EDI: allocation size.
__ cmpl(EBX, Address::Absolute(heap->EndAddress()));
- __ j(ABOVE_EQUAL, &fall_through);
+ __ j(ABOVE_EQUAL, &fall_through, Assembler::kNearJump);
// Successfully allocated the object(s), now update top to point to
// next object start and initialize the object.
@@ -138,7 +140,7 @@
__ j(ABOVE, &size_tag_overflow, Assembler::kNearJump);
__ shll(EDI, Immediate(RawObject::kSizeTagBit - kObjectAlignmentLog2));
__ movl(FieldAddress(EAX, Array::tags_offset()), EDI); // Tags.
- __ jmp(&done);
+ __ jmp(&done, Assembler::kNearJump);
__ Bind(&size_tag_overflow);
__ movl(FieldAddress(EAX, Array::tags_offset()), Immediate(0));
@@ -487,6 +489,9 @@
Label fall_through, return_zero;
TestBothArgumentsSmis(assembler, &fall_through);
// EAX: right argument (divisor)
+ // Check if modulo by zero -> exception thrown in main function.
+ __ cmpl(EAX, Immediate(0));
+ __ j(EQUAL, &fall_through, Assembler::kNearJump);
__ movl(EBX, Address(ESP, + 2 * kWordSize)); // Left argument (dividend).
__ cmpl(EBX, Immediate(0));
__ j(LESS, &fall_through, Assembler::kNearJump);
@@ -735,6 +740,9 @@
// For shifting right a Smi the result is the same for all numbers
// >= count_limit.
__ SmiUntag(EAX);
+ // Negative counts throw exception.
+ __ cmpl(EAX, Immediate(0));
+ __ j(LESS, &fall_through, Assembler::kNearJump);
__ cmpl(EAX, count_limit);
__ j(LESS_EQUAL, &shift_count_ok, Assembler::kNearJump);
__ movl(EAX, count_limit);
« no previous file with comments | « runtime/vm/code_generator_ia32.cc ('k') | runtime/vm/opt_code_generator_ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698