OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 3707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3718 ASSERT(map->has_external_array_elements()); | 3718 ASSERT(map->has_external_array_elements()); |
3719 AddInstruction(new(zone()) HCheckMap(object, map)); | 3719 AddInstruction(new(zone()) HCheckMap(object, map)); |
3720 HLoadElements* elements = new(zone()) HLoadElements(object); | 3720 HLoadElements* elements = new(zone()) HLoadElements(object); |
3721 AddInstruction(elements); | 3721 AddInstruction(elements); |
3722 HInstruction* length = AddInstruction( | 3722 HInstruction* length = AddInstruction( |
3723 new(zone()) HExternalArrayLength(elements)); | 3723 new(zone()) HExternalArrayLength(elements)); |
3724 AddInstruction(new(zone()) HBoundsCheck(key, length)); | 3724 AddInstruction(new(zone()) HBoundsCheck(key, length)); |
3725 HLoadExternalArrayPointer* external_elements = | 3725 HLoadExternalArrayPointer* external_elements = |
3726 new(zone()) HLoadExternalArrayPointer(elements); | 3726 new(zone()) HLoadExternalArrayPointer(elements); |
3727 AddInstruction(external_elements); | 3727 AddInstruction(external_elements); |
| 3728 if (expr->external_array_type() == kExternalPixelArray) { |
| 3729 HClampToUint8* clamp = new(zone()) HClampToUint8(val); |
| 3730 AddInstruction(clamp); |
| 3731 val = clamp; |
| 3732 } |
3728 return new(zone()) HStoreKeyedSpecializedArrayElement( | 3733 return new(zone()) HStoreKeyedSpecializedArrayElement( |
3729 external_elements, | 3734 external_elements, |
3730 key, | 3735 key, |
3731 val, | 3736 val, |
3732 expr->external_array_type()); | 3737 expr->external_array_type()); |
3733 } | 3738 } |
3734 | 3739 |
3735 | 3740 |
3736 HInstruction* HGraphBuilder::BuildStoreKeyed(HValue* object, | 3741 HInstruction* HGraphBuilder::BuildStoreKeyed(HValue* object, |
3737 HValue* key, | 3742 HValue* key, |
(...skipping 2401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6139 } | 6144 } |
6140 } | 6145 } |
6141 | 6146 |
6142 #ifdef DEBUG | 6147 #ifdef DEBUG |
6143 if (graph_ != NULL) graph_->Verify(); | 6148 if (graph_ != NULL) graph_->Verify(); |
6144 if (allocator_ != NULL) allocator_->Verify(); | 6149 if (allocator_ != NULL) allocator_->Verify(); |
6145 #endif | 6150 #endif |
6146 } | 6151 } |
6147 | 6152 |
6148 } } // namespace v8::internal | 6153 } } // namespace v8::internal |
OLD | NEW |