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

Unified Diff: dart/runtime/vm/intermediate_language_ia32.cc

Issue 119673004: Version 1.1.0-dev.5.2 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 6 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 | « dart/runtime/vm/intermediate_language_arm.cc ('k') | dart/runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/runtime/vm/intermediate_language_ia32.cc
===================================================================
--- dart/runtime/vm/intermediate_language_ia32.cc (revision 31530)
+++ dart/runtime/vm/intermediate_language_ia32.cc (working copy)
@@ -98,13 +98,6 @@
#endif
__ LeaveFrame();
__ ret();
-
- // Generate 1 byte NOP so that the debugger can patch the
- // return pattern with a call to the debug stub.
- __ nop(1);
- compiler->AddCurrentDescriptor(PcDescriptors::kReturn,
- Isolate::kNoDeoptId,
- token_pos());
}
@@ -742,6 +735,31 @@
}
+LocationSummary* StringToCharCodeInstr::MakeLocationSummary(bool opt) const {
+ const intptr_t kNumInputs = 1;
+ return LocationSummary::Make(kNumInputs,
+ Location::RequiresRegister(),
+ LocationSummary::kNoCall);
+}
+
+
+void StringToCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ ASSERT(cid_ == kOneByteStringCid);
+ Register str = locs()->in(0).reg();
+ Register result = locs()->out().reg();
+ Label is_one, done;
+ __ movl(result, FieldAddress(str, String::length_offset()));
+ __ cmpl(result, Immediate(Smi::RawValue(1)));
+ __ j(EQUAL, &is_one, Assembler::kNearJump);
+ __ movl(result, Immediate(Smi::RawValue(-1)));
+ __ jmp(&done);
+ __ Bind(&is_one);
+ __ movzxb(result, FieldAddress(str, OneByteString::data_offset()));
+ __ SmiTag(result);
+ __ Bind(&done);
+}
+
+
LocationSummary* StringInterpolateInstr::MakeLocationSummary(bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
@@ -4468,13 +4486,20 @@
}
+// Length: register or constant.
+// Index: register, constant or stack slot.
LocationSummary* CheckArrayBoundInstr::MakeLocationSummary(bool opt) const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
LocationSummary* locs =
new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length()));
- locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index()));
+ ConstantInstr* index_constant = index()->definition()->AsConstant();
+ if (index_constant != NULL) {
+ locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index()));
+ } else {
+ locs->set_in(kIndexPos, Location::PrefersRegister());
+ }
return locs;
}
@@ -4509,9 +4534,19 @@
__ j(BELOW_EQUAL, deopt);
} else if (length_loc.IsConstant()) {
const Smi& length = Smi::Cast(length_loc.constant());
- Register index = index_loc.reg();
- __ cmpl(index, Immediate(reinterpret_cast<int32_t>(length.raw())));
+ if (index_loc.IsStackSlot()) {
+ const Address& index = index_loc.ToStackSlotAddress();
+ __ cmpl(index, Immediate(reinterpret_cast<int32_t>(length.raw())));
+ } else {
+ Register index = index_loc.reg();
+ __ cmpl(index, Immediate(reinterpret_cast<int32_t>(length.raw())));
+ }
__ j(ABOVE_EQUAL, deopt);
+ } else if (index_loc.IsStackSlot()) {
+ Register length = length_loc.reg();
+ const Address& index = index_loc.ToStackSlotAddress();
+ __ cmpl(length, index);
+ __ j(BELOW_EQUAL, deopt);
} else {
Register length = length_loc.reg();
Register index = index_loc.reg();
« no previous file with comments | « dart/runtime/vm/intermediate_language_arm.cc ('k') | dart/runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698