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