| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 data_.reg_ = reg; | 66 data_.reg_ = reg; |
| 67 type_ = REGISTER; | 67 type_ = REGISTER; |
| 68 } | 68 } |
| 69 ASSERT(is_register()); | 69 ASSERT(is_register()); |
| 70 } | 70 } |
| 71 | 71 |
| 72 | 72 |
| 73 // ------------------------------------------------------------------------- | 73 // ------------------------------------------------------------------------- |
| 74 // VirtualFrame implementation. | 74 // VirtualFrame implementation. |
| 75 | 75 |
| 76 VirtualFrame::SpilledScope::SpilledScope(CodeGenerator* cgen) |
| 77 : cgen_(cgen), |
| 78 previous_state_(cgen->in_spilled_code()) { |
| 79 ASSERT(cgen->frame() != NULL); |
| 80 cgen->frame()->SpillAll(); |
| 81 cgen->set_in_spilled_code(true); |
| 82 } |
| 83 |
| 84 |
| 85 VirtualFrame::SpilledScope::~SpilledScope() { |
| 86 cgen_->set_in_spilled_code(previous_state_); |
| 87 } |
| 88 |
| 89 |
| 76 // On entry to a function, the virtual frame already contains the receiver, | 90 // On entry to a function, the virtual frame already contains the receiver, |
| 77 // the parameters, and a return address. All frame elements are in memory. | 91 // the parameters, and a return address. All frame elements are in memory. |
| 78 VirtualFrame::VirtualFrame(CodeGenerator* cgen) | 92 VirtualFrame::VirtualFrame(CodeGenerator* cgen) |
| 79 : cgen_(cgen), | 93 : cgen_(cgen), |
| 80 masm_(cgen->masm()), | 94 masm_(cgen->masm()), |
| 81 elements_(0), | 95 elements_(0), |
| 82 parameter_count_(cgen->scope()->num_parameters()), | 96 parameter_count_(cgen->scope()->num_parameters()), |
| 83 local_count_(0), | 97 local_count_(0), |
| 84 stack_pointer_(parameter_count_ + 1), // 0-based index of TOS. | 98 stack_pointer_(parameter_count_ + 1), // 0-based index of TOS. |
| 85 frame_pointer_(kIllegalIndex) { | 99 frame_pointer_(kIllegalIndex) { |
| (...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 910 return false; | 924 return false; |
| 911 } | 925 } |
| 912 } | 926 } |
| 913 return true; | 927 return true; |
| 914 } | 928 } |
| 915 #endif | 929 #endif |
| 916 | 930 |
| 917 #undef __ | 931 #undef __ |
| 918 | 932 |
| 919 } } // namespace v8::internal | 933 } } // namespace v8::internal |
| OLD | NEW |