| 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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 CheckTaggedHoleOperator<CheckTaggedHoleMode::kNeverReturnHole> | 359 CheckTaggedHoleOperator<CheckTaggedHoleMode::kNeverReturnHole> |
| 360 kCheckTaggedHoleNeverReturnHoleOperator; | 360 kCheckTaggedHoleNeverReturnHoleOperator; |
| 361 | 361 |
| 362 struct CheckIfOperator final : public Operator { | 362 struct CheckIfOperator final : public Operator { |
| 363 CheckIfOperator() | 363 CheckIfOperator() |
| 364 : Operator(IrOpcode::kCheckIf, Operator::kPure, "CheckIf", 1, 1, 1, 0, | 364 : Operator(IrOpcode::kCheckIf, Operator::kPure, "CheckIf", 1, 1, 1, 0, |
| 365 1, 0) {} | 365 1, 0) {} |
| 366 }; | 366 }; |
| 367 CheckIfOperator kCheckIf; | 367 CheckIfOperator kCheckIf; |
| 368 | 368 |
| 369 struct CheckUnlessOperator final : public Operator { | |
| 370 CheckUnlessOperator() | |
| 371 : Operator(IrOpcode::kCheckUnless, Operator::kPure, "CheckUnless", 1, 1, | |
| 372 1, 0, 1, 0) {} | |
| 373 }; | |
| 374 CheckUnlessOperator kCheckUnless; | |
| 375 | |
| 376 template <PretenureFlag kPretenure> | 369 template <PretenureFlag kPretenure> |
| 377 struct AllocateOperator final : public Operator1<PretenureFlag> { | 370 struct AllocateOperator final : public Operator1<PretenureFlag> { |
| 378 AllocateOperator() | 371 AllocateOperator() |
| 379 : Operator1<PretenureFlag>(IrOpcode::kAllocate, Operator::kNoThrow, | 372 : Operator1<PretenureFlag>(IrOpcode::kAllocate, Operator::kNoThrow, |
| 380 "Allocate", 1, 1, 1, 1, 1, 0, kPretenure) {} | 373 "Allocate", 1, 1, 1, 1, 1, 0, kPretenure) {} |
| 381 }; | 374 }; |
| 382 AllocateOperator<NOT_TENURED> kAllocateNotTenuredOperator; | 375 AllocateOperator<NOT_TENURED> kAllocateNotTenuredOperator; |
| 383 AllocateOperator<TENURED> kAllocateTenuredOperator; | 376 AllocateOperator<TENURED> kAllocateTenuredOperator; |
| 384 | 377 |
| 385 #define BUFFER_ACCESS(Type, type, TYPE, ctype, size) \ | 378 #define BUFFER_ACCESS(Type, type, TYPE, ctype, size) \ |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 return &cache_.kCheckTaggedHoleNeverReturnHoleOperator; | 435 return &cache_.kCheckTaggedHoleNeverReturnHoleOperator; |
| 443 } | 436 } |
| 444 UNREACHABLE(); | 437 UNREACHABLE(); |
| 445 return nullptr; | 438 return nullptr; |
| 446 } | 439 } |
| 447 | 440 |
| 448 const Operator* SimplifiedOperatorBuilder::CheckIf() { | 441 const Operator* SimplifiedOperatorBuilder::CheckIf() { |
| 449 return &cache_.kCheckIf; | 442 return &cache_.kCheckIf; |
| 450 } | 443 } |
| 451 | 444 |
| 452 const Operator* SimplifiedOperatorBuilder::CheckUnless() { | |
| 453 return &cache_.kCheckUnless; | |
| 454 } | |
| 455 | |
| 456 const Operator* SimplifiedOperatorBuilder::ReferenceEqual(Type* type) { | 445 const Operator* SimplifiedOperatorBuilder::ReferenceEqual(Type* type) { |
| 457 return new (zone()) Operator(IrOpcode::kReferenceEqual, | 446 return new (zone()) Operator(IrOpcode::kReferenceEqual, |
| 458 Operator::kCommutative | Operator::kPure, | 447 Operator::kCommutative | Operator::kPure, |
| 459 "ReferenceEqual", 2, 0, 0, 1, 0, 0); | 448 "ReferenceEqual", 2, 0, 0, 1, 0, 0); |
| 460 } | 449 } |
| 461 | 450 |
| 462 const Operator* SimplifiedOperatorBuilder::CheckBounds() { | 451 const Operator* SimplifiedOperatorBuilder::CheckBounds() { |
| 463 // TODO(bmeurer): Cache this operator. Make it pure! | 452 // TODO(bmeurer): Cache this operator. Make it pure! |
| 464 return new (zone()) Operator(IrOpcode::kCheckBounds, Operator::kPure, | 453 return new (zone()) Operator(IrOpcode::kCheckBounds, Operator::kPure, |
| 465 "CheckBounds", 2, 1, 1, 1, 1, 0); | 454 "CheckBounds", 2, 1, 1, 1, 1, 0); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 Operator1<Type>(IrOpcode::k##Name, Operator::kNoThrow | properties, \ | 552 Operator1<Type>(IrOpcode::k##Name, Operator::kNoThrow | properties, \ |
| 564 #Name, value_input_count, 1, control_input_count, \ | 553 #Name, value_input_count, 1, control_input_count, \ |
| 565 output_count, 1, 0, access); \ | 554 output_count, 1, 0, access); \ |
| 566 } | 555 } |
| 567 ACCESS_OP_LIST(ACCESS) | 556 ACCESS_OP_LIST(ACCESS) |
| 568 #undef ACCESS | 557 #undef ACCESS |
| 569 | 558 |
| 570 } // namespace compiler | 559 } // namespace compiler |
| 571 } // namespace internal | 560 } // namespace internal |
| 572 } // namespace v8 | 561 } // namespace v8 |
| OLD | NEW |