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

Unified Diff: src/hydrogen.cc

Issue 6961019: Prevent deopt on double value assignment to typed arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: more review feedback 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/arm/stub-cache-arm.cc ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 6e520bd85acf933872d52855e3cfe7ec4ef45f45..cb2af8622933324c05519831bd02fe5eedfb1856 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -3805,10 +3805,28 @@ HInstruction* HGraphBuilder::BuildStoreKeyedSpecializedArrayElement(
HLoadExternalArrayPointer* external_elements =
new(zone()) HLoadExternalArrayPointer(elements);
AddInstruction(external_elements);
- if (expr->external_array_type() == kExternalPixelArray) {
- HClampToUint8* clamp = new(zone()) HClampToUint8(val);
- AddInstruction(clamp);
- val = clamp;
+ ExternalArrayType array_type = expr->external_array_type();
+ switch (array_type) {
+ case kExternalPixelArray: {
+ HClampToUint8* clamp = new(zone()) HClampToUint8(val);
+ AddInstruction(clamp);
+ val = clamp;
+ break;
+ }
+ case kExternalByteArray:
+ case kExternalUnsignedByteArray:
+ case kExternalShortArray:
+ case kExternalUnsignedShortArray:
+ case kExternalIntArray:
+ case kExternalUnsignedIntArray: {
+ HToInt32* floor_val = new(zone()) HToInt32(val);
+ AddInstruction(floor_val);
+ val = floor_val;
+ break;
+ }
+ case kExternalFloatArray:
+ case kExternalDoubleArray:
+ break;
}
return new(zone()) HStoreKeyedSpecializedArrayElement(
external_elements,
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698