OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 virtual void GenerateBodyInstructionPre(LInstruction* instr) {} | 61 virtual void GenerateBodyInstructionPre(LInstruction* instr) {} |
62 virtual void GenerateBodyInstructionPost(LInstruction* instr) {} | 62 virtual void GenerateBodyInstructionPost(LInstruction* instr) {} |
63 | 63 |
64 virtual void EnsureSpaceForLazyDeopt(int space_needed) = 0; | 64 virtual void EnsureSpaceForLazyDeopt(int space_needed) = 0; |
65 virtual void RecordAndWritePosition(int position) = 0; | 65 virtual void RecordAndWritePosition(int position) = 0; |
66 | 66 |
67 int GetNextEmittedBlock() const; | 67 int GetNextEmittedBlock() const; |
68 | 68 |
69 void RegisterWeakObjectsInOptimizedCode(Handle<Code> code); | 69 void RegisterWeakObjectsInOptimizedCode(Handle<Code> code); |
70 | 70 |
| 71 // Check that an environment assigned via AssignEnvironment is actually being |
| 72 // used. Redundant assignments keep things alive longer than necessary, and |
| 73 // consequently lead to worse code, so it's important to minimize this. |
| 74 void CheckEnvironmentUsage(); |
| 75 |
71 protected: | 76 protected: |
72 enum Status { | 77 enum Status { |
73 UNUSED, | 78 UNUSED, |
74 GENERATING, | 79 GENERATING, |
75 DONE, | 80 DONE, |
76 ABORTED | 81 ABORTED |
77 }; | 82 }; |
78 | 83 |
79 LPlatformChunk* const chunk_; | 84 LPlatformChunk* const chunk_; |
80 MacroAssembler* const masm_; | 85 MacroAssembler* const masm_; |
81 CompilationInfo* const info_; | 86 CompilationInfo* const info_; |
82 Zone* zone_; | 87 Zone* zone_; |
83 Status status_; | 88 Status status_; |
84 int current_block_; | 89 int current_block_; |
85 int current_instruction_; | 90 int current_instruction_; |
86 const ZoneList<LInstruction*>* instructions_; | 91 const ZoneList<LInstruction*>* instructions_; |
87 int last_lazy_deopt_pc_; | 92 int last_lazy_deopt_pc_; |
88 | 93 |
89 bool is_unused() const { return status_ == UNUSED; } | 94 bool is_unused() const { return status_ == UNUSED; } |
90 bool is_generating() const { return status_ == GENERATING; } | 95 bool is_generating() const { return status_ == GENERATING; } |
91 bool is_done() const { return status_ == DONE; } | 96 bool is_done() const { return status_ == DONE; } |
92 bool is_aborted() const { return status_ == ABORTED; } | 97 bool is_aborted() const { return status_ == ABORTED; } |
93 }; | 98 }; |
94 | 99 |
95 | 100 |
96 } } // namespace v8::internal | 101 } } // namespace v8::internal |
97 | 102 |
98 #endif // V8_LITHIUM_CODEGEN_H_ | 103 #endif // V8_LITHIUM_CODEGEN_H_ |
OLD | NEW |