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 "src/crankshaft/hydrogen-instructions.h" | 5 #include "src/crankshaft/hydrogen-instructions.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/safe_math.h" | 8 #include "src/base/safe_math.h" |
9 #include "src/crankshaft/hydrogen-infer-representation.h" | 9 #include "src/crankshaft/hydrogen-infer-representation.h" |
10 #include "src/double.h" | 10 #include "src/double.h" |
(...skipping 2394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2405 } | 2405 } |
2406 | 2406 |
2407 | 2407 |
2408 Maybe<HConstant*> HConstant::CopyToTruncatedNumber(Isolate* isolate, | 2408 Maybe<HConstant*> HConstant::CopyToTruncatedNumber(Isolate* isolate, |
2409 Zone* zone) { | 2409 Zone* zone) { |
2410 HConstant* res = NULL; | 2410 HConstant* res = NULL; |
2411 Handle<Object> handle = this->handle(isolate); | 2411 Handle<Object> handle = this->handle(isolate); |
2412 if (handle->IsBoolean()) { | 2412 if (handle->IsBoolean()) { |
2413 res = handle->BooleanValue() ? | 2413 res = handle->BooleanValue() ? |
2414 new(zone) HConstant(1) : new(zone) HConstant(0); | 2414 new(zone) HConstant(1) : new(zone) HConstant(0); |
2415 } else if (handle->IsUndefined()) { | 2415 } else if (handle->IsUndefined(isolate)) { |
2416 res = new (zone) HConstant(std::numeric_limits<double>::quiet_NaN()); | 2416 res = new (zone) HConstant(std::numeric_limits<double>::quiet_NaN()); |
2417 } else if (handle->IsNull()) { | 2417 } else if (handle->IsNull()) { |
2418 res = new(zone) HConstant(0); | 2418 res = new(zone) HConstant(0); |
2419 } else if (handle->IsString()) { | 2419 } else if (handle->IsString()) { |
2420 res = new(zone) HConstant(String::ToNumber(Handle<String>::cast(handle))); | 2420 res = new(zone) HConstant(String::ToNumber(Handle<String>::cast(handle))); |
2421 } | 2421 } |
2422 return res != NULL ? Just(res) : Nothing<HConstant*>(); | 2422 return res != NULL ? Just(res) : Nothing<HConstant*>(); |
2423 } | 2423 } |
2424 | 2424 |
2425 | 2425 |
(...skipping 1600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4026 case HObjectAccess::kExternalMemory: | 4026 case HObjectAccess::kExternalMemory: |
4027 os << "[external-memory]"; | 4027 os << "[external-memory]"; |
4028 break; | 4028 break; |
4029 } | 4029 } |
4030 | 4030 |
4031 return os << "@" << access.offset(); | 4031 return os << "@" << access.offset(); |
4032 } | 4032 } |
4033 | 4033 |
4034 } // namespace internal | 4034 } // namespace internal |
4035 } // namespace v8 | 4035 } // namespace v8 |
OLD | NEW |