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 3933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3944 } | 3944 } |
3945 | 3945 |
3946 | 3946 |
3947 HInstruction* HGraphBuilder::BuildMonomorphicElementAccess(HValue* object, | 3947 HInstruction* HGraphBuilder::BuildMonomorphicElementAccess(HValue* object, |
3948 HValue* key, | 3948 HValue* key, |
3949 HValue* val, | 3949 HValue* val, |
3950 Expression* expr, | 3950 Expression* expr, |
3951 bool is_store) { | 3951 bool is_store) { |
3952 ASSERT(expr->IsMonomorphic()); | 3952 ASSERT(expr->IsMonomorphic()); |
3953 Handle<Map> map = expr->GetMonomorphicReceiverType(); | 3953 Handle<Map> map = expr->GetMonomorphicReceiverType(); |
| 3954 AddInstruction(new(zone()) HCheckNonSmi(object)); |
| 3955 HInstruction* mapcheck = AddInstruction(new(zone()) HCheckMap(object, map)); |
3954 if (!map->has_fast_elements() && | 3956 if (!map->has_fast_elements() && |
3955 !map->has_fast_double_elements() && | 3957 !map->has_fast_double_elements() && |
3956 !map->has_external_array_elements()) { | 3958 !map->has_external_array_elements()) { |
3957 return is_store ? BuildStoreKeyedGeneric(object, key, val) | 3959 return is_store ? BuildStoreKeyedGeneric(object, key, val) |
3958 : BuildLoadKeyedGeneric(object, key); | 3960 : BuildLoadKeyedGeneric(object, key); |
3959 } | 3961 } |
3960 AddInstruction(new(zone()) HCheckNonSmi(object)); | |
3961 HInstruction* mapcheck = AddInstruction(new(zone()) HCheckMap(object, map)); | |
3962 HInstruction* elements = AddInstruction(new(zone()) HLoadElements(object)); | 3962 HInstruction* elements = AddInstruction(new(zone()) HLoadElements(object)); |
3963 bool fast_double_elements = map->has_fast_double_elements(); | 3963 bool fast_double_elements = map->has_fast_double_elements(); |
3964 if (is_store && map->has_fast_elements()) { | 3964 if (is_store && map->has_fast_elements()) { |
3965 AddInstruction(new(zone()) HCheckMap( | 3965 AddInstruction(new(zone()) HCheckMap( |
3966 elements, isolate()->factory()->fixed_array_map())); | 3966 elements, isolate()->factory()->fixed_array_map())); |
3967 } | 3967 } |
3968 HInstruction* length = NULL; | 3968 HInstruction* length = NULL; |
3969 HInstruction* checked_key = NULL; | 3969 HInstruction* checked_key = NULL; |
3970 if (map->has_external_array_elements()) { | 3970 if (map->has_external_array_elements()) { |
3971 length = AddInstruction(new(zone()) HFixedArrayBaseLength(elements)); | 3971 length = AddInstruction(new(zone()) HFixedArrayBaseLength(elements)); |
(...skipping 2849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6821 } | 6821 } |
6822 } | 6822 } |
6823 | 6823 |
6824 #ifdef DEBUG | 6824 #ifdef DEBUG |
6825 if (graph_ != NULL) graph_->Verify(); | 6825 if (graph_ != NULL) graph_->Verify(); |
6826 if (allocator_ != NULL) allocator_->Verify(); | 6826 if (allocator_ != NULL) allocator_->Verify(); |
6827 #endif | 6827 #endif |
6828 } | 6828 } |
6829 | 6829 |
6830 } } // namespace v8::internal | 6830 } } // namespace v8::internal |
OLD | NEW |