OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/compiler/change-lowering.h" | 5 #include "src/compiler/change-lowering.h" |
6 | 6 |
7 #include "src/compiler/js-graph.h" | 7 #include "src/compiler/js-graph.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 Node* ChangeLowering::HeapNumberValueIndexConstant() { | 36 Node* ChangeLowering::HeapNumberValueIndexConstant() { |
37 STATIC_ASSERT(HeapNumber::kValueOffset % kPointerSize == 0); | 37 STATIC_ASSERT(HeapNumber::kValueOffset % kPointerSize == 0); |
38 const int heap_number_value_offset = | 38 const int heap_number_value_offset = |
39 ((HeapNumber::kValueOffset / kPointerSize) * (machine()->is64() ? 8 : 4)); | 39 ((HeapNumber::kValueOffset / kPointerSize) * (machine()->is64() ? 8 : 4)); |
40 return jsgraph()->Int32Constant(heap_number_value_offset - kHeapObjectTag); | 40 return jsgraph()->Int32Constant(heap_number_value_offset - kHeapObjectTag); |
41 } | 41 } |
42 | 42 |
43 | 43 |
44 Node* ChangeLowering::SmiShiftBitsConstant() { | 44 Node* ChangeLowering::SmiShiftBitsConstant() { |
45 const int smi_shift_size = (machine()->is64() ? SmiTagging<8>::kSmiShiftSize | 45 // TODO(turbofan): Work-around for weird GCC 4.6 linker issue: |
46 : SmiTagging<4>::kSmiShiftSize); | 46 // src/compiler/change-lowering.cc:46: undefined reference to |
| 47 // `v8::internal::SmiTagging<4u>::kSmiShiftSize' |
| 48 // src/compiler/change-lowering.cc:46: undefined reference to |
| 49 // `v8::internal::SmiTagging<8u>::kSmiShiftSize' |
| 50 STATIC_ASSERT(SmiTagging<4>::kSmiShiftSize == 0); |
| 51 STATIC_ASSERT(SmiTagging<8>::kSmiShiftSize == 31); |
| 52 const int smi_shift_size = machine()->is64() ? 31 : 0; |
47 return jsgraph()->Int32Constant(smi_shift_size + kSmiTagSize); | 53 return jsgraph()->Int32Constant(smi_shift_size + kSmiTagSize); |
48 } | 54 } |
49 | 55 |
50 | 56 |
51 Reduction ChangeLowering::ChangeBitToBool(Node* val, Node* control) { | 57 Reduction ChangeLowering::ChangeBitToBool(Node* val, Node* control) { |
52 Node* branch = graph()->NewNode(common()->Branch(), val, control); | 58 Node* branch = graph()->NewNode(common()->Branch(), val, control); |
53 | 59 |
54 Node* if_true = graph()->NewNode(common()->IfTrue(), branch); | 60 Node* if_true = graph()->NewNode(common()->IfTrue(), branch); |
55 Node* true_value = jsgraph()->TrueConstant(); | 61 Node* true_value = jsgraph()->TrueConstant(); |
56 | 62 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 Graph* ChangeLowering::graph() const { return jsgraph()->graph(); } | 153 Graph* ChangeLowering::graph() const { return jsgraph()->graph(); } |
148 | 154 |
149 | 155 |
150 CommonOperatorBuilder* ChangeLowering::common() const { | 156 CommonOperatorBuilder* ChangeLowering::common() const { |
151 return jsgraph()->common(); | 157 return jsgraph()->common(); |
152 } | 158 } |
153 | 159 |
154 } // namespace compiler | 160 } // namespace compiler |
155 } // namespace internal | 161 } // namespace internal |
156 } // namespace v8 | 162 } // namespace v8 |
OLD | NEW |