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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 : cgen_(cgen), | 45 : cgen_(cgen), |
46 masm_(cgen->masm()), | 46 masm_(cgen->masm()), |
47 elements_(0), | 47 elements_(0), |
48 parameter_count_(cgen->scope()->num_parameters()), | 48 parameter_count_(cgen->scope()->num_parameters()), |
49 local_count_(0), | 49 local_count_(0), |
50 stack_pointer_(parameter_count_), // 0-based index of TOS. | 50 stack_pointer_(parameter_count_), // 0-based index of TOS. |
51 frame_pointer_(kIllegalIndex) { | 51 frame_pointer_(kIllegalIndex) { |
52 for (int i = 0; i < parameter_count_ + 1; i++) { | 52 for (int i = 0; i < parameter_count_ + 1; i++) { |
53 elements_.Add(FrameElement::MemoryElement()); | 53 elements_.Add(FrameElement::MemoryElement()); |
54 } | 54 } |
| 55 for (int i = 0; i < kNumRegisters; i++) { |
| 56 register_locations_[i] = kIllegalIndex; |
| 57 } |
55 } | 58 } |
56 | 59 |
57 | 60 |
58 // Clear the dirty bit for the element at a given index if it is a | 61 // Clear the dirty bit for the element at a given index if it is a |
59 // valid element. The stack address corresponding to the element must | 62 // valid element. The stack address corresponding to the element must |
60 // be allocated on the physical stack, or the first element above the | 63 // be allocated on the physical stack, or the first element above the |
61 // stack pointer so it can be allocated by a single push instruction. | 64 // stack pointer so it can be allocated by a single push instruction. |
62 void VirtualFrame::RawSyncElementAt(int index) { | 65 void VirtualFrame::RawSyncElementAt(int index) { |
63 FrameElement element = elements_[index]; | 66 FrameElement element = elements_[index]; |
64 | 67 |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 ASSERT(stack_pointer_ == elements_.length() - 1); | 471 ASSERT(stack_pointer_ == elements_.length() - 1); |
469 elements_.Add(FrameElement::MemoryElement()); | 472 elements_.Add(FrameElement::MemoryElement()); |
470 stack_pointer_++; | 473 stack_pointer_++; |
471 __ push(reg); | 474 __ push(reg); |
472 } | 475 } |
473 | 476 |
474 | 477 |
475 #undef __ | 478 #undef __ |
476 | 479 |
477 } } // namespace v8::internal | 480 } } // namespace v8::internal |
OLD | NEW |