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

Unified Diff: runtime/vm/intermediate_language_ia32.cc

Issue 12378039: Inline ByteArray setters like setUint8 in the optimizer. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: addressed comments Created 7 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/intermediate_language.h ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_ia32.cc
===================================================================
--- runtime/vm/intermediate_language_ia32.cc (revision 19765)
+++ runtime/vm/intermediate_language_ia32.cc (working copy)
@@ -1332,8 +1332,7 @@
locs->set_in(0, Location::RequiresRegister());
// The smi index is either untagged (element size == 1), or it is left smi
// tagged (for all element sizes > 1).
- intptr_t index_scale = FlowGraphCompiler::ElementSizeFor(class_id());
- if (index_scale == 1) {
+ if (index_scale() == 1) {
locs->set_in(1, CanBeImmediateIndex(index(), class_id())
? Location::Constant(
index()->definition()->AsConstant()->value())
@@ -1395,28 +1394,30 @@
Register array = locs()->in(0).reg();
Location index = locs()->in(1);
- intptr_t index_scale = FlowGraphCompiler::ElementSizeFor(class_id());
-
Address element_address(kNoRegister, 0);
if ((class_id() == kExternalUint8ArrayCid) ||
(class_id() == kExternalUint8ClampedArrayCid)) {
Register temp = locs()->temp(0).reg();
element_address = index.IsRegister()
? FlowGraphCompiler::ExternalElementAddressForRegIndex(
- class_id(), index_scale, temp, index.reg())
+ class_id(), index_scale(), temp, index.reg())
: FlowGraphCompiler::ExternalElementAddressForIntIndex(
- class_id(), index_scale, temp,
+ class_id(), index_scale(), temp,
Smi::Cast(index.constant()).Value());
__ movl(temp,
FieldAddress(array, ExternalUint8Array::data_offset()));
} else {
element_address = index.IsRegister()
? FlowGraphCompiler::ElementAddressForRegIndex(
- class_id(), index_scale, array, index.reg())
+ class_id(), index_scale(), array, index.reg())
: FlowGraphCompiler::ElementAddressForIntIndex(
- class_id(), index_scale, array, Smi::Cast(index.constant()).Value());
+ class_id(), index_scale(), array,
+ Smi::Cast(index.constant()).Value());
}
+ if ((index_scale() == 1) && index.IsRegister()) {
+ __ SmiUntag(index.reg());
+ }
switch (class_id()) {
case kArrayCid:
if (ShouldEmitStoreBarrier()) {
@@ -1433,9 +1434,6 @@
case kInt8ArrayCid:
case kUint8ArrayCid:
case kExternalUint8ArrayCid:
- if (index.IsRegister()) {
- __ SmiUntag(index.reg());
- }
if (locs()->in(2).IsConstant()) {
const Smi& constant = Smi::Cast(locs()->in(2).constant());
__ movb(element_address,
@@ -1448,9 +1446,6 @@
break;
case kUint8ClampedArrayCid:
case kExternalUint8ClampedArrayCid: {
- if (index.IsRegister()) {
- __ SmiUntag(index.reg());
- }
if (locs()->in(2).IsConstant()) {
const Smi& constant = Smi::Cast(locs()->in(2).constant());
intptr_t value = constant.Value();
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698