| 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 | 32 |
| 33 namespace v8 { namespace internal { | 33 namespace v8 { namespace internal { |
| 34 | 34 |
| 35 // ------------------------------------------------------------------------- | 35 // ------------------------------------------------------------------------- |
| 36 // VirtualFrame implementation. | 36 // VirtualFrame implementation. |
| 37 | 37 |
| 38 VirtualFrame::SpilledScope::SpilledScope(CodeGenerator* cgen) | |
| 39 : cgen_(cgen), | |
| 40 previous_state_(cgen->in_spilled_code()) { | |
| 41 ASSERT(cgen->has_valid_frame()); | |
| 42 cgen->frame()->SpillAll(); | |
| 43 cgen->set_in_spilled_code(true); | |
| 44 } | |
| 45 | |
| 46 | |
| 47 VirtualFrame::SpilledScope::~SpilledScope() { | |
| 48 cgen_->set_in_spilled_code(previous_state_); | |
| 49 } | |
| 50 | |
| 51 | |
| 52 // When cloned, a frame is a deep copy of the original. | 38 // When cloned, a frame is a deep copy of the original. |
| 53 VirtualFrame::VirtualFrame(VirtualFrame* original) | 39 VirtualFrame::VirtualFrame(VirtualFrame* original) |
| 54 : cgen_(original->cgen_), | 40 : cgen_(original->cgen_), |
| 55 masm_(original->masm_), | 41 masm_(original->masm_), |
| 56 elements_(original->elements_.capacity()), | 42 elements_(original->elements_.capacity()), |
| 57 parameter_count_(original->parameter_count_), | 43 parameter_count_(original->parameter_count_), |
| 58 local_count_(original->local_count_), | 44 local_count_(original->local_count_), |
| 59 stack_pointer_(original->stack_pointer_), | 45 stack_pointer_(original->stack_pointer_), |
| 60 frame_pointer_(original->frame_pointer_) { | 46 frame_pointer_(original->frame_pointer_) { |
| 61 // Copy all the elements from the original. | 47 // Copy all the elements from the original. |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 // Specialization of List::ResizeAdd to non-inlined version for FrameElements. | 497 // Specialization of List::ResizeAdd to non-inlined version for FrameElements. |
| 512 // The function ResizeAdd becomes a real function, whose implementation is the | 498 // The function ResizeAdd becomes a real function, whose implementation is the |
| 513 // inlined ResizeAddInternal. | 499 // inlined ResizeAddInternal. |
| 514 template <> | 500 template <> |
| 515 void List<FrameElement, | 501 void List<FrameElement, |
| 516 FreeStoreAllocationPolicy>::ResizeAdd(const FrameElement& element) { | 502 FreeStoreAllocationPolicy>::ResizeAdd(const FrameElement& element) { |
| 517 ResizeAddInternal(element); | 503 ResizeAddInternal(element); |
| 518 } | 504 } |
| 519 | 505 |
| 520 } } // namespace v8::internal | 506 } } // namespace v8::internal |
| OLD | NEW |