Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Side by Side Diff: src/deoptimizer.cc

Issue 1422213002: [turbofan] Introduce simplified NumberBitwise{Or,Xor,And} operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Implement Jaro's suggestion. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/verifier.cc ('k') | test/cctest/compiler/test-js-typed-lowering.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
2566 case kInt32: { 2556 case kInt32: {
2567 value_ = Handle<Object>(isolate()->factory()->NewNumber(int32_value())); 2557 value_ = Handle<Object>(isolate()->factory()->NewNumber(int32_value()));
2568 return; 2558 return;
2569 } 2559 }
2570 2560
2571 case kUInt32: 2561 case kUInt32:
2572 value_ = Handle<Object>(isolate()->factory()->NewNumber(uint32_value())); 2562 value_ = Handle<Object>(isolate()->factory()->NewNumber(uint32_value()));
2573 return; 2563 return;
2574 2564
2575 case kDouble: 2565 case kDouble:
2576 value_ = Handle<Object>(isolate()->factory()->NewNumber(double_value())); 2566 value_ =
2567 Handle<Object>(isolate()->factory()->NewHeapNumber(double_value()));
Jarin 2015/10/27 08:42:28 FYI, this is not what the deoptimizer was doing or
Benedikt Meurer 2015/10/27 08:48:50 As discussed offline, changing this back to NewNum
2577 return; 2568 return;
2578 2569
2579 case kCapturedObject: 2570 case kCapturedObject:
2580 case kDuplicatedObject: 2571 case kDuplicatedObject:
2581 case kArgumentsObject: 2572 case kArgumentsObject:
2582 case kInvalid: 2573 case kInvalid:
2583 case kTagged: 2574 case kTagged:
2584 case kBoolBit: 2575 case kBoolBit:
2585 FATAL("internal error: unexpected materialization."); 2576 FATAL("internal error: unexpected materialization.");
2586 break; 2577 break;
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
3412 DCHECK(value_info->IsMaterializedObject()); 3403 DCHECK(value_info->IsMaterializedObject());
3413 3404
3414 value_info->value_ = 3405 value_info->value_ =
3415 Handle<Object>(previously_materialized_objects->get(i), isolate_); 3406 Handle<Object>(previously_materialized_objects->get(i), isolate_);
3416 } 3407 }
3417 } 3408 }
3418 } 3409 }
3419 3410
3420 } // namespace internal 3411 } // namespace internal
3421 } // namespace v8 3412 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/verifier.cc ('k') | test/cctest/compiler/test-js-typed-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698