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

Unified Diff: runtime/vm/intermediate_language_x64.cc

Issue 294223003: Last cross-platform cleanup in preparation of improved ARM code for indexed (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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_x64.cc
===================================================================
--- runtime/vm/intermediate_language_x64.cc (revision 36535)
+++ runtime/vm/intermediate_language_x64.cc (working copy)
@@ -955,26 +955,16 @@
Register array = locs()->in(0).reg();
Location index = locs()->in(1);
- const bool is_external =
- (this->array()->definition()->representation() == kUntagged);
Address element_address(kNoRegister, 0);
+ element_address = index.IsRegister()
+ ? compiler->ElementAddressForRegIndex(
+ true, // Load.
+ IsExternal(), class_id(), index_scale(), array, index.reg())
+ : compiler->ElementAddressForIntIndex(
+ true, // Load.
+ IsExternal(), class_id(), index_scale(), array,
+ Smi::Cast(index.constant()).Value());
- if (is_external) {
- element_address = index.IsRegister()
- ? compiler->ExternalElementAddressForRegIndex(
- index_scale(), array, index.reg())
- : compiler->ExternalElementAddressForIntIndex(
- index_scale(), array, Smi::Cast(index.constant()).Value());
- } else {
- ASSERT(this->array()->definition()->representation() == kTagged);
- element_address = index.IsRegister()
- ? compiler->ElementAddressForRegIndex(
- class_id(), index_scale(), array, index.reg())
- : compiler->ElementAddressForIntIndex(
- class_id(), index_scale(), array,
- Smi::Cast(index.constant()).Value());
- }
-
if ((representation() == kUnboxedDouble) ||
(representation() == kUnboxedFloat32x4) ||
(representation() == kUnboxedInt32x4) ||
@@ -1138,24 +1128,15 @@
Register array = locs()->in(0).reg();
Location index = locs()->in(1);
- const bool is_external =
- (this->array()->definition()->representation() == kUntagged);
Address element_address(kNoRegister, 0);
- if (is_external) {
- element_address = index.IsRegister()
- ? compiler->ExternalElementAddressForRegIndex(
- index_scale(), array, index.reg())
- : compiler->ExternalElementAddressForIntIndex(
- index_scale(), array, Smi::Cast(index.constant()).Value());
- } else {
- ASSERT(this->array()->definition()->representation() == kTagged);
- element_address = index.IsRegister()
- ? compiler->ElementAddressForRegIndex(
- class_id(), index_scale(), array, index.reg())
- : compiler->ElementAddressForIntIndex(
- class_id(), index_scale(), array,
- Smi::Cast(index.constant()).Value());
- }
+ element_address = index.IsRegister()
+ ? compiler->ElementAddressForRegIndex(
+ false, // Store.
+ IsExternal(), class_id(), index_scale(), array, index.reg())
+ : compiler->ElementAddressForIntIndex(
+ false, // Store.
+ IsExternal(), class_id(), index_scale(), array,
+ Smi::Cast(index.constant()).Value());
if ((index_scale() == 1) && index.IsRegister()) {
__ SmiUntag(index.reg());
« runtime/vm/flow_graph_compiler_ia32.cc ('K') | « runtime/vm/intermediate_language_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698