| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 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 | 200 |
| 201 frame_pointer_ = kIllegalIndex; | 201 frame_pointer_ = kIllegalIndex; |
| 202 EmitPop(ebp); | 202 EmitPop(ebp); |
| 203 } | 203 } |
| 204 | 204 |
| 205 | 205 |
| 206 void VirtualFrame::AllocateStackSlots(int count) { | 206 void VirtualFrame::AllocateStackSlots(int count) { |
| 207 ASSERT(height() == 0); | 207 ASSERT(height() == 0); |
| 208 local_count_ = count; | 208 local_count_ = count; |
| 209 for (int i = 0; i < count; i++) { | 209 |
| 210 elements_.Add(FrameElement(Factory::undefined_value())); | 210 if (count > 0) { |
| 211 Comment cmnt(masm_, "[ Allocate space for locals"); |
| 212 // The locals are constants (the undefined value), but we sync them with |
| 213 // the actual frame to allocate space for spilling them. |
| 214 FrameElement initial_value(Factory::undefined_value()); |
| 215 initial_value.clear_dirty(); |
| 216 __ Set(eax, Immediate(Factory::undefined_value())); |
| 217 for (int i = 0; i < count; i++) { |
| 218 elements_.Add(initial_value); |
| 219 stack_pointer_++; |
| 220 __ push(eax); |
| 221 } |
| 211 } | 222 } |
| 212 } | 223 } |
| 213 | 224 |
| 214 | 225 |
| 215 void VirtualFrame::PushTryHandler(HandlerType type) { | 226 void VirtualFrame::PushTryHandler(HandlerType type) { |
| 216 // Grow the expression stack by handler size less two (the return address | 227 // Grow the expression stack by handler size less two (the return address |
| 217 // is already pushed by a call instruction, and PushTryHandler from the | 228 // is already pushed by a call instruction, and PushTryHandler from the |
| 218 // macro assembler will leave the top of stack in the eax register to be | 229 // macro assembler will leave the top of stack in the eax register to be |
| 219 // pushed separately). | 230 // pushed separately). |
| 220 Adjust(kHandlerSize - 2); | 231 Adjust(kHandlerSize - 2); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 ASSERT(stack_pointer_ == elements_.length() - 1); | 324 ASSERT(stack_pointer_ == elements_.length() - 1); |
| 314 elements_.Add(FrameElement()); | 325 elements_.Add(FrameElement()); |
| 315 stack_pointer_++; | 326 stack_pointer_++; |
| 316 __ push(immediate); | 327 __ push(immediate); |
| 317 } | 328 } |
| 318 | 329 |
| 319 | 330 |
| 320 #undef __ | 331 #undef __ |
| 321 | 332 |
| 322 } } // namespace v8::internal | 333 } } // namespace v8::internal |
| OLD | NEW |