| 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 21 matching lines...) Expand all Loading... |
| 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 // When cloned, a frame is a deep copy of the original. | 38 // When cloned, a frame is a deep copy of the original. |
| 39 VirtualFrame::VirtualFrame(VirtualFrame* original) | 39 VirtualFrame::VirtualFrame(VirtualFrame* original) |
| 40 : cgen_(original->cgen_), | 40 : cgen_(original->cgen_), |
| 41 masm_(original->masm_), | 41 masm_(original->masm_), |
| 42 elements_(original->elements_.capacity()), | 42 elements_(original->elements_), |
| 43 parameter_count_(original->parameter_count_), | 43 parameter_count_(original->parameter_count_), |
| 44 local_count_(original->local_count_), | 44 local_count_(original->local_count_), |
| 45 stack_pointer_(original->stack_pointer_), | 45 stack_pointer_(original->stack_pointer_), |
| 46 frame_pointer_(original->frame_pointer_) { | 46 frame_pointer_(original->frame_pointer_) { |
| 47 // Copy all the elements from the original. | 47 // Copy register locations from original. |
| 48 for (int i = 0; i < original->elements_.length(); i++) { | 48 memcpy(®ister_locations_, |
| 49 elements_.Add(original->elements_[i]); | 49 original->register_locations_, |
| 50 } | 50 sizeof(register_locations_)); |
| 51 for (int i = 0; i < kNumRegisters; i++) { | |
| 52 register_locations_[i] = original->register_locations_[i]; | |
| 53 } | |
| 54 } | 51 } |
| 55 | 52 |
| 56 | 53 |
| 57 FrameElement VirtualFrame::CopyElementAt(int index) { | 54 FrameElement VirtualFrame::CopyElementAt(int index) { |
| 58 ASSERT(index >= 0); | 55 ASSERT(index >= 0); |
| 59 ASSERT(index < elements_.length()); | 56 ASSERT(index < elements_.length()); |
| 60 | 57 |
| 61 FrameElement target = elements_[index]; | 58 FrameElement target = elements_[index]; |
| 62 FrameElement result; | 59 FrameElement result; |
| 63 | 60 |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 // Specialization of List::ResizeAdd to non-inlined version for FrameElements. | 402 // Specialization of List::ResizeAdd to non-inlined version for FrameElements. |
| 406 // The function ResizeAdd becomes a real function, whose implementation is the | 403 // The function ResizeAdd becomes a real function, whose implementation is the |
| 407 // inlined ResizeAddInternal. | 404 // inlined ResizeAddInternal. |
| 408 template <> | 405 template <> |
| 409 void List<FrameElement, | 406 void List<FrameElement, |
| 410 FreeStoreAllocationPolicy>::ResizeAdd(const FrameElement& element) { | 407 FreeStoreAllocationPolicy>::ResizeAdd(const FrameElement& element) { |
| 411 ResizeAddInternal(element); | 408 ResizeAddInternal(element); |
| 412 } | 409 } |
| 413 | 410 |
| 414 } } // namespace v8::internal | 411 } } // namespace v8::internal |
| OLD | NEW |