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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 int pop_count() const { return pop_count_; } | 546 int pop_count() const { return pop_count_; } |
547 int push_count() const { return push_count_; } | 547 int push_count() const { return push_count_; } |
548 | 548 |
549 BailoutId ast_id() const { return ast_id_; } | 549 BailoutId ast_id() const { return ast_id_; } |
550 void set_ast_id(BailoutId id) { ast_id_ = id; } | 550 void set_ast_id(BailoutId id) { ast_id_ = id; } |
551 | 551 |
552 HEnterInlined* entry() const { return entry_; } | 552 HEnterInlined* entry() const { return entry_; } |
553 void set_entry(HEnterInlined* entry) { entry_ = entry; } | 553 void set_entry(HEnterInlined* entry) { entry_ = entry; } |
554 | 554 |
555 int length() const { return values_.length(); } | 555 int length() const { return values_.length(); } |
556 bool is_special_index(int i) const { | |
557 return i >= parameter_count() && i < parameter_count() + specials_count(); | |
558 } | |
559 | 556 |
560 int first_expression_index() const { | 557 int first_expression_index() const { |
561 return parameter_count() + specials_count() + local_count(); | 558 return parameter_count() + specials_count() + local_count(); |
562 } | 559 } |
563 | 560 |
564 int first_local_index() const { | 561 int first_local_index() const { |
565 return parameter_count() + specials_count(); | 562 return parameter_count() + specials_count(); |
566 } | 563 } |
567 | 564 |
568 void Bind(Variable* variable, HValue* value) { | 565 void Bind(Variable* variable, HValue* value) { |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 // Stack-allocated local indices are shifted by the number of parameters. | 664 // Stack-allocated local indices are shifted by the number of parameters. |
668 int IndexFor(Variable* variable) const { | 665 int IndexFor(Variable* variable) const { |
669 ASSERT(variable->IsStackAllocated()); | 666 ASSERT(variable->IsStackAllocated()); |
670 int shift = variable->IsParameter() | 667 int shift = variable->IsParameter() |
671 ? 1 | 668 ? 1 |
672 : parameter_count_ + specials_count_; | 669 : parameter_count_ + specials_count_; |
673 return variable->index() + shift; | 670 return variable->index() + shift; |
674 } | 671 } |
675 | 672 |
676 bool is_local_index(int i) const { | 673 bool is_local_index(int i) const { |
677 return i >= first_local_index() && | 674 return i >= first_local_index() && i < first_expression_index(); |
678 i < first_expression_index(); | 675 } |
| 676 |
| 677 bool is_parameter_index(int i) const { |
| 678 return i >= 0 && i < parameter_count(); |
| 679 } |
| 680 |
| 681 bool is_special_index(int i) const { |
| 682 return i >= parameter_count() && i < parameter_count() + specials_count(); |
679 } | 683 } |
680 | 684 |
681 void PrintTo(StringStream* stream); | 685 void PrintTo(StringStream* stream); |
682 void PrintToStd(); | 686 void PrintToStd(); |
683 | 687 |
684 Zone* zone() const { return zone_; } | 688 Zone* zone() const { return zone_; } |
685 | 689 |
686 private: | 690 private: |
687 HEnvironment(const HEnvironment* other, Zone* zone); | 691 HEnvironment(const HEnvironment* other, Zone* zone); |
688 | 692 |
(...skipping 1608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2297 } | 2301 } |
2298 | 2302 |
2299 private: | 2303 private: |
2300 HGraphBuilder* builder_; | 2304 HGraphBuilder* builder_; |
2301 }; | 2305 }; |
2302 | 2306 |
2303 | 2307 |
2304 } } // namespace v8::internal | 2308 } } // namespace v8::internal |
2305 | 2309 |
2306 #endif // V8_HYDROGEN_H_ | 2310 #endif // V8_HYDROGEN_H_ |
OLD | NEW |