OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 10994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11005 | 11005 |
11006 BuildInitializeElements(object_elements, kind, object_elements_length); | 11006 BuildInitializeElements(object_elements, kind, object_elements_length); |
11007 | 11007 |
11008 // Copy elements backing store content. | 11008 // Copy elements backing store content. |
11009 if (elements->IsFixedDoubleArray()) { | 11009 if (elements->IsFixedDoubleArray()) { |
11010 for (int i = 0; i < elements_length; i++) { | 11010 for (int i = 0; i < elements_length; i++) { |
11011 HValue* key_constant = | 11011 HValue* key_constant = |
11012 AddInstruction(new(zone) HConstant(i, Representation::Integer32())); | 11012 AddInstruction(new(zone) HConstant(i, Representation::Integer32())); |
11013 HInstruction* value_instruction = | 11013 HInstruction* value_instruction = |
11014 AddInstruction(new(zone) HLoadKeyed( | 11014 AddInstruction(new(zone) HLoadKeyed( |
11015 boilerplate_elements, key_constant, NULL, kind)); | 11015 boilerplate_elements, key_constant, NULL, kind, |
11016 AddInstruction(new(zone) HStoreKeyed( | 11016 ALLOW_RETURN_HOLE)); |
| 11017 HInstruction* store = AddInstruction(new(zone) HStoreKeyed( |
11017 object_elements, key_constant, value_instruction, kind)); | 11018 object_elements, key_constant, value_instruction, kind)); |
| 11019 store->ClearFlag(HValue::kDeoptimizeOnUndefined); |
11018 } | 11020 } |
11019 } else if (elements->IsFixedArray()) { | 11021 } else if (elements->IsFixedArray()) { |
11020 Handle<FixedArray> fast_elements = Handle<FixedArray>::cast(elements); | 11022 Handle<FixedArray> fast_elements = Handle<FixedArray>::cast(elements); |
11021 Handle<FixedArray> original_fast_elements = | 11023 Handle<FixedArray> original_fast_elements = |
11022 Handle<FixedArray>::cast(original_elements); | 11024 Handle<FixedArray>::cast(original_elements); |
11023 for (int i = 0; i < elements_length; i++) { | 11025 for (int i = 0; i < elements_length; i++) { |
11024 Handle<Object> value(fast_elements->get(i), isolate()); | 11026 Handle<Object> value(fast_elements->get(i), isolate()); |
11025 HValue* key_constant = | 11027 HValue* key_constant = |
11026 AddInstruction(new(zone) HConstant(i, Representation::Integer32())); | 11028 AddInstruction(new(zone) HConstant(i, Representation::Integer32())); |
11027 if (value->IsJSObject()) { | 11029 if (value->IsJSObject()) { |
11028 Handle<JSObject> value_object = Handle<JSObject>::cast(value); | 11030 Handle<JSObject> value_object = Handle<JSObject>::cast(value); |
11029 Handle<JSObject> original_value_object = Handle<JSObject>::cast( | 11031 Handle<JSObject> original_value_object = Handle<JSObject>::cast( |
11030 Handle<Object>(original_fast_elements->get(i), isolate())); | 11032 Handle<Object>(original_fast_elements->get(i), isolate())); |
11031 HInstruction* value_instruction = | 11033 HInstruction* value_instruction = |
11032 AddInstruction(new(zone) HInnerAllocatedObject(target, *offset)); | 11034 AddInstruction(new(zone) HInnerAllocatedObject(target, *offset)); |
11033 AddInstruction(new(zone) HStoreKeyed( | 11035 AddInstruction(new(zone) HStoreKeyed( |
11034 object_elements, key_constant, value_instruction, kind)); | 11036 object_elements, key_constant, value_instruction, kind)); |
11035 BuildEmitDeepCopy(value_object, original_value_object, target, | 11037 BuildEmitDeepCopy(value_object, original_value_object, target, |
11036 offset, DONT_TRACK_ALLOCATION_SITE); | 11038 offset, DONT_TRACK_ALLOCATION_SITE); |
11037 } else { | 11039 } else { |
11038 HInstruction* value_instruction = | 11040 HInstruction* value_instruction = |
11039 AddInstruction(new(zone) HLoadKeyed( | 11041 AddInstruction(new(zone) HLoadKeyed( |
11040 boilerplate_elements, key_constant, NULL, kind)); | 11042 boilerplate_elements, key_constant, NULL, kind, |
| 11043 ALLOW_RETURN_HOLE)); |
11041 AddInstruction(new(zone) HStoreKeyed( | 11044 AddInstruction(new(zone) HStoreKeyed( |
11042 object_elements, key_constant, value_instruction, kind)); | 11045 object_elements, key_constant, value_instruction, kind)); |
11043 } | 11046 } |
11044 } | 11047 } |
11045 } else { | 11048 } else { |
11046 UNREACHABLE(); | 11049 UNREACHABLE(); |
11047 } | 11050 } |
11048 } | 11051 } |
11049 } | 11052 } |
11050 | 11053 |
(...skipping 1420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12471 } | 12474 } |
12472 } | 12475 } |
12473 | 12476 |
12474 #ifdef DEBUG | 12477 #ifdef DEBUG |
12475 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 12478 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
12476 if (allocator_ != NULL) allocator_->Verify(); | 12479 if (allocator_ != NULL) allocator_->Verify(); |
12477 #endif | 12480 #endif |
12478 } | 12481 } |
12479 | 12482 |
12480 } } // namespace v8::internal | 12483 } } // namespace v8::internal |
OLD | NEW |