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

Side by Side Diff: src/compiler/js-operator.cc

Issue 2923543003: [turbofan] Properly support Number feedback for binary operators. (Closed)
Patch Set: Improve DCHECK. Created 3 years, 6 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/effect-control-linearizer.cc ('k') | src/compiler/js-type-hint-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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/js-operator.h" 5 #include "src/compiler/js-operator.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "src/base/lazy-instance.h" 9 #include "src/base/lazy-instance.h"
10 #include "src/compiler/opcodes.h" 10 #include "src/compiler/opcodes.h"
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 struct Name##Operator final : public Operator1<BinaryOperationHint> { \ 636 struct Name##Operator final : public Operator1<BinaryOperationHint> { \
637 Name##Operator() \ 637 Name##Operator() \
638 : Operator1<BinaryOperationHint>(IrOpcode::kJS##Name, \ 638 : Operator1<BinaryOperationHint>(IrOpcode::kJS##Name, \
639 Operator::kNoProperties, "JS" #Name, \ 639 Operator::kNoProperties, "JS" #Name, \
640 2, 1, 1, 1, 1, 2, kHint) {} \ 640 2, 1, 1, 1, 1, 2, kHint) {} \
641 }; \ 641 }; \
642 Name##Operator<BinaryOperationHint::kNone> k##Name##NoneOperator; \ 642 Name##Operator<BinaryOperationHint::kNone> k##Name##NoneOperator; \
643 Name##Operator<BinaryOperationHint::kSignedSmall> \ 643 Name##Operator<BinaryOperationHint::kSignedSmall> \
644 k##Name##SignedSmallOperator; \ 644 k##Name##SignedSmallOperator; \
645 Name##Operator<BinaryOperationHint::kSigned32> k##Name##Signed32Operator; \ 645 Name##Operator<BinaryOperationHint::kSigned32> k##Name##Signed32Operator; \
646 Name##Operator<BinaryOperationHint::kNumber> k##Name##NumberOperator; \
646 Name##Operator<BinaryOperationHint::kNumberOrOddball> \ 647 Name##Operator<BinaryOperationHint::kNumberOrOddball> \
647 k##Name##NumberOrOddballOperator; \ 648 k##Name##NumberOrOddballOperator; \
648 Name##Operator<BinaryOperationHint::kString> k##Name##StringOperator; \ 649 Name##Operator<BinaryOperationHint::kString> k##Name##StringOperator; \
649 Name##Operator<BinaryOperationHint::kAny> k##Name##AnyOperator; 650 Name##Operator<BinaryOperationHint::kAny> k##Name##AnyOperator;
650 BINARY_OP_LIST(BINARY_OP) 651 BINARY_OP_LIST(BINARY_OP)
651 #undef BINARY_OP 652 #undef BINARY_OP
652 653
653 #define COMPARE_OP(Name, properties) \ 654 #define COMPARE_OP(Name, properties) \
654 template <CompareOperationHint kHint> \ 655 template <CompareOperationHint kHint> \
655 struct Name##Operator final : public Operator1<CompareOperationHint> { \ 656 struct Name##Operator final : public Operator1<CompareOperationHint> { \
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 690
690 #define BINARY_OP(Name) \ 691 #define BINARY_OP(Name) \
691 const Operator* JSOperatorBuilder::Name(BinaryOperationHint hint) { \ 692 const Operator* JSOperatorBuilder::Name(BinaryOperationHint hint) { \
692 switch (hint) { \ 693 switch (hint) { \
693 case BinaryOperationHint::kNone: \ 694 case BinaryOperationHint::kNone: \
694 return &cache_.k##Name##NoneOperator; \ 695 return &cache_.k##Name##NoneOperator; \
695 case BinaryOperationHint::kSignedSmall: \ 696 case BinaryOperationHint::kSignedSmall: \
696 return &cache_.k##Name##SignedSmallOperator; \ 697 return &cache_.k##Name##SignedSmallOperator; \
697 case BinaryOperationHint::kSigned32: \ 698 case BinaryOperationHint::kSigned32: \
698 return &cache_.k##Name##Signed32Operator; \ 699 return &cache_.k##Name##Signed32Operator; \
700 case BinaryOperationHint::kNumber: \
701 return &cache_.k##Name##NumberOperator; \
699 case BinaryOperationHint::kNumberOrOddball: \ 702 case BinaryOperationHint::kNumberOrOddball: \
700 return &cache_.k##Name##NumberOrOddballOperator; \ 703 return &cache_.k##Name##NumberOrOddballOperator; \
701 case BinaryOperationHint::kString: \ 704 case BinaryOperationHint::kString: \
702 return &cache_.k##Name##StringOperator; \ 705 return &cache_.k##Name##StringOperator; \
703 case BinaryOperationHint::kAny: \ 706 case BinaryOperationHint::kAny: \
704 return &cache_.k##Name##AnyOperator; \ 707 return &cache_.k##Name##AnyOperator; \
705 } \ 708 } \
706 UNREACHABLE(); \ 709 UNREACHABLE(); \
707 return nullptr; \ 710 return nullptr; \
708 } 711 }
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 return new (zone()) Operator1<Handle<ScopeInfo>>( // -- 1114 return new (zone()) Operator1<Handle<ScopeInfo>>( // --
1112 IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode 1115 IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode
1113 "JSCreateScriptContext", // name 1116 "JSCreateScriptContext", // name
1114 1, 1, 1, 1, 1, 2, // counts 1117 1, 1, 1, 1, 1, 2, // counts
1115 scope_info); // parameter 1118 scope_info); // parameter
1116 } 1119 }
1117 1120
1118 } // namespace compiler 1121 } // namespace compiler
1119 } // namespace internal 1122 } // namespace internal
1120 } // namespace v8 1123 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/effect-control-linearizer.cc ('k') | src/compiler/js-type-hint-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698