| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "hydrogen.h" | 5 #include "hydrogen.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "v8.h" | 9 #include "v8.h" |
| 10 #include "allocation-site-scopes.h" | 10 #include "allocation-site-scopes.h" |
| (...skipping 5373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5384 } else { | 5384 } else { |
| 5385 // Already holds a HeapNumber; load the box and write its value field. | 5385 // Already holds a HeapNumber; load the box and write its value field. |
| 5386 HInstruction* heap_number = Add<HLoadNamedField>( | 5386 HInstruction* heap_number = Add<HLoadNamedField>( |
| 5387 checked_object, static_cast<HValue*>(NULL), heap_number_access); | 5387 checked_object, static_cast<HValue*>(NULL), heap_number_access); |
| 5388 heap_number->set_type(HType::HeapNumber()); | 5388 heap_number->set_type(HType::HeapNumber()); |
| 5389 instr = New<HStoreNamedField>(heap_number, | 5389 instr = New<HStoreNamedField>(heap_number, |
| 5390 HObjectAccess::ForHeapNumberValue(), | 5390 HObjectAccess::ForHeapNumberValue(), |
| 5391 value, STORE_TO_INITIALIZED_ENTRY); | 5391 value, STORE_TO_INITIALIZED_ENTRY); |
| 5392 } | 5392 } |
| 5393 } else { | 5393 } else { |
| 5394 if (field_access.representation().IsHeapObject()) { |
| 5395 BuildCheckHeapObject(value); |
| 5396 } |
| 5397 |
| 5394 if (!info->field_maps()->is_empty()) { | 5398 if (!info->field_maps()->is_empty()) { |
| 5395 ASSERT(field_access.representation().IsHeapObject()); | 5399 ASSERT(field_access.representation().IsHeapObject()); |
| 5396 BuildCheckHeapObject(value); | |
| 5397 value = Add<HCheckMaps>(value, info->field_maps()); | 5400 value = Add<HCheckMaps>(value, info->field_maps()); |
| 5398 | |
| 5399 // TODO(bmeurer): This is a dirty hack to avoid repeating the smi check | |
| 5400 // that was already performed by the HCheckHeapObject above in the | |
| 5401 // HStoreNamedField below. We should really do this right instead and | |
| 5402 // make Crankshaft aware of Representation::HeapObject(). | |
| 5403 field_access = field_access.WithRepresentation(Representation::Tagged()); | |
| 5404 } | 5401 } |
| 5405 | 5402 |
| 5406 // This is a normal store. | 5403 // This is a normal store. |
| 5407 instr = New<HStoreNamedField>( | 5404 instr = New<HStoreNamedField>( |
| 5408 checked_object->ActualValue(), field_access, value, | 5405 checked_object->ActualValue(), field_access, value, |
| 5409 transition_to_field ? INITIALIZING_STORE : STORE_TO_INITIALIZED_ENTRY); | 5406 transition_to_field ? INITIALIZING_STORE : STORE_TO_INITIALIZED_ENTRY); |
| 5410 } | 5407 } |
| 5411 | 5408 |
| 5412 if (transition_to_field) { | 5409 if (transition_to_field) { |
| 5413 Handle<Map> transition(info->transition()); | 5410 Handle<Map> transition(info->transition()); |
| (...skipping 6229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11643 if (ShouldProduceTraceOutput()) { | 11640 if (ShouldProduceTraceOutput()) { |
| 11644 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11641 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 11645 } | 11642 } |
| 11646 | 11643 |
| 11647 #ifdef DEBUG | 11644 #ifdef DEBUG |
| 11648 graph_->Verify(false); // No full verify. | 11645 graph_->Verify(false); // No full verify. |
| 11649 #endif | 11646 #endif |
| 11650 } | 11647 } |
| 11651 | 11648 |
| 11652 } } // namespace v8::internal | 11649 } } // namespace v8::internal |
| OLD | NEW |