OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/code-stub-assembler.h" | 5 #include "src/compiler/code-stub-assembler.h" |
6 | 6 |
7 #include <ostream> | 7 #include <ostream> |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 | 459 |
460 Node* CodeStubAssembler::BitFieldDecode(Node* word32, uint32_t shift, | 460 Node* CodeStubAssembler::BitFieldDecode(Node* word32, uint32_t shift, |
461 uint32_t mask) { | 461 uint32_t mask) { |
462 return raw_assembler_->Word32Shr( | 462 return raw_assembler_->Word32Shr( |
463 raw_assembler_->Word32And(word32, raw_assembler_->Int32Constant(mask)), | 463 raw_assembler_->Word32And(word32, raw_assembler_->Int32Constant(mask)), |
464 raw_assembler_->Int32Constant(shift)); | 464 raw_assembler_->Int32Constant(shift)); |
465 } | 465 } |
466 | 466 |
467 void CodeStubAssembler::BranchIf(Node* condition, Label* if_true, | 467 void CodeStubAssembler::BranchIf(Node* condition, Label* if_true, |
468 Label* if_false) { | 468 Label* if_false) { |
469 Label if_condition_true(this), if_condition_false(this); | 469 Label if_condition_is_true(this), if_condition_is_false(this); |
470 Branch(condition, &if_condition_true, &if_condition_false); | 470 Branch(condition, &if_condition_is_true, &if_condition_is_false); |
471 Bind(&if_condition_true); | 471 Bind(&if_condition_is_true); |
472 Goto(if_true); | 472 Goto(if_true); |
473 Bind(&if_condition_false); | 473 Bind(&if_condition_is_false); |
474 Goto(if_false); | 474 Goto(if_false); |
475 } | 475 } |
476 | 476 |
477 void CodeStubAssembler::BranchIfInt32LessThan(Node* a, Node* b, Label* if_true, | |
478 Label* if_false) { | |
479 Label if_lessthan(this), if_notlessthan(this); | |
480 Branch(Int32LessThan(a, b), &if_lessthan, &if_notlessthan); | |
481 Bind(&if_lessthan); | |
482 Goto(if_true); | |
483 Bind(&if_notlessthan); | |
484 Goto(if_false); | |
485 } | |
486 | |
487 void CodeStubAssembler::BranchIfSmiLessThan(Node* a, Node* b, Label* if_true, | |
488 Label* if_false) { | |
489 Label if_lessthan(this), if_notlessthan(this); | |
490 Branch(SmiLessThan(a, b), &if_lessthan, &if_notlessthan); | |
491 Bind(&if_lessthan); | |
492 Goto(if_true); | |
493 Bind(&if_notlessthan); | |
494 Goto(if_false); | |
495 } | |
496 | |
497 void CodeStubAssembler::BranchIfSmiLessThanOrEqual(Node* a, Node* b, | |
498 Label* if_true, | |
499 Label* if_false) { | |
500 Label if_lessthanorequal(this), if_notlessthanorequal(this); | |
501 Branch(SmiLessThanOrEqual(a, b), &if_lessthanorequal, &if_notlessthanorequal); | |
502 Bind(&if_lessthanorequal); | |
503 Goto(if_true); | |
504 Bind(&if_notlessthanorequal); | |
505 Goto(if_false); | |
506 } | |
507 | |
508 void CodeStubAssembler::BranchIfFloat64Equal(Node* a, Node* b, Label* if_true, | |
509 Label* if_false) { | |
510 Label if_equal(this), if_notequal(this); | |
511 Branch(Float64Equal(a, b), &if_equal, &if_notequal); | |
512 Bind(&if_equal); | |
513 Goto(if_true); | |
514 Bind(&if_notequal); | |
515 Goto(if_false); | |
516 } | |
517 | |
518 void CodeStubAssembler::BranchIfFloat64LessThan(Node* a, Node* b, | |
519 Label* if_true, | |
520 Label* if_false) { | |
521 Label if_lessthan(this), if_notlessthan(this); | |
522 Branch(Float64LessThan(a, b), &if_lessthan, &if_notlessthan); | |
523 Bind(&if_lessthan); | |
524 Goto(if_true); | |
525 Bind(&if_notlessthan); | |
526 Goto(if_false); | |
527 } | |
528 | |
529 void CodeStubAssembler::BranchIfFloat64LessThanOrEqual(Node* a, Node* b, | |
530 Label* if_true, | |
531 Label* if_false) { | |
532 Label if_lessthanorequal(this), if_notlessthanorequal(this); | |
533 Branch(Float64LessThanOrEqual(a, b), &if_lessthanorequal, | |
534 &if_notlessthanorequal); | |
535 Bind(&if_lessthanorequal); | |
536 Goto(if_true); | |
537 Bind(&if_notlessthanorequal); | |
538 Goto(if_false); | |
539 } | |
540 | |
541 void CodeStubAssembler::BranchIfFloat64GreaterThan(Node* a, Node* b, | |
542 Label* if_true, | |
543 Label* if_false) { | |
544 Label if_greaterthan(this), if_notgreaterthan(this); | |
545 Branch(Float64GreaterThan(a, b), &if_greaterthan, &if_notgreaterthan); | |
546 Bind(&if_greaterthan); | |
547 Goto(if_true); | |
548 Bind(&if_notgreaterthan); | |
549 Goto(if_false); | |
550 } | |
551 | |
552 void CodeStubAssembler::BranchIfFloat64GreaterThanOrEqual(Node* a, Node* b, | |
553 Label* if_true, | |
554 Label* if_false) { | |
555 Label if_greaterthanorequal(this), if_notgreaterthanorequal(this); | |
556 Branch(Float64GreaterThanOrEqual(a, b), &if_greaterthanorequal, | |
557 &if_notgreaterthanorequal); | |
558 Bind(&if_greaterthanorequal); | |
559 Goto(if_true); | |
560 Bind(&if_notgreaterthanorequal); | |
561 Goto(if_false); | |
562 } | |
563 | |
564 void CodeStubAssembler::BranchIfWord32Equal(Node* a, Node* b, Label* if_true, | |
565 Label* if_false) { | |
566 Label if_equal(this), if_notequal(this); | |
567 Branch(Word32Equal(a, b), &if_equal, &if_notequal); | |
568 Bind(&if_equal); | |
569 Goto(if_true); | |
570 Bind(&if_notequal); | |
571 Goto(if_false); | |
572 } | |
573 | |
574 Node* CodeStubAssembler::CallN(CallDescriptor* descriptor, Node* code_target, | 477 Node* CodeStubAssembler::CallN(CallDescriptor* descriptor, Node* code_target, |
575 Node** args) { | 478 Node** args) { |
576 CallPrologue(); | 479 CallPrologue(); |
577 Node* return_value = raw_assembler_->CallN(descriptor, code_target, args); | 480 Node* return_value = raw_assembler_->CallN(descriptor, code_target, args); |
578 CallEpilogue(); | 481 CallEpilogue(); |
579 return return_value; | 482 return return_value; |
580 } | 483 } |
581 | 484 |
582 | 485 |
583 Node* CodeStubAssembler::TailCallN(CallDescriptor* descriptor, | 486 Node* CodeStubAssembler::TailCallN(CallDescriptor* descriptor, |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
972 } | 875 } |
973 } | 876 } |
974 } | 877 } |
975 | 878 |
976 bound_ = true; | 879 bound_ = true; |
977 } | 880 } |
978 | 881 |
979 } // namespace compiler | 882 } // namespace compiler |
980 } // namespace internal | 883 } // namespace internal |
981 } // namespace v8 | 884 } // namespace v8 |
OLD | NEW |