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