OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 4477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4488 if (transition_to_field) { | 4488 if (transition_to_field) { |
4489 // The store requires a mutable HeapNumber to be allocated. | 4489 // The store requires a mutable HeapNumber to be allocated. |
4490 NoObservableSideEffectsScope no_side_effects(this); | 4490 NoObservableSideEffectsScope no_side_effects(this); |
4491 HInstruction* heap_number_size = Add<HConstant>(HeapNumber::kSize); | 4491 HInstruction* heap_number_size = Add<HConstant>(HeapNumber::kSize); |
4492 HInstruction* heap_number = Add<HAllocate>(heap_number_size, | 4492 HInstruction* heap_number = Add<HAllocate>(heap_number_size, |
4493 HType::HeapNumber(), isolate()->heap()->GetPretenureMode(), | 4493 HType::HeapNumber(), isolate()->heap()->GetPretenureMode(), |
4494 HEAP_NUMBER_TYPE); | 4494 HEAP_NUMBER_TYPE); |
4495 AddStoreMapConstant(heap_number, isolate()->factory()->heap_number_map()); | 4495 AddStoreMapConstant(heap_number, isolate()->factory()->heap_number_map()); |
4496 Add<HStoreNamedField>(heap_number, HObjectAccess::ForHeapNumberValue(), | 4496 Add<HStoreNamedField>(heap_number, HObjectAccess::ForHeapNumberValue(), |
4497 value); | 4497 value); |
4498 instr = New<HStoreNamedField>(checked_object, | 4498 instr = New<HStoreNamedField>(checked_object->ActualValue(), |
4499 heap_number_access, | 4499 heap_number_access, |
4500 heap_number); | 4500 heap_number); |
4501 } else { | 4501 } else { |
4502 // Already holds a HeapNumber; load the box and write its value field. | 4502 // Already holds a HeapNumber; load the box and write its value field. |
4503 HInstruction* heap_number = Add<HLoadNamedField>(checked_object, | 4503 HInstruction* heap_number = Add<HLoadNamedField>(checked_object, |
4504 heap_number_access); | 4504 heap_number_access); |
4505 heap_number->set_type(HType::HeapNumber()); | 4505 heap_number->set_type(HType::HeapNumber()); |
4506 instr = New<HStoreNamedField>(heap_number, | 4506 instr = New<HStoreNamedField>(heap_number, |
4507 HObjectAccess::ForHeapNumberValue(), | 4507 HObjectAccess::ForHeapNumberValue(), |
4508 value); | 4508 value); |
4509 } | 4509 } |
4510 } else { | 4510 } else { |
4511 // This is a normal store. | 4511 // This is a normal store. |
4512 instr = New<HStoreNamedField>(checked_object, field_access, value); | 4512 instr = New<HStoreNamedField>(checked_object->ActualValue(), |
| 4513 field_access, |
| 4514 value); |
4513 } | 4515 } |
4514 | 4516 |
4515 if (transition_to_field) { | 4517 if (transition_to_field) { |
4516 Handle<Map> transition(lookup->GetTransitionMapFromMap(*map)); | 4518 Handle<Map> transition(lookup->GetTransitionMapFromMap(*map)); |
4517 HConstant* transition_constant = Add<HConstant>(transition); | 4519 HConstant* transition_constant = Add<HConstant>(transition); |
4518 instr->SetTransition(transition_constant, top_info()); | 4520 instr->SetTransition(transition_constant, top_info()); |
4519 // TODO(fschneider): Record the new map type of the object in the IR to | 4521 // TODO(fschneider): Record the new map type of the object in the IR to |
4520 // enable elimination of redundant checks after the transition store. | 4522 // enable elimination of redundant checks after the transition store. |
4521 instr->SetGVNFlag(kChangesMaps); | 4523 instr->SetGVNFlag(kChangesMaps); |
4522 } | 4524 } |
(...skipping 5341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9864 if (ShouldProduceTraceOutput()) { | 9866 if (ShouldProduceTraceOutput()) { |
9865 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 9867 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
9866 } | 9868 } |
9867 | 9869 |
9868 #ifdef DEBUG | 9870 #ifdef DEBUG |
9869 graph_->Verify(false); // No full verify. | 9871 graph_->Verify(false); // No full verify. |
9870 #endif | 9872 #endif |
9871 } | 9873 } |
9872 | 9874 |
9873 } } // namespace v8::internal | 9875 } } // namespace v8::internal |
OLD | NEW |