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

Unified Diff: runtime/vm/intermediate_language_ia32.cc

Issue 12218008: Inline getters of byte array view in the optimized flow graph. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: updated vm.status with new test Created 7 years, 10 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
Index: runtime/vm/intermediate_language_ia32.cc
===================================================================
--- runtime/vm/intermediate_language_ia32.cc (revision 18171)
+++ runtime/vm/intermediate_language_ia32.cc (working copy)
@@ -1181,9 +1181,11 @@
Register result = locs()->out().reg();
const Address& element_address = index.IsRegister()
? FlowGraphCompiler::ExternalElementAddressForRegIndex(
- class_id(), result, index.reg())
+ class_id(), index_scale(), result, index.reg())
: FlowGraphCompiler::ExternalElementAddressForIntIndex(
- class_id(), result, Smi::Cast(index.constant()).Value());
+ class_id(), index_scale(), result,
+ Smi::Cast(index.constant()).Value());
+ ASSERT(index_scale() == 1);
if (index.IsRegister()) {
__ SmiUntag(index.reg());
}
@@ -1199,13 +1201,17 @@
FieldAddress element_address = index.IsRegister()
? FlowGraphCompiler::ElementAddressForRegIndex(
- class_id(), array, index.reg())
+ class_id(), index_scale(), array, index.reg())
: FlowGraphCompiler::ElementAddressForIntIndex(
- class_id(), array, Smi::Cast(index.constant()).Value());
+ class_id(), index_scale(), array,
+ Smi::Cast(index.constant()).Value());
if ((representation() == kUnboxedDouble) ||
(representation() == kUnboxedMint)) {
XmmRegister result = locs()->out().fpu_reg();
+ if (index_scale() == 1 && index.IsRegister()) {
srdjan 2013/02/06 17:11:16 Use parenthesis, here and below.
Florian Schneider 2013/02/14 12:20:51 Done.
+ __ SmiUntag(index.reg());
+ }
switch (class_id()) {
case kInt32ArrayCid:
__ movss(result, element_address);
@@ -1224,27 +1230,28 @@
__ movsd(result, element_address);
break;
}
+ if (index_scale() == 1 && index.IsRegister()) {
+ __ SmiTag(index.reg()); // Re-tag.
+ }
return;
}
Register result = locs()->out().reg();
+ if (index_scale() == 1 && index.IsRegister()) {
+ __ SmiUntag(index.reg());
+ }
switch (class_id()) {
case kInt8ArrayCid:
case kUint8ArrayCid:
case kUint8ClampedArrayCid:
case kOneByteStringCid:
- if (index.IsRegister()) {
- __ SmiUntag(index.reg());
- }
+ ASSERT(index_scale() == 1);
if (class_id() == kInt8ArrayCid) {
__ movsxb(result, element_address);
} else {
__ movzxb(result, element_address);
}
__ SmiTag(result);
- if (index.IsRegister()) {
- __ SmiTag(index.reg()); // Re-tag.
- }
break;
case kInt16ArrayCid:
__ movsxw(result, element_address);
@@ -1278,6 +1285,9 @@
__ movl(result, element_address);
break;
}
+ if (index_scale() == 1 && index.IsRegister()) {
+ __ SmiTag(index.reg()); // Re-tag.
+ }
}
@@ -1358,11 +1368,13 @@
Register array = locs()->in(0).reg();
Location index = locs()->in(1);
+ intptr_t index_scale = FlowGraphCompiler::ElementSizeFor(class_id());
+
FieldAddress element_address = index.IsRegister() ?
FlowGraphCompiler::ElementAddressForRegIndex(
- class_id(), array, index.reg()) :
+ class_id(), index_scale, array, index.reg()) :
FlowGraphCompiler::ElementAddressForIntIndex(
- class_id(), array, Smi::Cast(index.constant()).Value());
+ class_id(), index_scale, array, Smi::Cast(index.constant()).Value());
switch (class_id()) {
case kArrayCid:

Powered by Google App Engine
This is Rietveld 408576698