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

Unified Diff: src/hydrogen.cc

Issue 6656001: Support external arrays in Crankshaft (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: stub out arm Created 9 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
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 28a89085f254341851c1f9ab86f05d7b93da716a..6fc5156d4739d7435f65fccf2a30f0f9dca21310 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -3219,9 +3219,10 @@ void HGraphBuilder::HandlePropertyAssignment(Assignment* expr) {
// never both. Pixel array maps that are assigned to pixel array elements
// are always created with the fast elements flag cleared.
if (receiver_type->has_external_array_elements()) {
- if (expr->GetExternalArrayType() == kExternalPixelArray) {
- instr = BuildStoreKeyedPixelArrayElement(object, key, value, expr);
- }
+ instr = BuildStoreKeyedSpecializedArrayElement(object,
+ key,
+ value,
+ expr);
} else if (receiver_type->has_fast_elements()) {
instr = BuildStoreKeyedFastElement(object, key, value, expr);
}
@@ -3597,9 +3598,10 @@ HInstruction* HGraphBuilder::BuildLoadKeyedFastElement(HValue* object,
}
-HInstruction* HGraphBuilder::BuildLoadKeyedPixelArrayElement(HValue* object,
- HValue* key,
- Property* expr) {
+HInstruction* HGraphBuilder::BuildLoadKeyedSpecializedArrayElement(
+ HValue* object,
+ HValue* key,
+ Property* expr) {
ASSERT(!expr->key()->IsPropertyName() && expr->IsMonomorphic());
AddInstruction(new HCheckNonSmi(object));
Handle<Map> map = expr->GetMonomorphicReceiverType();
@@ -3614,8 +3616,10 @@ HInstruction* HGraphBuilder::BuildLoadKeyedPixelArrayElement(HValue* object,
HLoadExternalArrayPointer* external_elements =
new HLoadExternalArrayPointer(elements);
AddInstruction(external_elements);
- HLoadPixelArrayElement* pixel_array_value =
- new HLoadPixelArrayElement(external_elements, key);
+ HLoadKeyedSpecializedArrayElement* pixel_array_value =
+ new HLoadKeyedSpecializedArrayElement(external_elements,
+ key,
+ expr->GetExternalArrayType());
return pixel_array_value;
}
@@ -3653,11 +3657,11 @@ HInstruction* HGraphBuilder::BuildStoreKeyedFastElement(HValue* object,
}
-HInstruction* HGraphBuilder::BuildStoreKeyedPixelArrayElement(
+HInstruction* HGraphBuilder::BuildStoreKeyedSpecializedArrayElement(
HValue* object,
HValue* key,
HValue* val,
- Expression* expr) {
+ Assignment* expr) {
ASSERT(expr->IsMonomorphic());
AddInstruction(new HCheckNonSmi(object));
Handle<Map> map = expr->GetMonomorphicReceiverType();
@@ -3671,7 +3675,11 @@ HInstruction* HGraphBuilder::BuildStoreKeyedPixelArrayElement(
HLoadExternalArrayPointer* external_elements =
new HLoadExternalArrayPointer(elements);
AddInstruction(external_elements);
- return new HStorePixelArrayElement(external_elements, key, val);
+ return new HStoreKeyedSpecializedArrayElement(
+ external_elements,
+ key,
+ val,
+ expr->GetExternalArrayType());
}
@@ -3767,9 +3775,7 @@ void HGraphBuilder::VisitProperty(Property* expr) {
// both. Pixel array maps that are assigned to pixel array elements are
// always created with the fast elements flag cleared.
if (receiver_type->has_external_array_elements()) {
- if (expr->GetExternalArrayType() == kExternalPixelArray) {
- instr = BuildLoadKeyedPixelArrayElement(obj, key, expr);
- }
+ instr = BuildLoadKeyedSpecializedArrayElement(obj, key, expr);
} else if (receiver_type->has_fast_elements()) {
instr = BuildLoadKeyedFastElement(obj, key, expr);
}

Powered by Google App Engine
This is Rietveld 408576698