Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Side by Side Diff: src/virtual-frame-inl.h

Issue 660175: Make another small virtual frame function inlined.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/virtual-frame-ia32.cc ('k') | src/x64/virtual-frame-x64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 15 matching lines...) Expand all
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 #ifndef V8_VIRTUAL_FRAME_INL_H_ 28 #ifndef V8_VIRTUAL_FRAME_INL_H_
29 #define V8_VIRTUAL_FRAME_INL_H_ 29 #define V8_VIRTUAL_FRAME_INL_H_
30 30
31 #include "virtual-frame.h" 31 #include "virtual-frame.h"
32 32
33 namespace v8 { 33 namespace v8 {
34 namespace internal { 34 namespace internal {
35 35
36
37 // On entry to a function, the virtual frame already contains the receiver,
38 // the parameters, and a return address. All frame elements are in memory.
39 VirtualFrame::VirtualFrame()
40 : elements_(parameter_count() + local_count() + kPreallocatedElements),
41 stack_pointer_(parameter_count() + 1) { // 0-based index of TOS.
42 for (int i = 0; i <= stack_pointer_; i++) {
43 elements_.Add(FrameElement::MemoryElement(NumberInfo::kUnknown));
44 }
45 for (int i = 0; i < RegisterAllocator::kNumRegisters; i++) {
46 register_locations_[i] = kIllegalIndex;
47 }
48 }
49
50
36 // When cloned, a frame is a deep copy of the original. 51 // When cloned, a frame is a deep copy of the original.
37 VirtualFrame::VirtualFrame(VirtualFrame* original) 52 VirtualFrame::VirtualFrame(VirtualFrame* original)
38 : elements_(original->element_count()), 53 : elements_(original->element_count()),
39 stack_pointer_(original->stack_pointer_) { 54 stack_pointer_(original->stack_pointer_) {
40 elements_.AddAll(original->elements_); 55 elements_.AddAll(original->elements_);
41 // Copy register locations from original. 56 // Copy register locations from original.
42 memcpy(&register_locations_, 57 memcpy(&register_locations_,
43 original->register_locations_, 58 original->register_locations_,
44 sizeof(register_locations_)); 59 sizeof(register_locations_));
45 } 60 }
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 for (int i = 0; i < element_count(); i++) { 115 for (int i = 0; i < element_count(); i++) {
101 if (!elements_[i].Equals(other->elements_[i])) return false; 116 if (!elements_[i].Equals(other->elements_[i])) return false;
102 } 117 }
103 118
104 return true; 119 return true;
105 } 120 }
106 121
107 } } // namespace v8::internal 122 } } // namespace v8::internal
108 123
109 #endif // V8_VIRTUAL_FRAME_INL_H_ 124 #endif // V8_VIRTUAL_FRAME_INL_H_
OLDNEW
« no previous file with comments | « src/ia32/virtual-frame-ia32.cc ('k') | src/x64/virtual-frame-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698