| 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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 } | 369 } |
| 370 | 370 |
| 371 | 371 |
| 372 const CreateLiteralParameters& CreateLiteralParametersOf(const Operator* op) { | 372 const CreateLiteralParameters& CreateLiteralParametersOf(const Operator* op) { |
| 373 DCHECK(op->opcode() == IrOpcode::kJSCreateLiteralArray || | 373 DCHECK(op->opcode() == IrOpcode::kJSCreateLiteralArray || |
| 374 op->opcode() == IrOpcode::kJSCreateLiteralObject || | 374 op->opcode() == IrOpcode::kJSCreateLiteralObject || |
| 375 op->opcode() == IrOpcode::kJSCreateLiteralRegExp); | 375 op->opcode() == IrOpcode::kJSCreateLiteralRegExp); |
| 376 return OpParameter<CreateLiteralParameters>(op); | 376 return OpParameter<CreateLiteralParameters>(op); |
| 377 } | 377 } |
| 378 | 378 |
| 379 const BinaryOperationHints& BinaryOperationHintsOf(const Operator* op) { | 379 const BinaryOperationHint BinaryOperationHintOf(const Operator* op) { |
| 380 DCHECK(op->opcode() == IrOpcode::kJSBitwiseOr || | 380 DCHECK(op->opcode() == IrOpcode::kJSBitwiseOr || |
| 381 op->opcode() == IrOpcode::kJSBitwiseXor || | 381 op->opcode() == IrOpcode::kJSBitwiseXor || |
| 382 op->opcode() == IrOpcode::kJSBitwiseAnd || | 382 op->opcode() == IrOpcode::kJSBitwiseAnd || |
| 383 op->opcode() == IrOpcode::kJSShiftLeft || | 383 op->opcode() == IrOpcode::kJSShiftLeft || |
| 384 op->opcode() == IrOpcode::kJSShiftRight || | 384 op->opcode() == IrOpcode::kJSShiftRight || |
| 385 op->opcode() == IrOpcode::kJSShiftRightLogical || | 385 op->opcode() == IrOpcode::kJSShiftRightLogical || |
| 386 op->opcode() == IrOpcode::kJSAdd || | 386 op->opcode() == IrOpcode::kJSAdd || |
| 387 op->opcode() == IrOpcode::kJSSubtract || | 387 op->opcode() == IrOpcode::kJSSubtract || |
| 388 op->opcode() == IrOpcode::kJSMultiply || | 388 op->opcode() == IrOpcode::kJSMultiply || |
| 389 op->opcode() == IrOpcode::kJSDivide || | 389 op->opcode() == IrOpcode::kJSDivide || |
| 390 op->opcode() == IrOpcode::kJSModulus); | 390 op->opcode() == IrOpcode::kJSModulus); |
| 391 return OpParameter<BinaryOperationHints>(op); | 391 return OpParameter<BinaryOperationHint>(op); |
| 392 } | 392 } |
| 393 | 393 |
| 394 const CompareOperationHints& CompareOperationHintsOf(const Operator* op) { | 394 const CompareOperationHint CompareOperationHintOf(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 return OpParameter<CompareOperationHints>(op); | 403 return OpParameter<CompareOperationHint>(op); |
| 404 } | 404 } |
| 405 | 405 |
| 406 #define CACHED_OP_LIST(V) \ | 406 #define CACHED_OP_LIST(V) \ |
| 407 V(ToInteger, Operator::kNoProperties, 1, 1) \ | 407 V(ToInteger, Operator::kNoProperties, 1, 1) \ |
| 408 V(ToLength, Operator::kNoProperties, 1, 1) \ | 408 V(ToLength, Operator::kNoProperties, 1, 1) \ |
| 409 V(ToName, Operator::kNoProperties, 1, 1) \ | 409 V(ToName, Operator::kNoProperties, 1, 1) \ |
| 410 V(ToNumber, Operator::kNoProperties, 1, 1) \ | 410 V(ToNumber, Operator::kNoProperties, 1, 1) \ |
| 411 V(ToObject, Operator::kFoldable, 1, 1) \ | 411 V(ToObject, Operator::kFoldable, 1, 1) \ |
| 412 V(ToString, Operator::kNoProperties, 1, 1) \ | 412 V(ToString, Operator::kNoProperties, 1, 1) \ |
| 413 V(Create, Operator::kEliminatable, 2, 1) \ | 413 V(Create, Operator::kEliminatable, 2, 1) \ |
| 414 V(CreateIterResultObject, Operator::kEliminatable, 2, 1) \ | 414 V(CreateIterResultObject, Operator::kEliminatable, 2, 1) \ |
| 415 V(HasProperty, Operator::kNoProperties, 2, 1) \ | 415 V(HasProperty, Operator::kNoProperties, 2, 1) \ |
| 416 V(TypeOf, Operator::kPure, 1, 1) \ | 416 V(TypeOf, Operator::kPure, 1, 1) \ |
| 417 V(InstanceOf, Operator::kNoProperties, 2, 1) \ | 417 V(InstanceOf, Operator::kNoProperties, 2, 1) \ |
| 418 V(ForInDone, Operator::kPure, 2, 1) \ | 418 V(ForInDone, Operator::kPure, 2, 1) \ |
| 419 V(ForInNext, Operator::kNoProperties, 4, 1) \ | 419 V(ForInNext, Operator::kNoProperties, 4, 1) \ |
| 420 V(ForInPrepare, Operator::kNoProperties, 1, 3) \ | 420 V(ForInPrepare, Operator::kNoProperties, 1, 3) \ |
| 421 V(ForInStep, Operator::kPure, 1, 1) \ | 421 V(ForInStep, Operator::kPure, 1, 1) \ |
| 422 V(LoadMessage, Operator::kNoThrow, 0, 1) \ | 422 V(LoadMessage, Operator::kNoThrow, 0, 1) \ |
| 423 V(StoreMessage, Operator::kNoThrow, 1, 0) \ | 423 V(StoreMessage, Operator::kNoThrow, 1, 0) \ |
| 424 V(GeneratorRestoreContinuation, Operator::kNoThrow, 1, 1) \ | 424 V(GeneratorRestoreContinuation, Operator::kNoThrow, 1, 1) \ |
| 425 V(StackCheck, Operator::kNoWrite, 0, 0) \ | 425 V(StackCheck, Operator::kNoWrite, 0, 0) \ |
| 426 V(CreateWithContext, Operator::kNoProperties, 2, 1) | 426 V(CreateWithContext, Operator::kNoProperties, 2, 1) |
| 427 | 427 |
| 428 #define BINARY_OP_LIST(V) \ |
| 429 V(BitwiseOr) \ |
| 430 V(BitwiseXor) \ |
| 431 V(BitwiseAnd) \ |
| 432 V(ShiftLeft) \ |
| 433 V(ShiftRight) \ |
| 434 V(ShiftRightLogical) \ |
| 435 V(Add) \ |
| 436 V(Subtract) \ |
| 437 V(Multiply) \ |
| 438 V(Divide) \ |
| 439 V(Modulus) |
| 440 |
| 441 #define COMPARE_OP_LIST(V) \ |
| 442 V(Equal, Operator::kNoProperties) \ |
| 443 V(NotEqual, Operator::kNoProperties) \ |
| 444 V(StrictEqual, Operator::kPure) \ |
| 445 V(StrictNotEqual, Operator::kPure) \ |
| 446 V(LessThan, Operator::kNoProperties) \ |
| 447 V(GreaterThan, Operator::kNoProperties) \ |
| 448 V(LessThanOrEqual, Operator::kNoProperties) \ |
| 449 V(GreaterThanOrEqual, Operator::kNoProperties) |
| 450 |
| 428 struct JSOperatorGlobalCache final { | 451 struct JSOperatorGlobalCache final { |
| 429 #define CACHED(Name, properties, value_input_count, value_output_count) \ | 452 #define CACHED_OP(Name, properties, value_input_count, value_output_count) \ |
| 430 struct Name##Operator final : public Operator { \ | 453 struct Name##Operator final : public Operator { \ |
| 431 Name##Operator() \ | 454 Name##Operator() \ |
| 432 : Operator(IrOpcode::kJS##Name, properties, "JS" #Name, \ | 455 : Operator(IrOpcode::kJS##Name, properties, "JS" #Name, \ |
| 433 value_input_count, Operator::ZeroIfPure(properties), \ | 456 value_input_count, Operator::ZeroIfPure(properties), \ |
| 434 Operator::ZeroIfEliminatable(properties), \ | 457 Operator::ZeroIfEliminatable(properties), \ |
| 435 value_output_count, Operator::ZeroIfPure(properties), \ | 458 value_output_count, Operator::ZeroIfPure(properties), \ |
| 436 Operator::ZeroIfNoThrow(properties)) {} \ | 459 Operator::ZeroIfNoThrow(properties)) {} \ |
| 437 }; \ | 460 }; \ |
| 438 Name##Operator k##Name##Operator; | 461 Name##Operator k##Name##Operator; |
| 439 CACHED_OP_LIST(CACHED) | 462 CACHED_OP_LIST(CACHED_OP) |
| 440 #undef CACHED | 463 #undef CACHED_OP |
| 464 |
| 465 #define BINARY_OP(Name) \ |
| 466 template <BinaryOperationHint kHint> \ |
| 467 struct Name##Operator final : public Operator1<BinaryOperationHint> { \ |
| 468 Name##Operator() \ |
| 469 : Operator1<BinaryOperationHint>(IrOpcode::kJS##Name, \ |
| 470 Operator::kNoProperties, "JS" #Name, \ |
| 471 2, 1, 1, 1, 1, 2, kHint) {} \ |
| 472 }; \ |
| 473 Name##Operator<BinaryOperationHint::kNone> k##Name##NoneOperator; \ |
| 474 Name##Operator<BinaryOperationHint::kSignedSmall> \ |
| 475 k##Name##SignedSmallOperator; \ |
| 476 Name##Operator<BinaryOperationHint::kSigned32> k##Name##Signed32Operator; \ |
| 477 Name##Operator<BinaryOperationHint::kNumberOrOddball> \ |
| 478 k##Name##NumberOrOddballOperator; \ |
| 479 Name##Operator<BinaryOperationHint::kAny> k##Name##AnyOperator; |
| 480 BINARY_OP_LIST(BINARY_OP) |
| 481 #undef BINARY_OP |
| 482 |
| 483 #define COMPARE_OP(Name, properties) \ |
| 484 template <CompareOperationHint kHint> \ |
| 485 struct Name##Operator final : public Operator1<CompareOperationHint> { \ |
| 486 Name##Operator() \ |
| 487 : Operator1<CompareOperationHint>( \ |
| 488 IrOpcode::kJS##Name, properties, "JS" #Name, 2, 1, 1, 1, 1, \ |
| 489 Operator::ZeroIfNoThrow(properties), kHint) {} \ |
| 490 }; \ |
| 491 Name##Operator<CompareOperationHint::kNone> k##Name##NoneOperator; \ |
| 492 Name##Operator<CompareOperationHint::kSignedSmall> \ |
| 493 k##Name##SignedSmallOperator; \ |
| 494 Name##Operator<CompareOperationHint::kNumber> k##Name##NumberOperator; \ |
| 495 Name##Operator<CompareOperationHint::kNumberOrOddball> \ |
| 496 k##Name##NumberOrOddballOperator; \ |
| 497 Name##Operator<CompareOperationHint::kAny> k##Name##AnyOperator; |
| 498 COMPARE_OP_LIST(COMPARE_OP) |
| 499 #undef COMPARE_OP |
| 441 }; | 500 }; |
| 442 | 501 |
| 443 | |
| 444 static base::LazyInstance<JSOperatorGlobalCache>::type kCache = | 502 static base::LazyInstance<JSOperatorGlobalCache>::type kCache = |
| 445 LAZY_INSTANCE_INITIALIZER; | 503 LAZY_INSTANCE_INITIALIZER; |
| 446 | 504 |
| 447 | |
| 448 JSOperatorBuilder::JSOperatorBuilder(Zone* zone) | 505 JSOperatorBuilder::JSOperatorBuilder(Zone* zone) |
| 449 : cache_(kCache.Get()), zone_(zone) {} | 506 : cache_(kCache.Get()), zone_(zone) {} |
| 450 | 507 |
| 508 #define CACHED_OP(Name, properties, value_input_count, value_output_count) \ |
| 509 const Operator* JSOperatorBuilder::Name() { \ |
| 510 return &cache_.k##Name##Operator; \ |
| 511 } |
| 512 CACHED_OP_LIST(CACHED_OP) |
| 513 #undef CACHED_OP |
| 451 | 514 |
| 452 #define CACHED(Name, properties, value_input_count, value_output_count) \ | 515 #define BINARY_OP(Name) \ |
| 453 const Operator* JSOperatorBuilder::Name() { \ | 516 const Operator* JSOperatorBuilder::Name(BinaryOperationHint hint) { \ |
| 454 return &cache_.k##Name##Operator; \ | 517 switch (hint) { \ |
| 518 case BinaryOperationHint::kNone: \ |
| 519 return &cache_.k##Name##NoneOperator; \ |
| 520 case BinaryOperationHint::kSignedSmall: \ |
| 521 return &cache_.k##Name##SignedSmallOperator; \ |
| 522 case BinaryOperationHint::kSigned32: \ |
| 523 return &cache_.k##Name##Signed32Operator; \ |
| 524 case BinaryOperationHint::kNumberOrOddball: \ |
| 525 return &cache_.k##Name##NumberOrOddballOperator; \ |
| 526 case BinaryOperationHint::kAny: \ |
| 527 return &cache_.k##Name##AnyOperator; \ |
| 528 } \ |
| 529 UNREACHABLE(); \ |
| 530 return nullptr; \ |
| 455 } | 531 } |
| 456 CACHED_OP_LIST(CACHED) | 532 BINARY_OP_LIST(BINARY_OP) |
| 457 #undef CACHED | 533 #undef BINARY_OP |
| 458 | 534 |
| 459 const Operator* JSOperatorBuilder::BitwiseOr(BinaryOperationHints hints) { | 535 #define COMPARE_OP(Name, ...) \ |
| 460 // TODO(turbofan): Cache most important versions of this operator. | 536 const Operator* JSOperatorBuilder::Name(CompareOperationHint hint) { \ |
| 461 return new (zone()) Operator1<BinaryOperationHints>( //-- | 537 switch (hint) { \ |
| 462 IrOpcode::kJSBitwiseOr, Operator::kNoProperties, // opcode | 538 case CompareOperationHint::kNone: \ |
| 463 "JSBitwiseOr", // name | 539 return &cache_.k##Name##NoneOperator; \ |
| 464 2, 1, 1, 1, 1, 2, // inputs/outputs | 540 case CompareOperationHint::kSignedSmall: \ |
| 465 hints); // parameter | 541 return &cache_.k##Name##SignedSmallOperator; \ |
| 466 } | 542 case CompareOperationHint::kNumber: \ |
| 467 | 543 return &cache_.k##Name##NumberOperator; \ |
| 468 const Operator* JSOperatorBuilder::BitwiseXor(BinaryOperationHints hints) { | 544 case CompareOperationHint::kNumberOrOddball: \ |
| 469 // TODO(turbofan): Cache most important versions of this operator. | 545 return &cache_.k##Name##NumberOrOddballOperator; \ |
| 470 return new (zone()) Operator1<BinaryOperationHints>( //-- | 546 case CompareOperationHint::kAny: \ |
| 471 IrOpcode::kJSBitwiseXor, Operator::kNoProperties, // opcode | 547 return &cache_.k##Name##AnyOperator; \ |
| 472 "JSBitwiseXor", // name | 548 } \ |
| 473 2, 1, 1, 1, 1, 2, // inputs/outputs | 549 UNREACHABLE(); \ |
| 474 hints); // parameter | 550 return nullptr; \ |
| 475 } | 551 } |
| 476 | 552 COMPARE_OP_LIST(COMPARE_OP) |
| 477 const Operator* JSOperatorBuilder::BitwiseAnd(BinaryOperationHints hints) { | 553 #undef COMPARE_OP |
| 478 // TODO(turbofan): Cache most important versions of this operator. | |
| 479 return new (zone()) Operator1<BinaryOperationHints>( //-- | |
| 480 IrOpcode::kJSBitwiseAnd, Operator::kNoProperties, // opcode | |
| 481 "JSBitwiseAnd", // name | |
| 482 2, 1, 1, 1, 1, 2, // inputs/outputs | |
| 483 hints); // parameter | |
| 484 } | |
| 485 | |
| 486 const Operator* JSOperatorBuilder::ShiftLeft(BinaryOperationHints hints) { | |
| 487 // TODO(turbofan): Cache most important versions of this operator. | |
| 488 return new (zone()) Operator1<BinaryOperationHints>( //-- | |
| 489 IrOpcode::kJSShiftLeft, Operator::kNoProperties, // opcode | |
| 490 "JSShiftLeft", // name | |
| 491 2, 1, 1, 1, 1, 2, // inputs/outputs | |
| 492 hints); // parameter | |
| 493 } | |
| 494 | |
| 495 const Operator* JSOperatorBuilder::ShiftRight(BinaryOperationHints hints) { | |
| 496 // TODO(turbofan): Cache most important versions of this operator. | |
| 497 return new (zone()) Operator1<BinaryOperationHints>( //-- | |
| 498 IrOpcode::kJSShiftRight, Operator::kNoProperties, // opcode | |
| 499 "JSShiftRight", // name | |
| 500 2, 1, 1, 1, 1, 2, // inputs/outputs | |
| 501 hints); // parameter | |
| 502 } | |
| 503 | |
| 504 const Operator* JSOperatorBuilder::ShiftRightLogical( | |
| 505 BinaryOperationHints hints) { | |
| 506 // TODO(turbofan): Cache most important versions of this operator. | |
| 507 return new (zone()) Operator1<BinaryOperationHints>( //-- | |
| 508 IrOpcode::kJSShiftRightLogical, Operator::kNoProperties, // opcode | |
| 509 "JSShiftRightLogical", // name | |
| 510 2, 1, 1, 1, 1, 2, // inputs/outputs | |
| 511 hints); // parameter | |
| 512 } | |
| 513 | |
| 514 const Operator* JSOperatorBuilder::Add(BinaryOperationHints hints) { | |
| 515 // TODO(turbofan): Cache most important versions of this operator. | |
| 516 return new (zone()) Operator1<BinaryOperationHints>( //-- | |
| 517 IrOpcode::kJSAdd, Operator::kNoProperties, // opcode | |
| 518 "JSAdd", // name | |
| 519 2, 1, 1, 1, 1, 2, // inputs/outputs | |
| 520 hints); // parameter | |
| 521 } | |
| 522 | |
| 523 const Operator* JSOperatorBuilder::Subtract(BinaryOperationHints hints) { | |
| 524 // TODO(turbofan): Cache most important versions of this operator. | |
| 525 return new (zone()) Operator1<BinaryOperationHints>( //-- | |
| 526 IrOpcode::kJSSubtract, Operator::kNoProperties, // opcode | |
| 527 "JSSubtract", // name | |
| 528 2, 1, 1, 1, 1, 2, // inputs/outputs | |
| 529 hints); // parameter | |
| 530 } | |
| 531 | |
| 532 const Operator* JSOperatorBuilder::Multiply(BinaryOperationHints hints) { | |
| 533 // TODO(turbofan): Cache most important versions of this operator. | |
| 534 return new (zone()) Operator1<BinaryOperationHints>( //-- | |
| 535 IrOpcode::kJSMultiply, Operator::kNoProperties, // opcode | |
| 536 "JSMultiply", // name | |
| 537 2, 1, 1, 1, 1, 2, // inputs/outputs | |
| 538 hints); // parameter | |
| 539 } | |
| 540 | |
| 541 const Operator* JSOperatorBuilder::Divide(BinaryOperationHints hints) { | |
| 542 // TODO(turbofan): Cache most important versions of this operator. | |
| 543 return new (zone()) Operator1<BinaryOperationHints>( //-- | |
| 544 IrOpcode::kJSDivide, Operator::kNoProperties, // opcode | |
| 545 "JSDivide", // name | |
| 546 2, 1, 1, 1, 1, 2, // inputs/outputs | |
| 547 hints); // parameter | |
| 548 } | |
| 549 | |
| 550 const Operator* JSOperatorBuilder::Modulus(BinaryOperationHints hints) { | |
| 551 // TODO(turbofan): Cache most important versions of this operator. | |
| 552 return new (zone()) Operator1<BinaryOperationHints>( //-- | |
| 553 IrOpcode::kJSModulus, Operator::kNoProperties, // opcode | |
| 554 "JSModulus", // name | |
| 555 2, 1, 1, 1, 1, 2, // inputs/outputs | |
| 556 hints); // parameter | |
| 557 } | |
| 558 | |
| 559 const Operator* JSOperatorBuilder::Equal(CompareOperationHints hints) { | |
| 560 // TODO(turbofan): Cache most important versions of this operator. | |
| 561 return new (zone()) Operator1<CompareOperationHints>( //-- | |
| 562 IrOpcode::kJSEqual, Operator::kNoProperties, // opcode | |
| 563 "JSEqual", // name | |
| 564 2, 1, 1, 1, 1, 2, // inputs/outputs | |
| 565 hints); // parameter | |
| 566 } | |
| 567 | |
| 568 const Operator* JSOperatorBuilder::NotEqual(CompareOperationHints hints) { | |
| 569 // TODO(turbofan): Cache most important versions of this operator. | |
| 570 return new (zone()) Operator1<CompareOperationHints>( //-- | |
| 571 IrOpcode::kJSNotEqual, Operator::kNoProperties, // opcode | |
| 572 "JSNotEqual", // name | |
| 573 2, 1, 1, 1, 1, 2, // inputs/outputs | |
| 574 hints); // parameter | |
| 575 } | |
| 576 | |
| 577 const Operator* JSOperatorBuilder::StrictEqual(CompareOperationHints hints) { | |
| 578 // TODO(turbofan): Cache most important versions of this operator. | |
| 579 return new (zone()) Operator1<CompareOperationHints>( //-- | |
| 580 IrOpcode::kJSStrictEqual, Operator::kPure, // opcode | |
| 581 "JSStrictEqual", // name | |
| 582 2, 1, 1, 1, 1, 0, // inputs/outputs | |
| 583 hints); // parameter | |
| 584 } | |
| 585 | |
| 586 const Operator* JSOperatorBuilder::StrictNotEqual(CompareOperationHints hints) { | |
| 587 // TODO(turbofan): Cache most important versions of this operator. | |
| 588 return new (zone()) Operator1<CompareOperationHints>( //-- | |
| 589 IrOpcode::kJSStrictNotEqual, Operator::kPure, // opcode | |
| 590 "JSStrictNotEqual", // name | |
| 591 2, 1, 1, 1, 1, 0, // inputs/outputs | |
| 592 hints); // parameter | |
| 593 } | |
| 594 | |
| 595 const Operator* JSOperatorBuilder::LessThan(CompareOperationHints hints) { | |
| 596 // TODO(turbofan): Cache most important versions of this operator. | |
| 597 return new (zone()) Operator1<CompareOperationHints>( //-- | |
| 598 IrOpcode::kJSLessThan, Operator::kNoProperties, // opcode | |
| 599 "JSLessThan", // name | |
| 600 2, 1, 1, 1, 1, 2, // inputs/outputs | |
| 601 hints); // parameter | |
| 602 } | |
| 603 | |
| 604 const Operator* JSOperatorBuilder::GreaterThan(CompareOperationHints hints) { | |
| 605 // TODO(turbofan): Cache most important versions of this operator. | |
| 606 return new (zone()) Operator1<CompareOperationHints>( //-- | |
| 607 IrOpcode::kJSGreaterThan, Operator::kNoProperties, // opcode | |
| 608 "JSGreaterThan", // name | |
| 609 2, 1, 1, 1, 1, 2, // inputs/outputs | |
| 610 hints); // parameter | |
| 611 } | |
| 612 | |
| 613 const Operator* JSOperatorBuilder::LessThanOrEqual( | |
| 614 CompareOperationHints hints) { | |
| 615 // TODO(turbofan): Cache most important versions of this operator. | |
| 616 return new (zone()) Operator1<CompareOperationHints>( //-- | |
| 617 IrOpcode::kJSLessThanOrEqual, Operator::kNoProperties, // opcode | |
| 618 "JSLessThanOrEqual", // name | |
| 619 2, 1, 1, 1, 1, 2, // inputs/outputs | |
| 620 hints); // parameter | |
| 621 } | |
| 622 | |
| 623 const Operator* JSOperatorBuilder::GreaterThanOrEqual( | |
| 624 CompareOperationHints hints) { | |
| 625 // TODO(turbofan): Cache most important versions of this operator. | |
| 626 return new (zone()) Operator1<CompareOperationHints>( //-- | |
| 627 IrOpcode::kJSGreaterThanOrEqual, Operator::kNoProperties, // opcode | |
| 628 "JSGreaterThanOrEqual", // name | |
| 629 2, 1, 1, 1, 1, 2, // inputs/outputs | |
| 630 hints); // parameter | |
| 631 } | |
| 632 | 554 |
| 633 const Operator* JSOperatorBuilder::ToBoolean(ToBooleanHints hints) { | 555 const Operator* JSOperatorBuilder::ToBoolean(ToBooleanHints hints) { |
| 634 // TODO(turbofan): Cache most important versions of this operator. | 556 // TODO(turbofan): Cache most important versions of this operator. |
| 635 return new (zone()) Operator1<ToBooleanHints>( //-- | 557 return new (zone()) Operator1<ToBooleanHints>( //-- |
| 636 IrOpcode::kJSToBoolean, Operator::kPure, // opcode | 558 IrOpcode::kJSToBoolean, Operator::kPure, // opcode |
| 637 "JSToBoolean", // name | 559 "JSToBoolean", // name |
| 638 1, 0, 0, 1, 0, 0, // inputs/outputs | 560 1, 0, 0, 1, 0, 0, // inputs/outputs |
| 639 hints); // parameter | 561 hints); // parameter |
| 640 } | 562 } |
| 641 | 563 |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 915 return new (zone()) Operator1<Handle<ScopeInfo>>( // -- | 837 return new (zone()) Operator1<Handle<ScopeInfo>>( // -- |
| 916 IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode | 838 IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode |
| 917 "JSCreateScriptContext", // name | 839 "JSCreateScriptContext", // name |
| 918 1, 1, 1, 1, 1, 2, // counts | 840 1, 1, 1, 1, 1, 2, // counts |
| 919 scpope_info); // parameter | 841 scpope_info); // parameter |
| 920 } | 842 } |
| 921 | 843 |
| 922 } // namespace compiler | 844 } // namespace compiler |
| 923 } // namespace internal | 845 } // namespace internal |
| 924 } // namespace v8 | 846 } // namespace v8 |
| OLD | NEW |