| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/simplified-operator.h" | 5 #include "src/compiler/simplified-operator.h" |
| 6 | 6 |
| 7 #include "src/base/lazy-instance.h" | 7 #include "src/base/lazy-instance.h" |
| 8 #include "src/compiler/opcodes.h" | 8 #include "src/compiler/opcodes.h" |
| 9 #include "src/compiler/operator.h" | 9 #include "src/compiler/operator.h" |
| 10 #include "src/types.h" | 10 #include "src/types.h" |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 const Operator* SimplifiedOperatorBuilder::CheckIf() { | 325 const Operator* SimplifiedOperatorBuilder::CheckIf() { |
| 326 return &cache_.kCheckIf; | 326 return &cache_.kCheckIf; |
| 327 } | 327 } |
| 328 | 328 |
| 329 const Operator* SimplifiedOperatorBuilder::ReferenceEqual(Type* type) { | 329 const Operator* SimplifiedOperatorBuilder::ReferenceEqual(Type* type) { |
| 330 return new (zone()) Operator(IrOpcode::kReferenceEqual, | 330 return new (zone()) Operator(IrOpcode::kReferenceEqual, |
| 331 Operator::kCommutative | Operator::kPure, | 331 Operator::kCommutative | Operator::kPure, |
| 332 "ReferenceEqual", 2, 0, 0, 1, 0, 0); | 332 "ReferenceEqual", 2, 0, 0, 1, 0, 0); |
| 333 } | 333 } |
| 334 | 334 |
| 335 const Operator* SimplifiedOperatorBuilder::CheckBounds() { | |
| 336 // TODO(bmeurer): Cache this operator. Make it pure! | |
| 337 return new (zone()) Operator(IrOpcode::kCheckBounds, Operator::kEliminatable, | |
| 338 "CheckBounds", 2, 1, 1, 1, 1, 0); | |
| 339 } | |
| 340 | |
| 341 const Operator* SimplifiedOperatorBuilder::TypeGuard(Type* type) { | 335 const Operator* SimplifiedOperatorBuilder::TypeGuard(Type* type) { |
| 342 class TypeGuardOperator final : public Operator1<Type*> { | 336 class TypeGuardOperator final : public Operator1<Type*> { |
| 343 public: | 337 public: |
| 344 explicit TypeGuardOperator(Type* type) | 338 explicit TypeGuardOperator(Type* type) |
| 345 : Operator1<Type*>( // -- | 339 : Operator1<Type*>( // -- |
| 346 IrOpcode::kTypeGuard, Operator::kPure, // opcode | 340 IrOpcode::kTypeGuard, Operator::kPure, // opcode |
| 347 "TypeGuard", // name | 341 "TypeGuard", // name |
| 348 1, 0, 1, 1, 0, 0, // counts | 342 1, 0, 1, 1, 0, 0, // counts |
| 349 type) {} // parameter | 343 type) {} // parameter |
| 350 | 344 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 Operator1<Type>(IrOpcode::k##Name, Operator::kNoThrow | properties, \ | 414 Operator1<Type>(IrOpcode::k##Name, Operator::kNoThrow | properties, \ |
| 421 #Name, value_input_count, 1, control_input_count, \ | 415 #Name, value_input_count, 1, control_input_count, \ |
| 422 output_count, 1, 0, access); \ | 416 output_count, 1, 0, access); \ |
| 423 } | 417 } |
| 424 ACCESS_OP_LIST(ACCESS) | 418 ACCESS_OP_LIST(ACCESS) |
| 425 #undef ACCESS | 419 #undef ACCESS |
| 426 | 420 |
| 427 } // namespace compiler | 421 } // namespace compiler |
| 428 } // namespace internal | 422 } // namespace internal |
| 429 } // namespace v8 | 423 } // namespace v8 |
| OLD | NEW |