| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 void VirtualFrame::PrepareForReturn() { | 76 void VirtualFrame::PrepareForReturn() { |
| 77 // Don't bother flushing tos registers as returning does not require more | 77 // Don't bother flushing tos registers as returning does not require more |
| 78 // access to the expression stack. | 78 // access to the expression stack. |
| 79 top_of_stack_state_ = NO_TOS_REGISTERS; | 79 top_of_stack_state_ = NO_TOS_REGISTERS; |
| 80 } | 80 } |
| 81 | 81 |
| 82 | 82 |
| 83 VirtualFrame::RegisterAllocationScope::RegisterAllocationScope( | 83 VirtualFrame::RegisterAllocationScope::RegisterAllocationScope( |
| 84 CodeGenerator* cgen) | 84 CodeGenerator* cgen) |
| 85 : cgen_(cgen), | 85 : cgen_(cgen), |
| 86 old_is_spilled_(SpilledScope::is_spilled_) { | 86 old_is_spilled_( |
| 87 SpilledScope::is_spilled_ = false; | 87 Isolate::Current()->is_virtual_frame_in_spilled_scope()) { |
| 88 Isolate::Current()->set_is_virtual_frame_in_spilled_scope(false); |
| 88 if (old_is_spilled_) { | 89 if (old_is_spilled_) { |
| 89 VirtualFrame* frame = cgen->frame(); | 90 VirtualFrame* frame = cgen->frame(); |
| 90 if (frame != NULL) { | 91 if (frame != NULL) { |
| 91 frame->AssertIsSpilled(); | 92 frame->AssertIsSpilled(); |
| 92 } | 93 } |
| 93 } | 94 } |
| 94 } | 95 } |
| 95 | 96 |
| 96 | 97 |
| 97 VirtualFrame::RegisterAllocationScope::~RegisterAllocationScope() { | 98 VirtualFrame::RegisterAllocationScope::~RegisterAllocationScope() { |
| 98 SpilledScope::is_spilled_ = old_is_spilled_; | 99 Isolate::Current()->set_is_virtual_frame_in_spilled_scope(old_is_spilled_); |
| 99 if (old_is_spilled_) { | 100 if (old_is_spilled_) { |
| 100 VirtualFrame* frame = cgen_->frame(); | 101 VirtualFrame* frame = cgen_->frame(); |
| 101 if (frame != NULL) { | 102 if (frame != NULL) { |
| 102 frame->SpillAll(); | 103 frame->SpillAll(); |
| 103 } | 104 } |
| 104 } | 105 } |
| 105 } | 106 } |
| 106 | 107 |
| 107 | 108 |
| 108 CodeGenerator* VirtualFrame::cgen() const { | 109 CodeGenerator* VirtualFrame::cgen() const { |
| 109 return CodeGeneratorScope::Current(); | 110 return CodeGeneratorScope::Current(Isolate::Current()); |
| 110 } | 111 } |
| 111 | 112 |
| 112 | 113 |
| 113 MacroAssembler* VirtualFrame::masm() { return cgen()->masm(); } | 114 MacroAssembler* VirtualFrame::masm() { return cgen()->masm(); } |
| 114 | 115 |
| 115 | 116 |
| 116 void VirtualFrame::CallStub(CodeStub* stub, int arg_count) { | 117 void VirtualFrame::CallStub(CodeStub* stub, int arg_count) { |
| 117 if (arg_count != 0) Forget(arg_count); | 118 if (arg_count != 0) Forget(arg_count); |
| 118 ASSERT(cgen()->HasValidEntryRegisters()); | 119 ASSERT(cgen()->HasValidEntryRegisters()); |
| 119 masm()->CallStub(stub); | 120 masm()->CallStub(stub); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 162 |
| 162 MemOperand VirtualFrame::LocalAt(int index) { | 163 MemOperand VirtualFrame::LocalAt(int index) { |
| 163 ASSERT(0 <= index); | 164 ASSERT(0 <= index); |
| 164 ASSERT(index < local_count()); | 165 ASSERT(index < local_count()); |
| 165 return MemOperand(fp, kLocal0Offset - index * kPointerSize); | 166 return MemOperand(fp, kLocal0Offset - index * kPointerSize); |
| 166 } | 167 } |
| 167 | 168 |
| 168 } } // namespace v8::internal | 169 } } // namespace v8::internal |
| 169 | 170 |
| 170 #endif // V8_VIRTUAL_FRAME_LIGHT_INL_H_ | 171 #endif // V8_VIRTUAL_FRAME_LIGHT_INL_H_ |
| OLD | NEW |