| 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 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 : Operator1<CompareOperationHint>( \ | 519 : Operator1<CompareOperationHint>( \ |
| 520 IrOpcode::kJS##Name, properties, "JS" #Name, 2, 1, 1, 1, 1, \ | 520 IrOpcode::kJS##Name, properties, "JS" #Name, 2, 1, 1, 1, 1, \ |
| 521 Operator::ZeroIfNoThrow(properties), kHint) {} \ | 521 Operator::ZeroIfNoThrow(properties), kHint) {} \ |
| 522 }; \ | 522 }; \ |
| 523 Name##Operator<CompareOperationHint::kNone> k##Name##NoneOperator; \ | 523 Name##Operator<CompareOperationHint::kNone> k##Name##NoneOperator; \ |
| 524 Name##Operator<CompareOperationHint::kSignedSmall> \ | 524 Name##Operator<CompareOperationHint::kSignedSmall> \ |
| 525 k##Name##SignedSmallOperator; \ | 525 k##Name##SignedSmallOperator; \ |
| 526 Name##Operator<CompareOperationHint::kNumber> k##Name##NumberOperator; \ | 526 Name##Operator<CompareOperationHint::kNumber> k##Name##NumberOperator; \ |
| 527 Name##Operator<CompareOperationHint::kNumberOrOddball> \ | 527 Name##Operator<CompareOperationHint::kNumberOrOddball> \ |
| 528 k##Name##NumberOrOddballOperator; \ | 528 k##Name##NumberOrOddballOperator; \ |
| 529 Name##Operator<CompareOperationHint::kString> k##Name##StringOperator; \ |
| 529 Name##Operator<CompareOperationHint::kAny> k##Name##AnyOperator; | 530 Name##Operator<CompareOperationHint::kAny> k##Name##AnyOperator; |
| 530 COMPARE_OP_LIST(COMPARE_OP) | 531 COMPARE_OP_LIST(COMPARE_OP) |
| 531 #undef COMPARE_OP | 532 #undef COMPARE_OP |
| 532 }; | 533 }; |
| 533 | 534 |
| 534 static base::LazyInstance<JSOperatorGlobalCache>::type kCache = | 535 static base::LazyInstance<JSOperatorGlobalCache>::type kCache = |
| 535 LAZY_INSTANCE_INITIALIZER; | 536 LAZY_INSTANCE_INITIALIZER; |
| 536 | 537 |
| 537 JSOperatorBuilder::JSOperatorBuilder(Zone* zone) | 538 JSOperatorBuilder::JSOperatorBuilder(Zone* zone) |
| 538 : cache_(kCache.Get()), zone_(zone) {} | 539 : cache_(kCache.Get()), zone_(zone) {} |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 const Operator* JSOperatorBuilder::Name(CompareOperationHint hint) { \ | 571 const Operator* JSOperatorBuilder::Name(CompareOperationHint hint) { \ |
| 571 switch (hint) { \ | 572 switch (hint) { \ |
| 572 case CompareOperationHint::kNone: \ | 573 case CompareOperationHint::kNone: \ |
| 573 return &cache_.k##Name##NoneOperator; \ | 574 return &cache_.k##Name##NoneOperator; \ |
| 574 case CompareOperationHint::kSignedSmall: \ | 575 case CompareOperationHint::kSignedSmall: \ |
| 575 return &cache_.k##Name##SignedSmallOperator; \ | 576 return &cache_.k##Name##SignedSmallOperator; \ |
| 576 case CompareOperationHint::kNumber: \ | 577 case CompareOperationHint::kNumber: \ |
| 577 return &cache_.k##Name##NumberOperator; \ | 578 return &cache_.k##Name##NumberOperator; \ |
| 578 case CompareOperationHint::kNumberOrOddball: \ | 579 case CompareOperationHint::kNumberOrOddball: \ |
| 579 return &cache_.k##Name##NumberOrOddballOperator; \ | 580 return &cache_.k##Name##NumberOrOddballOperator; \ |
| 581 case CompareOperationHint::kString: \ |
| 582 return &cache_.k##Name##StringOperator; \ |
| 580 case CompareOperationHint::kAny: \ | 583 case CompareOperationHint::kAny: \ |
| 581 return &cache_.k##Name##AnyOperator; \ | 584 return &cache_.k##Name##AnyOperator; \ |
| 582 } \ | 585 } \ |
| 583 UNREACHABLE(); \ | 586 UNREACHABLE(); \ |
| 584 return nullptr; \ | 587 return nullptr; \ |
| 585 } | 588 } |
| 586 COMPARE_OP_LIST(COMPARE_OP) | 589 COMPARE_OP_LIST(COMPARE_OP) |
| 587 #undef COMPARE_OP | 590 #undef COMPARE_OP |
| 588 | 591 |
| 589 const Operator* JSOperatorBuilder::ToBoolean(ToBooleanHints hints) { | 592 const Operator* JSOperatorBuilder::ToBoolean(ToBooleanHints hints) { |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 895 return new (zone()) Operator1<Handle<ScopeInfo>>( // -- | 898 return new (zone()) Operator1<Handle<ScopeInfo>>( // -- |
| 896 IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode | 899 IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode |
| 897 "JSCreateScriptContext", // name | 900 "JSCreateScriptContext", // name |
| 898 1, 1, 1, 1, 1, 2, // counts | 901 1, 1, 1, 1, 1, 2, // counts |
| 899 scpope_info); // parameter | 902 scpope_info); // parameter |
| 900 } | 903 } |
| 901 | 904 |
| 902 } // namespace compiler | 905 } // namespace compiler |
| 903 } // namespace internal | 906 } // namespace internal |
| 904 } // namespace v8 | 907 } // namespace v8 |
| OLD | NEW |