| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/deoptimizer.h" | 5 #include "src/deoptimizer.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
| 9 #include "src/disasm.h" | 9 #include "src/disasm.h" |
| 10 #include "src/frames-inl.h" | 10 #include "src/frames-inl.h" |
| (...skipping 2473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2484 } | 2484 } |
| 2485 | 2485 |
| 2486 case kUInt32: { | 2486 case kUInt32: { |
| 2487 bool is_smi = (uint32_value() <= static_cast<uintptr_t>(Smi::kMaxValue)); | 2487 bool is_smi = (uint32_value() <= static_cast<uintptr_t>(Smi::kMaxValue)); |
| 2488 if (is_smi) { | 2488 if (is_smi) { |
| 2489 return Smi::FromInt(static_cast<int32_t>(uint32_value())); | 2489 return Smi::FromInt(static_cast<int32_t>(uint32_value())); |
| 2490 } | 2490 } |
| 2491 break; | 2491 break; |
| 2492 } | 2492 } |
| 2493 | 2493 |
| 2494 case kDouble: { | |
| 2495 int int_value = FastD2IChecked(double_value()); | |
| 2496 bool is_smi = !IsMinusZero(double_value()) && | |
| 2497 double_value() == int_value && Smi::IsValid(int_value); | |
| 2498 if (is_smi) { | |
| 2499 return Smi::FromInt(static_cast<int32_t>(int_value)); | |
| 2500 } | |
| 2501 break; | |
| 2502 } | |
| 2503 | |
| 2504 case kBoolBit: { | 2494 case kBoolBit: { |
| 2505 if (uint32_value() == 0) { | 2495 if (uint32_value() == 0) { |
| 2506 return isolate()->heap()->false_value(); | 2496 return isolate()->heap()->false_value(); |
| 2507 } else { | 2497 } else { |
| 2508 CHECK_EQ(1U, uint32_value()); | 2498 CHECK_EQ(1U, uint32_value()); |
| 2509 return isolate()->heap()->true_value(); | 2499 return isolate()->heap()->true_value(); |
| 2510 } | 2500 } |
| 2511 } | 2501 } |
| 2512 | 2502 |
| 2513 default: | 2503 default: |
| (...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3412 DCHECK(value_info->IsMaterializedObject()); | 3402 DCHECK(value_info->IsMaterializedObject()); |
| 3413 | 3403 |
| 3414 value_info->value_ = | 3404 value_info->value_ = |
| 3415 Handle<Object>(previously_materialized_objects->get(i), isolate_); | 3405 Handle<Object>(previously_materialized_objects->get(i), isolate_); |
| 3416 } | 3406 } |
| 3417 } | 3407 } |
| 3418 } | 3408 } |
| 3419 | 3409 |
| 3420 } // namespace internal | 3410 } // namespace internal |
| 3421 } // namespace v8 | 3411 } // namespace v8 |
| OLD | NEW |