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 | |
5398 if (!info->field_maps()->is_empty()) { | 5394 if (!info->field_maps()->is_empty()) { |
5399 ASSERT(field_access.representation().IsHeapObject()); | 5395 ASSERT(field_access.representation().IsHeapObject()); |
| 5396 BuildCheckHeapObject(value); |
5400 value = Add<HCheckMaps>(value, info->field_maps()); | 5397 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()); |
5401 } | 5404 } |
5402 | 5405 |
5403 // This is a normal store. | 5406 // This is a normal store. |
5404 instr = New<HStoreNamedField>( | 5407 instr = New<HStoreNamedField>( |
5405 checked_object->ActualValue(), field_access, value, | 5408 checked_object->ActualValue(), field_access, value, |
5406 transition_to_field ? INITIALIZING_STORE : STORE_TO_INITIALIZED_ENTRY); | 5409 transition_to_field ? INITIALIZING_STORE : STORE_TO_INITIALIZED_ENTRY); |
5407 } | 5410 } |
5408 | 5411 |
5409 if (transition_to_field) { | 5412 if (transition_to_field) { |
5410 Handle<Map> transition(info->transition()); | 5413 Handle<Map> transition(info->transition()); |
(...skipping 6229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11640 if (ShouldProduceTraceOutput()) { | 11643 if (ShouldProduceTraceOutput()) { |
11641 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11644 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
11642 } | 11645 } |
11643 | 11646 |
11644 #ifdef DEBUG | 11647 #ifdef DEBUG |
11645 graph_->Verify(false); // No full verify. | 11648 graph_->Verify(false); // No full verify. |
11646 #endif | 11649 #endif |
11647 } | 11650 } |
11648 | 11651 |
11649 } } // namespace v8::internal | 11652 } } // namespace v8::internal |
OLD | NEW |