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 17 matching lines...) Expand all Loading... |
28 #include "v8.h" | 28 #include "v8.h" |
29 | 29 |
30 #include "codegen-inl.h" | 30 #include "codegen-inl.h" |
31 #include "register-allocator-inl.h" | 31 #include "register-allocator-inl.h" |
32 #include "scopes.h" | 32 #include "scopes.h" |
33 #include "virtual-frame-inl.h" | 33 #include "virtual-frame-inl.h" |
34 | 34 |
35 namespace v8 { | 35 namespace v8 { |
36 namespace internal { | 36 namespace internal { |
37 | 37 |
38 // ------------------------------------------------------------------------- | |
39 // VirtualFrame implementation. | |
40 | |
41 #define __ ACCESS_MASM(masm()) | 38 #define __ ACCESS_MASM(masm()) |
42 | 39 |
43 | |
44 // On entry to a function, the virtual frame already contains the | |
45 // receiver and the parameters. All initial frame elements are in | |
46 // memory. | |
47 VirtualFrame::VirtualFrame() | |
48 : elements_(parameter_count() + local_count() + kPreallocatedElements), | |
49 stack_pointer_(parameter_count()) { // 0-based index of TOS. | |
50 for (int i = 0; i <= stack_pointer_; i++) { | |
51 elements_.Add(FrameElement::MemoryElement(NumberInfo::kUnknown)); | |
52 } | |
53 for (int i = 0; i < RegisterAllocator::kNumRegisters; i++) { | |
54 register_locations_[i] = kIllegalIndex; | |
55 } | |
56 } | |
57 | |
58 | |
59 void VirtualFrame::SyncElementBelowStackPointer(int index) { | 40 void VirtualFrame::SyncElementBelowStackPointer(int index) { |
60 UNREACHABLE(); | 41 UNREACHABLE(); |
61 } | 42 } |
62 | 43 |
63 | 44 |
64 void VirtualFrame::SyncElementByPushing(int index) { | 45 void VirtualFrame::SyncElementByPushing(int index) { |
65 UNREACHABLE(); | 46 UNREACHABLE(); |
66 } | 47 } |
67 | 48 |
68 | 49 |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 void VirtualFrame::EmitPushMultiple(int count, int src_regs) { | 304 void VirtualFrame::EmitPushMultiple(int count, int src_regs) { |
324 ASSERT(stack_pointer_ == element_count() - 1); | 305 ASSERT(stack_pointer_ == element_count() - 1); |
325 Adjust(count); | 306 Adjust(count); |
326 __ stm(db_w, sp, src_regs); | 307 __ stm(db_w, sp, src_regs); |
327 } | 308 } |
328 | 309 |
329 | 310 |
330 #undef __ | 311 #undef __ |
331 | 312 |
332 } } // namespace v8::internal | 313 } } // namespace v8::internal |
OLD | NEW |