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

Unified Diff: src/lithium.cc

Issue 6902112: Avoid using a register for constant external array indices. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: add arch-independent ExternalArrayTypeToShiftSize() function Created 9 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
« no previous file with comments | « src/lithium.h ('k') | src/x64/lithium-codegen-x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lithium.cc
diff --git a/src/lithium.cc b/src/lithium.cc
index aeac2db562ab01296b2c63680cf05a1ba49d8fb2..62b263be114698796fd2ec314404d35471aa490e 100644
--- a/src/lithium.cc
+++ b/src/lithium.cc
@@ -166,4 +166,25 @@ void LPointerMap::PrintTo(StringStream* stream) {
}
+int ExternalArrayTypeToShiftSize(ExternalArrayType type) {
+ switch (type) {
+ case kExternalByteArray:
+ case kExternalUnsignedByteArray:
+ case kExternalPixelArray:
+ return 0;
+ case kExternalShortArray:
+ case kExternalUnsignedShortArray:
+ return 1;
+ case kExternalIntArray:
+ case kExternalUnsignedIntArray:
+ case kExternalFloatArray:
+ return 2;
+ case kExternalDoubleArray:
+ return 3;
+ }
+ UNREACHABLE();
+ return 0;
+}
+
+
} } // namespace v8::internal
« no previous file with comments | « src/lithium.h ('k') | src/x64/lithium-codegen-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698