OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 1998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2009 } | 2009 } |
2010 } | 2010 } |
2011 // Discard the i'th entry pushed above or else the remainder of the | 2011 // Discard the i'th entry pushed above or else the remainder of the |
2012 // reference, whichever is currently on top of the stack. | 2012 // reference, whichever is currently on top of the stack. |
2013 frame_->Drop(); | 2013 frame_->Drop(); |
2014 | 2014 |
2015 // Body. | 2015 // Body. |
2016 CheckStack(); // TODO(1222600): ignore if body contains calls. | 2016 CheckStack(); // TODO(1222600): ignore if body contains calls. |
2017 VisitAndSpill(node->body()); | 2017 VisitAndSpill(node->body()); |
2018 | 2018 |
2019 // Next. | 2019 // Next. Reestablish a spilled frame in case we are coming here via |
| 2020 // a continue in the body. |
2020 node->continue_target()->Bind(); | 2021 node->continue_target()->Bind(); |
| 2022 frame_->SpillAll(); |
2021 frame_->EmitPop(r0); | 2023 frame_->EmitPop(r0); |
2022 __ add(r0, r0, Operand(Smi::FromInt(1))); | 2024 __ add(r0, r0, Operand(Smi::FromInt(1))); |
2023 frame_->EmitPush(r0); | 2025 frame_->EmitPush(r0); |
2024 entry.Jump(); | 2026 entry.Jump(); |
2025 | 2027 |
2026 // Cleanup. | 2028 // Cleanup. No need to spill because VirtualFrame::Drop is safe for |
| 2029 // any frame. |
2027 node->break_target()->Bind(); | 2030 node->break_target()->Bind(); |
2028 frame_->Drop(5); | 2031 frame_->Drop(5); |
2029 | 2032 |
2030 // Exit. | 2033 // Exit. |
2031 exit.Bind(); | 2034 exit.Bind(); |
2032 node->continue_target()->Unuse(); | 2035 node->continue_target()->Unuse(); |
2033 node->break_target()->Unuse(); | 2036 node->break_target()->Unuse(); |
2034 ASSERT(frame_->height() == original_height); | 2037 ASSERT(frame_->height() == original_height); |
2035 } | 2038 } |
2036 | 2039 |
(...skipping 3180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5217 __ mov(r2, Operand(0)); | 5220 __ mov(r2, Operand(0)); |
5218 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); | 5221 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); |
5219 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)), | 5222 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)), |
5220 RelocInfo::CODE_TARGET); | 5223 RelocInfo::CODE_TARGET); |
5221 } | 5224 } |
5222 | 5225 |
5223 | 5226 |
5224 #undef __ | 5227 #undef __ |
5225 | 5228 |
5226 } } // namespace v8::internal | 5229 } } // namespace v8::internal |
OLD | NEW |