Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 82c9b70e33a2e22068db4bb5a42872dd2402f245..c54455e152a17af0fabcbbea3e82a213b76c0f13 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -3188,11 +3188,13 @@ void HGraphBuilder::HandlePropertyAssignment(Assignment* expr) { |
if (expr->IsMonomorphic()) { |
Handle<Map> receiver_type(expr->GetMonomorphicReceiverType()); |
- // An object has either fast elements or pixel array elements, but 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_pixel_array_elements()) { |
- instr = BuildStoreKeyedPixelArrayElement(object, key, value, expr); |
+ // An object has either fast elements or external array elements, but |
+ // 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); |
+ } |
} else if (receiver_type->has_fast_elements()) { |
instr = BuildStoreKeyedFastElement(object, key, value, expr); |
} |
@@ -3575,15 +3577,15 @@ HInstruction* HGraphBuilder::BuildLoadKeyedPixelArrayElement(HValue* object, |
AddInstruction(new HCheckNonSmi(object)); |
Handle<Map> map = expr->GetMonomorphicReceiverType(); |
ASSERT(!map->has_fast_elements()); |
- ASSERT(map->has_pixel_array_elements()); |
+ ASSERT(map->has_external_array_elements()); |
AddInstruction(new HCheckMap(object, map)); |
HLoadElements* elements = new HLoadElements(object); |
AddInstruction(elements); |
- HInstruction* length = new HPixelArrayLength(elements); |
+ HInstruction* length = new HExternalArrayLength(elements); |
AddInstruction(length); |
AddInstruction(new HBoundsCheck(key, length)); |
- HLoadPixelArrayExternalPointer* external_elements = |
- new HLoadPixelArrayExternalPointer(elements); |
+ HLoadExternalArrayPointer* external_elements = |
+ new HLoadExternalArrayPointer(elements); |
AddInstruction(external_elements); |
HLoadPixelArrayElement* pixel_array_value = |
new HLoadPixelArrayElement(external_elements, key); |
@@ -3632,14 +3634,14 @@ HInstruction* HGraphBuilder::BuildStoreKeyedPixelArrayElement( |
AddInstruction(new HCheckNonSmi(object)); |
Handle<Map> map = expr->GetMonomorphicReceiverType(); |
ASSERT(!map->has_fast_elements()); |
- ASSERT(map->has_pixel_array_elements()); |
+ ASSERT(map->has_external_array_elements()); |
AddInstruction(new HCheckMap(object, map)); |
HLoadElements* elements = new HLoadElements(object); |
AddInstruction(elements); |
- HInstruction* length = AddInstruction(new HPixelArrayLength(elements)); |
+ HInstruction* length = AddInstruction(new HExternalArrayLength(elements)); |
AddInstruction(new HBoundsCheck(key, length)); |
- HLoadPixelArrayExternalPointer* external_elements = |
- new HLoadPixelArrayExternalPointer(elements); |
+ HLoadExternalArrayPointer* external_elements = |
+ new HLoadExternalArrayPointer(elements); |
AddInstruction(external_elements); |
return new HStorePixelArrayElement(external_elements, key, val); |
} |
@@ -3729,8 +3731,10 @@ void HGraphBuilder::VisitProperty(Property* expr) { |
// An object has either fast elements or pixel array elements, but 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_pixel_array_elements()) { |
- instr = BuildLoadKeyedPixelArrayElement(obj, key, expr); |
+ if (receiver_type->has_external_array_elements()) { |
+ if (expr->GetExternalArrayType() == kExternalPixelArray) { |
+ instr = BuildLoadKeyedPixelArrayElement(obj, key, expr); |
+ } |
} else if (receiver_type->has_fast_elements()) { |
instr = BuildLoadKeyedFastElement(obj, key, expr); |
} |