| 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 3701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3712 HValue* key, | 3712 HValue* key, |
| 3713 Property* expr) { | 3713 Property* expr) { |
| 3714 ASSERT(!expr->key()->IsPropertyName() && expr->IsMonomorphic()); | 3714 ASSERT(!expr->key()->IsPropertyName() && expr->IsMonomorphic()); |
| 3715 AddInstruction(new HCheckNonSmi(object)); | 3715 AddInstruction(new HCheckNonSmi(object)); |
| 3716 Handle<Map> map = expr->GetMonomorphicReceiverType(); | 3716 Handle<Map> map = expr->GetMonomorphicReceiverType(); |
| 3717 ASSERT(!map->has_fast_elements()); | 3717 ASSERT(!map->has_fast_elements()); |
| 3718 ASSERT(map->has_pixel_array_elements()); | 3718 ASSERT(map->has_pixel_array_elements()); |
| 3719 AddInstruction(new HCheckMap(object, map)); | 3719 AddInstruction(new HCheckMap(object, map)); |
| 3720 HLoadElements* elements = new HLoadElements(object); | 3720 HLoadElements* elements = new HLoadElements(object); |
| 3721 AddInstruction(elements); | 3721 AddInstruction(elements); |
| 3722 HInstruction* length = new HPixelArrayLength(elements); | 3722 HInstruction* length = new HExternalArrayLength(elements); |
| 3723 AddInstruction(length); | 3723 AddInstruction(length); |
| 3724 AddInstruction(new HBoundsCheck(key, length)); | 3724 AddInstruction(new HBoundsCheck(key, length)); |
| 3725 HLoadPixelArrayExternalPointer* external_elements = | 3725 HLoadExternalArrayPointer* external_elements = |
| 3726 new HLoadPixelArrayExternalPointer(elements); | 3726 new HLoadExternalArrayPointer(elements); |
| 3727 AddInstruction(external_elements); | 3727 AddInstruction(external_elements); |
| 3728 HLoadPixelArrayElement* pixel_array_value = | 3728 HLoadPixelArrayElement* pixel_array_value = |
| 3729 new HLoadPixelArrayElement(external_elements, key); | 3729 new HLoadPixelArrayElement(external_elements, key); |
| 3730 return pixel_array_value; | 3730 return pixel_array_value; |
| 3731 } | 3731 } |
| 3732 | 3732 |
| 3733 | 3733 |
| 3734 HInstruction* HGraphBuilder::BuildStoreKeyedGeneric(HValue* object, | 3734 HInstruction* HGraphBuilder::BuildStoreKeyedGeneric(HValue* object, |
| 3735 HValue* key, | 3735 HValue* key, |
| 3736 HValue* value) { | 3736 HValue* value) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3769 HValue* val, | 3769 HValue* val, |
| 3770 Expression* expr) { | 3770 Expression* expr) { |
| 3771 ASSERT(expr->IsMonomorphic()); | 3771 ASSERT(expr->IsMonomorphic()); |
| 3772 AddInstruction(new HCheckNonSmi(object)); | 3772 AddInstruction(new HCheckNonSmi(object)); |
| 3773 Handle<Map> map = expr->GetMonomorphicReceiverType(); | 3773 Handle<Map> map = expr->GetMonomorphicReceiverType(); |
| 3774 ASSERT(!map->has_fast_elements()); | 3774 ASSERT(!map->has_fast_elements()); |
| 3775 ASSERT(map->has_pixel_array_elements()); | 3775 ASSERT(map->has_pixel_array_elements()); |
| 3776 AddInstruction(new HCheckMap(object, map)); | 3776 AddInstruction(new HCheckMap(object, map)); |
| 3777 HLoadElements* elements = new HLoadElements(object); | 3777 HLoadElements* elements = new HLoadElements(object); |
| 3778 AddInstruction(elements); | 3778 AddInstruction(elements); |
| 3779 HInstruction* length = AddInstruction(new HPixelArrayLength(elements)); | 3779 HInstruction* length = AddInstruction(new HExternalArrayLength(elements)); |
| 3780 AddInstruction(new HBoundsCheck(key, length)); | 3780 AddInstruction(new HBoundsCheck(key, length)); |
| 3781 HLoadPixelArrayExternalPointer* external_elements = | 3781 HLoadExternalArrayPointer* external_elements = |
| 3782 new HLoadPixelArrayExternalPointer(elements); | 3782 new HLoadExternalArrayPointer(elements); |
| 3783 AddInstruction(external_elements); | 3783 AddInstruction(external_elements); |
| 3784 return new HStorePixelArrayElement(external_elements, key, val); | 3784 return new HStorePixelArrayElement(external_elements, key, val); |
| 3785 } | 3785 } |
| 3786 | 3786 |
| 3787 | 3787 |
| 3788 bool HGraphBuilder::TryArgumentsAccess(Property* expr) { | 3788 bool HGraphBuilder::TryArgumentsAccess(Property* expr) { |
| 3789 VariableProxy* proxy = expr->obj()->AsVariableProxy(); | 3789 VariableProxy* proxy = expr->obj()->AsVariableProxy(); |
| 3790 if (proxy == NULL) return false; | 3790 if (proxy == NULL) return false; |
| 3791 if (!proxy->var()->IsStackAllocated()) return false; | 3791 if (!proxy->var()->IsStackAllocated()) return false; |
| 3792 if (!environment()->Lookup(proxy->var())->CheckFlag(HValue::kIsArguments)) { | 3792 if (!environment()->Lookup(proxy->var())->CheckFlag(HValue::kIsArguments)) { |
| (...skipping 2220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6013 } | 6013 } |
| 6014 } | 6014 } |
| 6015 | 6015 |
| 6016 #ifdef DEBUG | 6016 #ifdef DEBUG |
| 6017 if (graph_ != NULL) graph_->Verify(); | 6017 if (graph_ != NULL) graph_->Verify(); |
| 6018 if (allocator_ != NULL) allocator_->Verify(); | 6018 if (allocator_ != NULL) allocator_->Verify(); |
| 6019 #endif | 6019 #endif |
| 6020 } | 6020 } |
| 6021 | 6021 |
| 6022 } } // namespace v8::internal | 6022 } } // namespace v8::internal |
| OLD | NEW |