| 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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 392 } | 392 } | 
| 393 | 393 | 
| 394 const CompareOperationHints& CompareOperationHintsOf(const Operator* op) { | 394 const CompareOperationHints& CompareOperationHintsOf(const Operator* op) { | 
| 395   DCHECK(op->opcode() == IrOpcode::kJSEqual || | 395   DCHECK(op->opcode() == IrOpcode::kJSEqual || | 
| 396          op->opcode() == IrOpcode::kJSNotEqual || | 396          op->opcode() == IrOpcode::kJSNotEqual || | 
| 397          op->opcode() == IrOpcode::kJSStrictEqual || | 397          op->opcode() == IrOpcode::kJSStrictEqual || | 
| 398          op->opcode() == IrOpcode::kJSStrictNotEqual || | 398          op->opcode() == IrOpcode::kJSStrictNotEqual || | 
| 399          op->opcode() == IrOpcode::kJSLessThan || | 399          op->opcode() == IrOpcode::kJSLessThan || | 
| 400          op->opcode() == IrOpcode::kJSGreaterThan || | 400          op->opcode() == IrOpcode::kJSGreaterThan || | 
| 401          op->opcode() == IrOpcode::kJSLessThanOrEqual || | 401          op->opcode() == IrOpcode::kJSLessThanOrEqual || | 
| 402          op->opcode() == IrOpcode::kJSGreaterThanOrEqual); | 402          op->opcode() == IrOpcode::kJSGreaterThanOrEqual || | 
|  | 403          op->opcode() == IrOpcode::kJSSameValueZero); | 
| 403   return OpParameter<CompareOperationHints>(op); | 404   return OpParameter<CompareOperationHints>(op); | 
| 404 } | 405 } | 
| 405 | 406 | 
| 406 #define CACHED_OP_LIST(V)                                   \ | 407 #define CACHED_OP_LIST(V)                                   \ | 
| 407   V(ToInteger, Operator::kNoProperties, 1, 1)               \ | 408   V(ToInteger, Operator::kNoProperties, 1, 1)               \ | 
| 408   V(ToLength, Operator::kNoProperties, 1, 1)                \ | 409   V(ToLength, Operator::kNoProperties, 1, 1)                \ | 
| 409   V(ToName, Operator::kNoProperties, 1, 1)                  \ | 410   V(ToName, Operator::kNoProperties, 1, 1)                  \ | 
| 410   V(ToNumber, Operator::kNoProperties, 1, 1)                \ | 411   V(ToNumber, Operator::kNoProperties, 1, 1)                \ | 
| 411   V(ToObject, Operator::kFoldable, 1, 1)                    \ | 412   V(ToObject, Operator::kFoldable, 1, 1)                    \ | 
| 412   V(ToString, Operator::kNoProperties, 1, 1)                \ | 413   V(ToString, Operator::kNoProperties, 1, 1)                \ | 
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 585 | 586 | 
| 586 const Operator* JSOperatorBuilder::StrictNotEqual(CompareOperationHints hints) { | 587 const Operator* JSOperatorBuilder::StrictNotEqual(CompareOperationHints hints) { | 
| 587   // TODO(turbofan): Cache most important versions of this operator. | 588   // TODO(turbofan): Cache most important versions of this operator. | 
| 588   return new (zone()) Operator1<CompareOperationHints>(  //-- | 589   return new (zone()) Operator1<CompareOperationHints>(  //-- | 
| 589       IrOpcode::kJSStrictNotEqual, Operator::kPure,      // opcode | 590       IrOpcode::kJSStrictNotEqual, Operator::kPure,      // opcode | 
| 590       "JSStrictNotEqual",                                // name | 591       "JSStrictNotEqual",                                // name | 
| 591       2, 0, 0, 1, 0, 0,                                  // inputs/outputs | 592       2, 0, 0, 1, 0, 0,                                  // inputs/outputs | 
| 592       hints);                                            // parameter | 593       hints);                                            // parameter | 
| 593 } | 594 } | 
| 594 | 595 | 
|  | 596 const Operator* JSOperatorBuilder::SameValueZero(CompareOperationHints hints) { | 
|  | 597   return new (zone()) Operator1<CompareOperationHints>(  //-- | 
|  | 598       IrOpcode::kJSSameValueZero, Operator::kPure,       // opcode | 
|  | 599       "JSSameValueZero",                                 // name | 
|  | 600       2, 0, 0, 1, 0, 0,                                  // inputs/outputs | 
|  | 601       hints);                                            // parameter | 
|  | 602 } | 
|  | 603 | 
| 595 const Operator* JSOperatorBuilder::LessThan(CompareOperationHints hints) { | 604 const Operator* JSOperatorBuilder::LessThan(CompareOperationHints hints) { | 
| 596   // TODO(turbofan): Cache most important versions of this operator. | 605   // TODO(turbofan): Cache most important versions of this operator. | 
| 597   return new (zone()) Operator1<CompareOperationHints>(  //-- | 606   return new (zone()) Operator1<CompareOperationHints>(  //-- | 
| 598       IrOpcode::kJSLessThan, Operator::kNoProperties,    // opcode | 607       IrOpcode::kJSLessThan, Operator::kNoProperties,    // opcode | 
| 599       "JSLessThan",                                      // name | 608       "JSLessThan",                                      // name | 
| 600       2, 1, 1, 1, 1, 2,                                  // inputs/outputs | 609       2, 1, 1, 1, 1, 2,                                  // inputs/outputs | 
| 601       hints);                                            // parameter | 610       hints);                                            // parameter | 
| 602 } | 611 } | 
| 603 | 612 | 
| 604 const Operator* JSOperatorBuilder::GreaterThan(CompareOperationHints hints) { | 613 const Operator* JSOperatorBuilder::GreaterThan(CompareOperationHints hints) { | 
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 915   return new (zone()) Operator1<Handle<ScopeInfo>>(               // -- | 924   return new (zone()) Operator1<Handle<ScopeInfo>>(               // -- | 
| 916       IrOpcode::kJSCreateScriptContext, Operator::kNoProperties,  // opcode | 925       IrOpcode::kJSCreateScriptContext, Operator::kNoProperties,  // opcode | 
| 917       "JSCreateScriptContext",                                    // name | 926       "JSCreateScriptContext",                                    // name | 
| 918       1, 1, 1, 1, 1, 2,                                           // counts | 927       1, 1, 1, 1, 1, 2,                                           // counts | 
| 919       scpope_info);                                               // parameter | 928       scpope_info);                                               // parameter | 
| 920 } | 929 } | 
| 921 | 930 | 
| 922 }  // namespace compiler | 931 }  // namespace compiler | 
| 923 }  // namespace internal | 932 }  // namespace internal | 
| 924 }  // namespace v8 | 933 }  // namespace v8 | 
| OLD | NEW | 
|---|