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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 end_ = end; | 161 end_ = end; |
162 for (HSuccessorIterator it(end); !it.Done(); it.Advance()) { | 162 for (HSuccessorIterator it(end); !it.Done(); it.Advance()) { |
163 it.Current()->RegisterPredecessor(this); | 163 it.Current()->RegisterPredecessor(this); |
164 } | 164 } |
165 } | 165 } |
166 | 166 |
167 | 167 |
168 void HBasicBlock::Goto(HBasicBlock* block, FunctionState* state) { | 168 void HBasicBlock::Goto(HBasicBlock* block, FunctionState* state) { |
169 bool drop_extra = state != NULL && | 169 bool drop_extra = state != NULL && |
170 state->inlining_kind() == DROP_EXTRA_ON_RETURN; | 170 state->inlining_kind() == DROP_EXTRA_ON_RETURN; |
171 bool arguments_pushed = state != NULL && state->arguments_pushed(); | |
172 | 171 |
173 if (block->IsInlineReturnTarget()) { | 172 if (block->IsInlineReturnTarget()) { |
174 AddInstruction(new(zone()) HLeaveInlined(arguments_pushed)); | 173 AddInstruction(new(zone()) HLeaveInlined()); |
175 last_environment_ = last_environment()->DiscardInlined(drop_extra); | 174 last_environment_ = last_environment()->DiscardInlined(drop_extra); |
176 } | 175 } |
177 | 176 |
178 AddSimulate(BailoutId::None()); | 177 AddSimulate(BailoutId::None()); |
179 HGoto* instr = new(zone()) HGoto(block); | 178 HGoto* instr = new(zone()) HGoto(block); |
180 Finish(instr); | 179 Finish(instr); |
181 } | 180 } |
182 | 181 |
183 | 182 |
184 void HBasicBlock::AddLeaveInlined(HValue* return_value, | 183 void HBasicBlock::AddLeaveInlined(HValue* return_value, |
185 FunctionState* state) { | 184 FunctionState* state) { |
186 HBasicBlock* target = state->function_return(); | 185 HBasicBlock* target = state->function_return(); |
187 bool drop_extra = state->inlining_kind() == DROP_EXTRA_ON_RETURN; | 186 bool drop_extra = state->inlining_kind() == DROP_EXTRA_ON_RETURN; |
188 bool arguments_pushed = state->arguments_pushed(); | |
189 | 187 |
190 ASSERT(target->IsInlineReturnTarget()); | 188 ASSERT(target->IsInlineReturnTarget()); |
191 ASSERT(return_value != NULL); | 189 ASSERT(return_value != NULL); |
192 AddInstruction(new(zone()) HLeaveInlined(arguments_pushed)); | 190 AddInstruction(new(zone()) HLeaveInlined()); |
193 last_environment_ = last_environment()->DiscardInlined(drop_extra); | 191 last_environment_ = last_environment()->DiscardInlined(drop_extra); |
194 last_environment()->Push(return_value); | 192 last_environment()->Push(return_value); |
195 AddSimulate(BailoutId::None()); | 193 AddSimulate(BailoutId::None()); |
196 HGoto* instr = new(zone()) HGoto(target); | 194 HGoto* instr = new(zone()) HGoto(target); |
197 Finish(instr); | 195 Finish(instr); |
198 } | 196 } |
199 | 197 |
200 | 198 |
201 void HBasicBlock::SetInitialEnvironment(HEnvironment* env) { | 199 void HBasicBlock::SetInitialEnvironment(HEnvironment* env) { |
202 ASSERT(!HasEnvironment()); | 200 ASSERT(!HasEnvironment()); |
(...skipping 9782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9985 } | 9983 } |
9986 } | 9984 } |
9987 | 9985 |
9988 #ifdef DEBUG | 9986 #ifdef DEBUG |
9989 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 9987 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
9990 if (allocator_ != NULL) allocator_->Verify(); | 9988 if (allocator_ != NULL) allocator_->Verify(); |
9991 #endif | 9989 #endif |
9992 } | 9990 } |
9993 | 9991 |
9994 } } // namespace v8::internal | 9992 } } // namespace v8::internal |
OLD | NEW |