| OLD | NEW |
| 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 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 | 543 |
| 544 BinaryOperationHint BinaryOperationHintOf(const Operator* op) { | 544 BinaryOperationHint BinaryOperationHintOf(const Operator* op) { |
| 545 DCHECK_EQ(IrOpcode::kJSAdd, op->opcode()); | 545 DCHECK_EQ(IrOpcode::kJSAdd, op->opcode()); |
| 546 return OpParameter<BinaryOperationHint>(op); | 546 return OpParameter<BinaryOperationHint>(op); |
| 547 } | 547 } |
| 548 | 548 |
| 549 CompareOperationHint CompareOperationHintOf(const Operator* op) { | 549 CompareOperationHint CompareOperationHintOf(const Operator* op) { |
| 550 DCHECK(op->opcode() == IrOpcode::kJSEqual || | 550 DCHECK(op->opcode() == IrOpcode::kJSEqual || |
| 551 op->opcode() == IrOpcode::kJSNotEqual || | 551 op->opcode() == IrOpcode::kJSNotEqual || |
| 552 op->opcode() == IrOpcode::kJSStrictEqual || | 552 op->opcode() == IrOpcode::kJSStrictEqual || |
| 553 op->opcode() == IrOpcode::kJSStrictNotEqual || | |
| 554 op->opcode() == IrOpcode::kJSLessThan || | 553 op->opcode() == IrOpcode::kJSLessThan || |
| 555 op->opcode() == IrOpcode::kJSGreaterThan || | 554 op->opcode() == IrOpcode::kJSGreaterThan || |
| 556 op->opcode() == IrOpcode::kJSLessThanOrEqual || | 555 op->opcode() == IrOpcode::kJSLessThanOrEqual || |
| 557 op->opcode() == IrOpcode::kJSGreaterThanOrEqual); | 556 op->opcode() == IrOpcode::kJSGreaterThanOrEqual); |
| 558 return OpParameter<CompareOperationHint>(op); | 557 return OpParameter<CompareOperationHint>(op); |
| 559 } | 558 } |
| 560 | 559 |
| 561 #define CACHED_OP_LIST(V) \ | 560 #define CACHED_OP_LIST(V) \ |
| 562 V(BitwiseOr, Operator::kNoProperties, 2, 1) \ | 561 V(BitwiseOr, Operator::kNoProperties, 2, 1) \ |
| 563 V(BitwiseXor, Operator::kNoProperties, 2, 1) \ | 562 V(BitwiseXor, Operator::kNoProperties, 2, 1) \ |
| (...skipping 27 matching lines...) Expand all Loading... |
| 591 V(StackCheck, Operator::kNoWrite, 0, 0) \ | 590 V(StackCheck, Operator::kNoWrite, 0, 0) \ |
| 592 V(Debugger, Operator::kNoProperties, 0, 0) \ | 591 V(Debugger, Operator::kNoProperties, 0, 0) \ |
| 593 V(GetSuperConstructor, Operator::kNoWrite, 1, 1) | 592 V(GetSuperConstructor, Operator::kNoWrite, 1, 1) |
| 594 | 593 |
| 595 #define BINARY_OP_LIST(V) V(Add) | 594 #define BINARY_OP_LIST(V) V(Add) |
| 596 | 595 |
| 597 #define COMPARE_OP_LIST(V) \ | 596 #define COMPARE_OP_LIST(V) \ |
| 598 V(Equal, Operator::kNoProperties) \ | 597 V(Equal, Operator::kNoProperties) \ |
| 599 V(NotEqual, Operator::kNoProperties) \ | 598 V(NotEqual, Operator::kNoProperties) \ |
| 600 V(StrictEqual, Operator::kPure) \ | 599 V(StrictEqual, Operator::kPure) \ |
| 601 V(StrictNotEqual, Operator::kPure) \ | |
| 602 V(LessThan, Operator::kNoProperties) \ | 600 V(LessThan, Operator::kNoProperties) \ |
| 603 V(GreaterThan, Operator::kNoProperties) \ | 601 V(GreaterThan, Operator::kNoProperties) \ |
| 604 V(LessThanOrEqual, Operator::kNoProperties) \ | 602 V(LessThanOrEqual, Operator::kNoProperties) \ |
| 605 V(GreaterThanOrEqual, Operator::kNoProperties) | 603 V(GreaterThanOrEqual, Operator::kNoProperties) |
| 606 | 604 |
| 607 struct JSOperatorGlobalCache final { | 605 struct JSOperatorGlobalCache final { |
| 608 #define CACHED_OP(Name, properties, value_input_count, value_output_count) \ | 606 #define CACHED_OP(Name, properties, value_input_count, value_output_count) \ |
| 609 struct Name##Operator final : public Operator { \ | 607 struct Name##Operator final : public Operator { \ |
| 610 Name##Operator() \ | 608 Name##Operator() \ |
| 611 : Operator(IrOpcode::kJS##Name, properties, "JS" #Name, \ | 609 : Operator(IrOpcode::kJS##Name, properties, "JS" #Name, \ |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1077 return new (zone()) Operator1<Handle<ScopeInfo>>( // -- | 1075 return new (zone()) Operator1<Handle<ScopeInfo>>( // -- |
| 1078 IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode | 1076 IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode |
| 1079 "JSCreateScriptContext", // name | 1077 "JSCreateScriptContext", // name |
| 1080 1, 1, 1, 1, 1, 2, // counts | 1078 1, 1, 1, 1, 1, 2, // counts |
| 1081 scope_info); // parameter | 1079 scope_info); // parameter |
| 1082 } | 1080 } |
| 1083 | 1081 |
| 1084 } // namespace compiler | 1082 } // namespace compiler |
| 1085 } // namespace internal | 1083 } // namespace internal |
| 1086 } // namespace v8 | 1084 } // namespace v8 |
| OLD | NEW |