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

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

Issue 2611523002: [Turbofan] Simplified lowering to be done concurrently. (Closed)
Patch Set: Constant fold on canonical handles. Created 3 years, 11 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/pipeline.cc ('k') | src/compiler/simplified-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 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"
11 #include "src/compiler/machine-operator.h" 11 #include "src/compiler/machine-operator.h"
12 #include "src/compiler/node-matchers.h"
12 13
13 namespace v8 { 14 namespace v8 {
14 namespace internal { 15 namespace internal {
15 namespace compiler { 16 namespace compiler {
16 17
17 const char* Truncation::description() const { 18 const char* Truncation::description() const {
18 switch (kind()) { 19 switch (kind()) {
19 case TruncationKind::kNone: 20 case TruncationKind::kNone:
20 return "no-value-use"; 21 return "no-value-use";
21 case TruncationKind::kBool: 22 case TruncationKind::kBool:
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 } 688 }
688 return jsgraph()->graph()->NewNode(op, node); 689 return jsgraph()->graph()->NewNode(op, node);
689 } 690 }
690 691
691 692
692 Node* RepresentationChanger::GetBitRepresentationFor( 693 Node* RepresentationChanger::GetBitRepresentationFor(
693 Node* node, MachineRepresentation output_rep, Type* output_type) { 694 Node* node, MachineRepresentation output_rep, Type* output_type) {
694 // Eagerly fold representation changes for constants. 695 // Eagerly fold representation changes for constants.
695 switch (node->opcode()) { 696 switch (node->opcode()) {
696 case IrOpcode::kHeapConstant: { 697 case IrOpcode::kHeapConstant: {
697 Handle<HeapObject> value = OpParameter<Handle<HeapObject>>(node); 698 HeapObjectMatcher m(node);
698 return jsgraph()->Int32Constant(value->BooleanValue() ? 1 : 0); 699 if (m.Is(factory()->false_value())) {
700 return jsgraph()->Int32Constant(0);
701 } else if (m.Is(factory()->true_value())) {
702 return jsgraph()->Int32Constant(1);
703 }
699 } 704 }
700 default: 705 default:
701 break; 706 break;
702 } 707 }
703 // Select the correct X -> Bit operator. 708 // Select the correct X -> Bit operator.
704 const Operator* op; 709 const Operator* op;
705 if (output_type->Is(Type::None())) { 710 if (output_type->Is(Type::None())) {
706 // This is an impossible value; it should not be used at runtime. 711 // This is an impossible value; it should not be used at runtime.
707 // We just provide a dummy value here. 712 // We just provide a dummy value here.
708 return jsgraph()->Int32Constant(0); 713 return jsgraph()->Int32Constant(0);
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 node); 1012 node);
1008 } 1013 }
1009 1014
1010 Node* RepresentationChanger::InsertChangeUint32ToFloat64(Node* node) { 1015 Node* RepresentationChanger::InsertChangeUint32ToFloat64(Node* node) {
1011 return jsgraph()->graph()->NewNode(machine()->ChangeUint32ToFloat64(), node); 1016 return jsgraph()->graph()->NewNode(machine()->ChangeUint32ToFloat64(), node);
1012 } 1017 }
1013 1018
1014 } // namespace compiler 1019 } // namespace compiler
1015 } // namespace internal 1020 } // namespace internal
1016 } // namespace v8 1021 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/pipeline.cc ('k') | src/compiler/simplified-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698