| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 | 199 |
| 200 void VirtualFrame::EmitPush(Handle<Object> value) { | 200 void VirtualFrame::EmitPush(Handle<Object> value) { |
| 201 ASSERT(stack_pointer_ == element_count() - 1); | 201 ASSERT(stack_pointer_ == element_count() - 1); |
| 202 elements_.Add(FrameElement::MemoryElement()); | 202 elements_.Add(FrameElement::MemoryElement()); |
| 203 stack_pointer_++; | 203 stack_pointer_++; |
| 204 __ Push(value); | 204 __ Push(value); |
| 205 } | 205 } |
| 206 | 206 |
| 207 | 207 |
| 208 void VirtualFrame::Drop(int count) { | 208 void VirtualFrame::Drop(int count) { |
| 209 ASSERT(count >= 0); |
| 209 ASSERT(height() >= count); | 210 ASSERT(height() >= count); |
| 210 int num_virtual_elements = (element_count() - 1) - stack_pointer_; | 211 int num_virtual_elements = (element_count() - 1) - stack_pointer_; |
| 211 | 212 |
| 212 // Emit code to lower the stack pointer if necessary. | 213 // Emit code to lower the stack pointer if necessary. |
| 213 if (num_virtual_elements < count) { | 214 if (num_virtual_elements < count) { |
| 214 int num_dropped = count - num_virtual_elements; | 215 int num_dropped = count - num_virtual_elements; |
| 215 stack_pointer_ -= num_dropped; | 216 stack_pointer_ -= num_dropped; |
| 216 __ addq(rsp, Immediate(num_dropped * kPointerSize)); | 217 __ addq(rsp, Immediate(num_dropped * kPointerSize)); |
| 217 } | 218 } |
| 218 | 219 |
| (...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1043 // Grow the expression stack by handler size less one (the return | 1044 // Grow the expression stack by handler size less one (the return |
| 1044 // address is already pushed by a call instruction). | 1045 // address is already pushed by a call instruction). |
| 1045 Adjust(kHandlerSize - 1); | 1046 Adjust(kHandlerSize - 1); |
| 1046 __ PushTryHandler(IN_JAVASCRIPT, type); | 1047 __ PushTryHandler(IN_JAVASCRIPT, type); |
| 1047 } | 1048 } |
| 1048 | 1049 |
| 1049 | 1050 |
| 1050 #undef __ | 1051 #undef __ |
| 1051 | 1052 |
| 1052 } } // namespace v8::internal | 1053 } } // namespace v8::internal |
| OLD | NEW |