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

Side by Side Diff: src/frames-inl.h

Issue 6815010: Merge r7516, r7541 into 3.1 branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/3.1/
Patch Set: Created 9 years, 8 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/frames.cc ('k') | src/ia32/lithium-codegen-ia32.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 } 129 }
130 130
131 131
132 inline bool StandardFrame::IsConstructFrame(Address fp) { 132 inline bool StandardFrame::IsConstructFrame(Address fp) {
133 Object* marker = 133 Object* marker =
134 Memory::Object_at(fp + StandardFrameConstants::kMarkerOffset); 134 Memory::Object_at(fp + StandardFrameConstants::kMarkerOffset);
135 return marker == Smi::FromInt(CONSTRUCT); 135 return marker == Smi::FromInt(CONSTRUCT);
136 } 136 }
137 137
138 138
139 Address JavaScriptFrame::GetParameterSlot(int index) const {
140 int param_count = ComputeParametersCount();
141 ASSERT(-1 <= index && index < param_count);
142 int parameter_offset = (param_count - index - 1) * kPointerSize;
143 return caller_sp() + parameter_offset;
144 }
145
146
147 Object* JavaScriptFrame::GetParameter(int index) const {
148 return Memory::Object_at(GetParameterSlot(index));
149 }
150
151
139 inline Object* JavaScriptFrame::receiver() const { 152 inline Object* JavaScriptFrame::receiver() const {
140 const int offset = JavaScriptFrameConstants::kReceiverOffset; 153 return GetParameter(-1);
141 return Memory::Object_at(caller_sp() + offset);
142 } 154 }
143 155
144 156
145 inline void JavaScriptFrame::set_receiver(Object* value) { 157 inline void JavaScriptFrame::set_receiver(Object* value) {
146 const int offset = JavaScriptFrameConstants::kReceiverOffset; 158 Memory::Object_at(GetParameterSlot(-1)) = value;
147 Memory::Object_at(caller_sp() + offset) = value;
148 } 159 }
149 160
150 161
151 inline bool JavaScriptFrame::has_adapted_arguments() const { 162 inline bool JavaScriptFrame::has_adapted_arguments() const {
152 return IsArgumentsAdaptorFrame(caller_fp()); 163 return IsArgumentsAdaptorFrame(caller_fp());
153 } 164 }
154 165
155 166
156 inline Object* JavaScriptFrame::function() const { 167 inline Object* JavaScriptFrame::function() const {
157 Object* result = function_slot_object(); 168 Object* result = function_slot_object();
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 template<typename Iterator> 212 template<typename Iterator>
202 void JavaScriptFrameIteratorTemp<Iterator>::Reset() { 213 void JavaScriptFrameIteratorTemp<Iterator>::Reset() {
203 iterator_.Reset(); 214 iterator_.Reset();
204 if (!done()) Advance(); 215 if (!done()) Advance();
205 } 216 }
206 217
207 218
208 } } // namespace v8::internal 219 } } // namespace v8::internal
209 220
210 #endif // V8_FRAMES_INL_H_ 221 #endif // V8_FRAMES_INL_H_
OLDNEW
« no previous file with comments | « src/frames.cc ('k') | src/ia32/lithium-codegen-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698