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

Side by Side Diff: src/compiler/representation-change.cc

Issue 2191503002: [turbofan] Add the CheckedTruncateTaggedToWord32 opcode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 months 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/opcodes.h ('k') | src/compiler/simplified-operator.h » ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/compiler/representation-change.h" 5 #include "src/compiler/representation-change.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 } 451 }
452 } else if (output_rep == MachineRepresentation::kTagged) { 452 } else if (output_rep == MachineRepresentation::kTagged) {
453 if (output_type->Is(Type::TaggedSigned())) { 453 if (output_type->Is(Type::TaggedSigned())) {
454 op = simplified()->ChangeTaggedSignedToInt32(); 454 op = simplified()->ChangeTaggedSignedToInt32();
455 } else if (output_type->Is(Type::Unsigned32())) { 455 } else if (output_type->Is(Type::Unsigned32())) {
456 op = simplified()->ChangeTaggedToUint32(); 456 op = simplified()->ChangeTaggedToUint32();
457 } else if (output_type->Is(Type::Signed32())) { 457 } else if (output_type->Is(Type::Signed32())) {
458 op = simplified()->ChangeTaggedToInt32(); 458 op = simplified()->ChangeTaggedToInt32();
459 } else if (use_info.truncation().IsUsedAsWord32()) { 459 } else if (use_info.truncation().IsUsedAsWord32()) {
460 if (use_info.type_check() == TypeCheckKind::kNumberOrOddball) { 460 if (use_info.type_check() == TypeCheckKind::kNumberOrOddball) {
461 op = simplified()->CheckedTaggedToFloat64(); 461 op = simplified()->CheckedTruncateTaggedToWord32();
462 Node* effect = NodeProperties::GetEffectInput(use_node); 462 } else {
463 Node* control = NodeProperties::GetControlInput(use_node); 463 op = simplified()->TruncateTaggedToWord32();
464 Node* to_float_checked =
465 jsgraph()->graph()->NewNode(op, node, effect, control);
466 NodeProperties::ReplaceEffectInput(use_node, to_float_checked);
467 return jsgraph()->graph()->NewNode(machine()->TruncateFloat64ToWord32(),
468 to_float_checked);
469 } 464 }
470 op = simplified()->TruncateTaggedToWord32();
471 } else if (use_info.type_check() == TypeCheckKind::kSigned32) { 465 } else if (use_info.type_check() == TypeCheckKind::kSigned32) {
472 op = simplified()->CheckedTaggedToInt32(); 466 op = simplified()->CheckedTaggedToInt32();
473 } 467 }
474 } else if (output_rep == MachineRepresentation::kWord32) { 468 } else if (output_rep == MachineRepresentation::kWord32) {
475 // Only the checked case should get here, the non-checked case is 469 // Only the checked case should get here, the non-checked case is
476 // handled in GetRepresentationFor. 470 // handled in GetRepresentationFor.
477 if (use_info.type_check() == TypeCheckKind::kSigned32) { 471 if (use_info.type_check() == TypeCheckKind::kSigned32) {
478 if (output_type->Is(Type::Signed32())) { 472 if (output_type->Is(Type::Signed32())) {
479 return node; 473 return node;
480 } else if (output_type->Is(Type::Unsigned32())) { 474 } else if (output_type->Is(Type::Unsigned32())) {
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 } 784 }
791 785
792 Node* RepresentationChanger::InsertChangeTaggedToFloat64(Node* node) { 786 Node* RepresentationChanger::InsertChangeTaggedToFloat64(Node* node) {
793 return jsgraph()->graph()->NewNode(simplified()->ChangeTaggedToFloat64(), 787 return jsgraph()->graph()->NewNode(simplified()->ChangeTaggedToFloat64(),
794 node); 788 node);
795 } 789 }
796 790
797 } // namespace compiler 791 } // namespace compiler
798 } // namespace internal 792 } // namespace internal
799 } // namespace v8 793 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/opcodes.h ('k') | src/compiler/simplified-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698