| 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 "src/hydrogen.h" | 5 #include "src/hydrogen.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "src/v8.h" | 9 #include "src/v8.h" |
| 10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
| (...skipping 10992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11003 HInstruction* value_instruction; | 11003 HInstruction* value_instruction; |
| 11004 | 11004 |
| 11005 if (representation.IsDouble()) { | 11005 if (representation.IsDouble()) { |
| 11006 // Allocate a HeapNumber box and store the value into it. | 11006 // Allocate a HeapNumber box and store the value into it. |
| 11007 HValue* heap_number_constant = Add<HConstant>(HeapNumber::kSize); | 11007 HValue* heap_number_constant = Add<HConstant>(HeapNumber::kSize); |
| 11008 // This heap number alloc does not have a corresponding | 11008 // This heap number alloc does not have a corresponding |
| 11009 // AllocationSite. That is okay because | 11009 // AllocationSite. That is okay because |
| 11010 // 1) it's a child object of another object with a valid allocation site | 11010 // 1) it's a child object of another object with a valid allocation site |
| 11011 // 2) we can just use the mode of the parent object for pretenuring | 11011 // 2) we can just use the mode of the parent object for pretenuring |
| 11012 HInstruction* double_box = | 11012 HInstruction* double_box = |
| 11013 Add<HAllocate>(heap_number_constant, HType::HeapNumber(), | 11013 Add<HAllocate>(heap_number_constant, HType::HeapObject(), |
| 11014 pretenure_flag, HEAP_NUMBER_TYPE); | 11014 pretenure_flag, HEAP_NUMBER_TYPE); |
| 11015 AddStoreMapConstant(double_box, | 11015 AddStoreMapConstant(double_box, |
| 11016 isolate()->factory()->heap_number_map()); | 11016 isolate()->factory()->heap_number_map()); |
| 11017 Add<HStoreNamedField>(double_box, HObjectAccess::ForHeapNumberValue(), | 11017 Add<HStoreNamedField>(double_box, HObjectAccess::ForHeapNumberValue(), |
| 11018 Add<HConstant>(value)); | 11018 Add<HConstant>(value)); |
| 11019 value_instruction = double_box; | 11019 value_instruction = double_box; |
| 11020 } else if (representation.IsSmi()) { | 11020 } else if (representation.IsSmi()) { |
| 11021 value_instruction = value->IsUninitialized() | 11021 value_instruction = value->IsUninitialized() |
| 11022 ? graph()->GetConstant0() | 11022 ? graph()->GetConstant0() |
| 11023 : Add<HConstant>(value); | 11023 : Add<HConstant>(value); |
| (...skipping 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12417 if (ShouldProduceTraceOutput()) { | 12417 if (ShouldProduceTraceOutput()) { |
| 12418 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 12418 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 12419 } | 12419 } |
| 12420 | 12420 |
| 12421 #ifdef DEBUG | 12421 #ifdef DEBUG |
| 12422 graph_->Verify(false); // No full verify. | 12422 graph_->Verify(false); // No full verify. |
| 12423 #endif | 12423 #endif |
| 12424 } | 12424 } |
| 12425 | 12425 |
| 12426 } } // namespace v8::internal | 12426 } } // namespace v8::internal |
| OLD | NEW |