OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 int value_count, | 520 int value_count, |
521 LEnvironment* outer, | 521 LEnvironment* outer, |
522 HEnterInlined* entry, | 522 HEnterInlined* entry, |
523 Zone* zone) | 523 Zone* zone) |
524 : closure_(closure), | 524 : closure_(closure), |
525 frame_type_(frame_type), | 525 frame_type_(frame_type), |
526 arguments_stack_height_(argument_count), | 526 arguments_stack_height_(argument_count), |
527 deoptimization_index_(Safepoint::kNoDeoptimizationIndex), | 527 deoptimization_index_(Safepoint::kNoDeoptimizationIndex), |
528 translation_index_(-1), | 528 translation_index_(-1), |
529 ast_id_(ast_id), | 529 ast_id_(ast_id), |
| 530 translation_size_(value_count), |
530 parameter_count_(parameter_count), | 531 parameter_count_(parameter_count), |
531 pc_offset_(-1), | 532 pc_offset_(-1), |
532 values_(value_count, zone), | 533 values_(value_count, zone), |
533 is_tagged_(value_count, zone), | 534 is_tagged_(value_count, zone), |
534 is_uint32_(value_count, zone), | 535 is_uint32_(value_count, zone), |
535 spilled_registers_(NULL), | 536 spilled_registers_(NULL), |
536 spilled_double_registers_(NULL), | 537 spilled_double_registers_(NULL), |
537 outer_(outer), | 538 outer_(outer), |
538 entry_(entry), | 539 entry_(entry), |
539 zone_(zone) { } | 540 zone_(zone) { } |
540 | 541 |
541 Handle<JSFunction> closure() const { return closure_; } | 542 Handle<JSFunction> closure() const { return closure_; } |
542 FrameType frame_type() const { return frame_type_; } | 543 FrameType frame_type() const { return frame_type_; } |
543 int arguments_stack_height() const { return arguments_stack_height_; } | 544 int arguments_stack_height() const { return arguments_stack_height_; } |
544 int deoptimization_index() const { return deoptimization_index_; } | 545 int deoptimization_index() const { return deoptimization_index_; } |
545 int translation_index() const { return translation_index_; } | 546 int translation_index() const { return translation_index_; } |
546 BailoutId ast_id() const { return ast_id_; } | 547 BailoutId ast_id() const { return ast_id_; } |
| 548 int translation_size() const { return translation_size_; } |
547 int parameter_count() const { return parameter_count_; } | 549 int parameter_count() const { return parameter_count_; } |
548 int pc_offset() const { return pc_offset_; } | 550 int pc_offset() const { return pc_offset_; } |
549 LOperand** spilled_registers() const { return spilled_registers_; } | 551 LOperand** spilled_registers() const { return spilled_registers_; } |
550 LOperand** spilled_double_registers() const { | 552 LOperand** spilled_double_registers() const { |
551 return spilled_double_registers_; | 553 return spilled_double_registers_; |
552 } | 554 } |
553 const ZoneList<LOperand*>* values() const { return &values_; } | 555 const ZoneList<LOperand*>* values() const { return &values_; } |
554 LEnvironment* outer() const { return outer_; } | 556 LEnvironment* outer() const { return outer_; } |
555 HEnterInlined* entry() { return entry_; } | 557 HEnterInlined* entry() { return entry_; } |
| 558 Zone* zone() const { return zone_; } |
556 | 559 |
557 void AddValue(LOperand* operand, | 560 void AddValue(LOperand* operand, |
558 Representation representation, | 561 Representation representation, |
559 bool is_uint32) { | 562 bool is_uint32) { |
560 values_.Add(operand, zone()); | 563 values_.Add(operand, zone()); |
561 if (representation.IsSmiOrTagged()) { | 564 if (representation.IsSmiOrTagged()) { |
562 ASSERT(!is_uint32); | 565 ASSERT(!is_uint32); |
563 is_tagged_.Add(values_.length() - 1); | 566 is_tagged_.Add(values_.length() - 1, zone()); |
564 } | 567 } |
565 | 568 |
566 if (is_uint32) { | 569 if (is_uint32) { |
567 is_uint32_.Add(values_.length() - 1); | 570 is_uint32_.Add(values_.length() - 1, zone()); |
568 } | 571 } |
569 } | 572 } |
570 | 573 |
571 bool HasTaggedValueAt(int index) const { | 574 bool HasTaggedValueAt(int index) const { |
572 return is_tagged_.Contains(index); | 575 return is_tagged_.Contains(index); |
573 } | 576 } |
574 | 577 |
575 bool HasUint32ValueAt(int index) const { | 578 bool HasUint32ValueAt(int index) const { |
576 return is_uint32_.Contains(index); | 579 return is_uint32_.Contains(index); |
577 } | 580 } |
(...skipping 11 matching lines...) Expand all Loading... |
589 } | 592 } |
590 | 593 |
591 void SetSpilledRegisters(LOperand** registers, | 594 void SetSpilledRegisters(LOperand** registers, |
592 LOperand** double_registers) { | 595 LOperand** double_registers) { |
593 spilled_registers_ = registers; | 596 spilled_registers_ = registers; |
594 spilled_double_registers_ = double_registers; | 597 spilled_double_registers_ = double_registers; |
595 } | 598 } |
596 | 599 |
597 void PrintTo(StringStream* stream); | 600 void PrintTo(StringStream* stream); |
598 | 601 |
599 Zone* zone() const { return zone_; } | |
600 | |
601 private: | 602 private: |
602 Handle<JSFunction> closure_; | 603 Handle<JSFunction> closure_; |
603 FrameType frame_type_; | 604 FrameType frame_type_; |
604 int arguments_stack_height_; | 605 int arguments_stack_height_; |
605 int deoptimization_index_; | 606 int deoptimization_index_; |
606 int translation_index_; | 607 int translation_index_; |
607 BailoutId ast_id_; | 608 BailoutId ast_id_; |
| 609 int translation_size_; |
608 int parameter_count_; | 610 int parameter_count_; |
609 int pc_offset_; | 611 int pc_offset_; |
| 612 |
| 613 // Value array: [parameters] [locals] [expression stack] [de-materialized]. |
| 614 // |>--------- translation_size ---------<| |
610 ZoneList<LOperand*> values_; | 615 ZoneList<LOperand*> values_; |
611 BitVector is_tagged_; | 616 GrowableBitVector is_tagged_; |
612 BitVector is_uint32_; | 617 GrowableBitVector is_uint32_; |
613 | 618 |
614 // Allocation index indexed arrays of spill slot operands for registers | 619 // Allocation index indexed arrays of spill slot operands for registers |
615 // that are also in spill slots at an OSR entry. NULL for environments | 620 // that are also in spill slots at an OSR entry. NULL for environments |
616 // that do not correspond to an OSR entry. | 621 // that do not correspond to an OSR entry. |
617 LOperand** spilled_registers_; | 622 LOperand** spilled_registers_; |
618 LOperand** spilled_double_registers_; | 623 LOperand** spilled_double_registers_; |
619 | 624 |
620 LEnvironment* outer_; | 625 LEnvironment* outer_; |
621 HEnterInlined* entry_; | 626 HEnterInlined* entry_; |
622 | |
623 Zone* zone_; | 627 Zone* zone_; |
624 }; | 628 }; |
625 | 629 |
626 | 630 |
627 // Iterates over the non-null, non-constant operands in an environment. | 631 // Iterates over the non-null, non-constant operands in an environment. |
628 class ShallowIterator BASE_EMBEDDED { | 632 class ShallowIterator BASE_EMBEDDED { |
629 public: | 633 public: |
630 explicit ShallowIterator(LEnvironment* env) | 634 explicit ShallowIterator(LEnvironment* env) |
631 : env_(env), | 635 : env_(env), |
632 limit_(env != NULL ? env->values()->length() : 0), | 636 limit_(env != NULL ? env->values()->length() : 0), |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 enum NumberUntagDMode { | 774 enum NumberUntagDMode { |
771 NUMBER_CANDIDATE_IS_SMI, | 775 NUMBER_CANDIDATE_IS_SMI, |
772 NUMBER_CANDIDATE_IS_ANY_TAGGED, | 776 NUMBER_CANDIDATE_IS_ANY_TAGGED, |
773 NUMBER_CANDIDATE_IS_ANY_TAGGED_CONVERT_HOLE | 777 NUMBER_CANDIDATE_IS_ANY_TAGGED_CONVERT_HOLE |
774 }; | 778 }; |
775 | 779 |
776 | 780 |
777 } } // namespace v8::internal | 781 } } // namespace v8::internal |
778 | 782 |
779 #endif // V8_LITHIUM_H_ | 783 #endif // V8_LITHIUM_H_ |
OLD | NEW |