OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #if V8_TARGET_ARCH_IA32 | 9 #if V8_TARGET_ARCH_IA32 |
10 | 10 |
(...skipping 2078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2089 } | 2089 } |
2090 | 2090 |
2091 | 2091 |
2092 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { | 2092 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { |
2093 Representation r = instr->representation(); | 2093 Representation r = instr->representation(); |
2094 if (r.IsSmi()) { | 2094 if (r.IsSmi()) { |
2095 return DefineAsRegister(new(zone()) LConstantS); | 2095 return DefineAsRegister(new(zone()) LConstantS); |
2096 } else if (r.IsInteger32()) { | 2096 } else if (r.IsInteger32()) { |
2097 return DefineAsRegister(new(zone()) LConstantI); | 2097 return DefineAsRegister(new(zone()) LConstantI); |
2098 } else if (r.IsDouble()) { | 2098 } else if (r.IsDouble()) { |
2099 double value = instr->DoubleValue(); | 2099 uint64_t const bits = instr->DoubleValueAsBits(); |
2100 bool value_is_zero = bit_cast<uint64_t, double>(value) == 0; | 2100 LOperand* temp = bits ? TempRegister() : nullptr; |
2101 LOperand* temp = value_is_zero ? NULL : TempRegister(); | |
2102 return DefineAsRegister(new(zone()) LConstantD(temp)); | 2101 return DefineAsRegister(new(zone()) LConstantD(temp)); |
2103 } else if (r.IsExternal()) { | 2102 } else if (r.IsExternal()) { |
2104 return DefineAsRegister(new(zone()) LConstantE); | 2103 return DefineAsRegister(new(zone()) LConstantE); |
2105 } else if (r.IsTagged()) { | 2104 } else if (r.IsTagged()) { |
2106 return DefineAsRegister(new(zone()) LConstantT); | 2105 return DefineAsRegister(new(zone()) LConstantT); |
2107 } else { | 2106 } else { |
2108 UNREACHABLE(); | 2107 UNREACHABLE(); |
2109 return NULL; | 2108 return NULL; |
2110 } | 2109 } |
2111 } | 2110 } |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2714 LOperand* function = UseRegisterAtStart(instr->function()); | 2713 LOperand* function = UseRegisterAtStart(instr->function()); |
2715 LAllocateBlockContext* result = | 2714 LAllocateBlockContext* result = |
2716 new(zone()) LAllocateBlockContext(context, function); | 2715 new(zone()) LAllocateBlockContext(context, function); |
2717 return MarkAsCall(DefineFixed(result, esi), instr); | 2716 return MarkAsCall(DefineFixed(result, esi), instr); |
2718 } | 2717 } |
2719 | 2718 |
2720 | 2719 |
2721 } } // namespace v8::internal | 2720 } } // namespace v8::internal |
2722 | 2721 |
2723 #endif // V8_TARGET_ARCH_IA32 | 2722 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |