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