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

Unified Diff: src/ia32/lithium-ia32.h

Issue 11365084: Some improvements in register usage in lithium compilation of LoadKeyed/StoreKeyed operations. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed a compilation error in ia32 hydrogen->lithium. Created 8 years, 1 month 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: src/ia32/lithium-ia32.h
diff --git a/src/ia32/lithium-ia32.h b/src/ia32/lithium-ia32.h
index c226ea0e80fcaec8089d870f979eb8411ddac7b4..1611bc6ab5a78bbdb080918ec131779c13314062 100644
--- a/src/ia32/lithium-ia32.h
+++ b/src/ia32/lithium-ia32.h
@@ -1408,13 +1408,16 @@ class LLoadKeyed: public LTemplateInstruction<1, 2, 0> {
};
-inline static bool ExternalArrayOpRequiresTemp(
- Representation key_representation,
- ElementsKind elements_kind) {
+template <class T>
+inline static bool ExternalArrayOpRequiresTemp(T* value) {
+ CHECK(value->IsLoadKeyed() || value->IsStoreKeyed());
+ Representation key_representation = value->key()->representation();
+ ElementsKind elements_kind = value->elements_kind();
+
// Operations that require the key to be divided by two to be converted into
// an index cannot fold the scale operation into a load and need an extra
// temp register to do the work.
- return key_representation.IsTagged() &&
+ return !value->IsConstant() && key_representation.IsTagged() &&
(elements_kind == EXTERNAL_BYTE_ELEMENTS ||
elements_kind == EXTERNAL_UNSIGNED_BYTE_ELEMENTS ||
elements_kind == EXTERNAL_PIXEL_ELEMENTS);

Powered by Google App Engine
This is Rietveld 408576698