| 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 29 matching lines...) Expand all Loading... |
| 40 #define __ ACCESS_MASM(masm()) | 40 #define __ ACCESS_MASM(masm()) |
| 41 | 41 |
| 42 | 42 |
| 43 // On entry to a function, the virtual frame already contains the | 43 // On entry to a function, the virtual frame already contains the |
| 44 // receiver and the parameters. All initial frame elements are in | 44 // receiver and the parameters. All initial frame elements are in |
| 45 // memory. | 45 // memory. |
| 46 VirtualFrame::VirtualFrame() | 46 VirtualFrame::VirtualFrame() |
| 47 : elements_(parameter_count() + local_count() + kPreallocatedElements), | 47 : elements_(parameter_count() + local_count() + kPreallocatedElements), |
| 48 stack_pointer_(parameter_count()) { // 0-based index of TOS. | 48 stack_pointer_(parameter_count()) { // 0-based index of TOS. |
| 49 for (int i = 0; i <= stack_pointer_; i++) { | 49 for (int i = 0; i <= stack_pointer_; i++) { |
| 50 elements_.Add(FrameElement::MemoryElement()); | 50 elements_.Add(FrameElement::MemoryElement(NumberInfo::kUnknown)); |
| 51 } | 51 } |
| 52 for (int i = 0; i < RegisterAllocator::kNumRegisters; i++) { | 52 for (int i = 0; i < RegisterAllocator::kNumRegisters; i++) { |
| 53 register_locations_[i] = kIllegalIndex; | 53 register_locations_[i] = kIllegalIndex; |
| 54 } | 54 } |
| 55 } | 55 } |
| 56 | 56 |
| 57 | 57 |
| 58 void VirtualFrame::SyncElementBelowStackPointer(int index) { | 58 void VirtualFrame::SyncElementBelowStackPointer(int index) { |
| 59 UNREACHABLE(); | 59 UNREACHABLE(); |
| 60 } | 60 } |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 } | 226 } |
| 227 | 227 |
| 228 | 228 |
| 229 void VirtualFrame::CallRuntime(Runtime::FunctionId id, int arg_count) { | 229 void VirtualFrame::CallRuntime(Runtime::FunctionId id, int arg_count) { |
| 230 Forget(arg_count); | 230 Forget(arg_count); |
| 231 ASSERT(cgen()->HasValidEntryRegisters()); | 231 ASSERT(cgen()->HasValidEntryRegisters()); |
| 232 __ CallRuntime(id, arg_count); | 232 __ CallRuntime(id, arg_count); |
| 233 } | 233 } |
| 234 | 234 |
| 235 | 235 |
| 236 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 237 void VirtualFrame::DebugBreak() { |
| 238 ASSERT(cgen()->HasValidEntryRegisters()); |
| 239 __ DebugBreak(); |
| 240 } |
| 241 #endif |
| 242 |
| 243 |
| 236 void VirtualFrame::InvokeBuiltin(Builtins::JavaScript id, | 244 void VirtualFrame::InvokeBuiltin(Builtins::JavaScript id, |
| 237 InvokeJSFlags flags, | 245 InvokeJSFlags flags, |
| 238 int arg_count) { | 246 int arg_count) { |
| 239 Forget(arg_count); | 247 Forget(arg_count); |
| 240 __ InvokeBuiltin(id, flags); | 248 __ InvokeBuiltin(id, flags); |
| 241 } | 249 } |
| 242 | 250 |
| 243 | 251 |
| 244 void VirtualFrame::CallCodeObject(Handle<Code> code, | 252 void VirtualFrame::CallCodeObject(Handle<Code> code, |
| 245 RelocInfo::Mode rmode, | 253 RelocInfo::Mode rmode, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 void VirtualFrame::EmitPop(Register reg) { | 306 void VirtualFrame::EmitPop(Register reg) { |
| 299 ASSERT(stack_pointer_ == element_count() - 1); | 307 ASSERT(stack_pointer_ == element_count() - 1); |
| 300 stack_pointer_--; | 308 stack_pointer_--; |
| 301 elements_.RemoveLast(); | 309 elements_.RemoveLast(); |
| 302 __ pop(reg); | 310 __ pop(reg); |
| 303 } | 311 } |
| 304 | 312 |
| 305 | 313 |
| 306 void VirtualFrame::EmitPush(Register reg) { | 314 void VirtualFrame::EmitPush(Register reg) { |
| 307 ASSERT(stack_pointer_ == element_count() - 1); | 315 ASSERT(stack_pointer_ == element_count() - 1); |
| 308 elements_.Add(FrameElement::MemoryElement()); | 316 elements_.Add(FrameElement::MemoryElement(NumberInfo::kUnknown)); |
| 309 stack_pointer_++; | 317 stack_pointer_++; |
| 310 __ push(reg); | 318 __ push(reg); |
| 311 } | 319 } |
| 312 | 320 |
| 313 | 321 |
| 314 void VirtualFrame::EmitPushMultiple(int count, int src_regs) { | 322 void VirtualFrame::EmitPushMultiple(int count, int src_regs) { |
| 315 ASSERT(stack_pointer_ == element_count() - 1); | 323 ASSERT(stack_pointer_ == element_count() - 1); |
| 316 Adjust(count); | 324 Adjust(count); |
| 317 __ stm(db_w, sp, src_regs); | 325 __ stm(db_w, sp, src_regs); |
| 318 } | 326 } |
| 319 | 327 |
| 320 | 328 |
| 321 #undef __ | 329 #undef __ |
| 322 | 330 |
| 323 } } // namespace v8::internal | 331 } } // namespace v8::internal |
| OLD | NEW |