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 <limits> |
| 6 |
5 #include "src/v8.h" | 7 #include "src/v8.h" |
6 | 8 |
7 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
8 #include "src/double.h" | 10 #include "src/double.h" |
9 #include "src/factory.h" | 11 #include "src/factory.h" |
10 #include "src/hydrogen-infer-representation.h" | 12 #include "src/hydrogen-infer-representation.h" |
11 #include "src/property-details-inl.h" | 13 #include "src/property-details-inl.h" |
12 | 14 |
13 #if V8_TARGET_ARCH_IA32 | 15 #if V8_TARGET_ARCH_IA32 |
14 #include "src/ia32/lithium-ia32.h" // NOLINT | 16 #include "src/ia32/lithium-ia32.h" // NOLINT |
(...skipping 4333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4348 if ((c_left->HasNumberValue() && c_right->HasNumberValue())) { | 4350 if ((c_left->HasNumberValue() && c_right->HasNumberValue())) { |
4349 if (c_right->DoubleValue() != 0) { | 4351 if (c_right->DoubleValue() != 0) { |
4350 double double_res = c_left->DoubleValue() / c_right->DoubleValue(); | 4352 double double_res = c_left->DoubleValue() / c_right->DoubleValue(); |
4351 if (IsInt32Double(double_res)) { | 4353 if (IsInt32Double(double_res)) { |
4352 return H_CONSTANT_INT(double_res); | 4354 return H_CONSTANT_INT(double_res); |
4353 } | 4355 } |
4354 return H_CONSTANT_DOUBLE(double_res); | 4356 return H_CONSTANT_DOUBLE(double_res); |
4355 } else { | 4357 } else { |
4356 int sign = Double(c_left->DoubleValue()).Sign() * | 4358 int sign = Double(c_left->DoubleValue()).Sign() * |
4357 Double(c_right->DoubleValue()).Sign(); // Right could be -0. | 4359 Double(c_right->DoubleValue()).Sign(); // Right could be -0. |
4358 return H_CONSTANT_DOUBLE(sign * V8_INFINITY); | 4360 return H_CONSTANT_DOUBLE(sign * |
| 4361 std::numeric_limits<double>::infinity()); |
4359 } | 4362 } |
4360 } | 4363 } |
4361 } | 4364 } |
4362 return new(zone) HDiv(context, left, right); | 4365 return new(zone) HDiv(context, left, right); |
4363 } | 4366 } |
4364 | 4367 |
4365 | 4368 |
4366 HInstruction* HBitwise::New( | 4369 HInstruction* HBitwise::New( |
4367 Zone* zone, HValue* context, Token::Value op, HValue* left, HValue* right) { | 4370 Zone* zone, HValue* context, Token::Value op, HValue* left, HValue* right) { |
4368 if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) { | 4371 if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) { |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4815 break; | 4818 break; |
4816 case HObjectAccess::kExternalMemory: | 4819 case HObjectAccess::kExternalMemory: |
4817 os << "[external-memory]"; | 4820 os << "[external-memory]"; |
4818 break; | 4821 break; |
4819 } | 4822 } |
4820 | 4823 |
4821 return os << "@" << access.offset(); | 4824 return os << "@" << access.offset(); |
4822 } | 4825 } |
4823 | 4826 |
4824 } } // namespace v8::internal | 4827 } } // namespace v8::internal |
OLD | NEW |