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