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

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

Issue 1696043002: [runtime] Unify and simplify how frames are marked (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Tweaks Created 4 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_FRAMES_INL_H_ 5 #ifndef V8_FRAMES_INL_H_
6 #define V8_FRAMES_INL_H_ 6 #define V8_FRAMES_INL_H_
7 7
8 #include "src/frames.h" 8 #include "src/frames.h"
9 #include "src/isolate.h" 9 #include "src/isolate.h"
10 #include "src/objects-inl.h" 10 #include "src/objects-inl.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 } 107 }
108 108
109 109
110 inline void StandardFrame::SetExpression(int index, Object* value) { 110 inline void StandardFrame::SetExpression(int index, Object* value) {
111 Memory::Object_at(GetExpressionAddress(index)) = value; 111 Memory::Object_at(GetExpressionAddress(index)) = value;
112 } 112 }
113 113
114 114
115 inline Object* StandardFrame::context() const { 115 inline Object* StandardFrame::context() const {
116 const int offset = StandardFrameConstants::kContextOffset; 116 const int offset = StandardFrameConstants::kContextOffset;
117 return Memory::Object_at(fp() + offset); 117 Object* maybe_result = Memory::Object_at(fp() + offset);
118 DCHECK(!maybe_result->IsSmi());
119 return maybe_result;
118 } 120 }
119 121
120 122
121 inline Address StandardFrame::caller_fp() const { 123 inline Address StandardFrame::caller_fp() const {
122 return Memory::Address_at(fp() + StandardFrameConstants::kCallerFPOffset); 124 return Memory::Address_at(fp() + StandardFrameConstants::kCallerFPOffset);
123 } 125 }
124 126
125 127
126 inline Address StandardFrame::caller_pc() const { 128 inline Address StandardFrame::caller_pc() const {
127 return Memory::Address_at(ComputePCAddress(fp())); 129 return Memory::Address_at(ComputePCAddress(fp()));
128 } 130 }
129 131
130 132
131 inline Address StandardFrame::ComputePCAddress(Address fp) { 133 inline Address StandardFrame::ComputePCAddress(Address fp) {
132 return fp + StandardFrameConstants::kCallerPCOffset; 134 return fp + StandardFrameConstants::kCallerPCOffset;
133 } 135 }
134 136
135 137
136 inline Address StandardFrame::ComputeConstantPoolAddress(Address fp) { 138 inline Address StandardFrame::ComputeConstantPoolAddress(Address fp) {
137 return fp + StandardFrameConstants::kConstantPoolOffset; 139 return fp + StandardFrameConstants::kConstantPoolOffset;
138 } 140 }
139 141
140 142
141 inline bool StandardFrame::IsArgumentsAdaptorFrame(Address fp) { 143 inline bool StandardFrame::IsArgumentsAdaptorFrame(Address fp) {
142 Object* marker = 144 Object* frame_type =
143 Memory::Object_at(fp + StandardFrameConstants::kContextOffset); 145 Memory::Object_at(fp + TypedFrameConstants::kFrameTypeOffset);
144 return marker == Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR); 146 return frame_type == Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR);
145 } 147 }
146 148
147 149
148 inline bool StandardFrame::IsConstructFrame(Address fp) { 150 inline bool StandardFrame::IsConstructFrame(Address fp) {
149 Object* marker = 151 Object* frame_type =
150 Memory::Object_at(fp + StandardFrameConstants::kMarkerOffset); 152 Memory::Object_at(fp + TypedFrameConstants::kFrameTypeOffset);
151 return marker == Smi::FromInt(StackFrame::CONSTRUCT); 153 return frame_type == Smi::FromInt(StackFrame::CONSTRUCT);
152 } 154 }
153 155
154 156
155 inline JavaScriptFrame::JavaScriptFrame(StackFrameIteratorBase* iterator) 157 inline JavaScriptFrame::JavaScriptFrame(StackFrameIteratorBase* iterator)
156 : StandardFrame(iterator) { 158 : StandardFrame(iterator) {
157 } 159 }
158 160
159 161
160 Address JavaScriptFrame::GetParameterSlot(int index) const { 162 Address JavaScriptFrame::GetParameterSlot(int index) const {
161 int param_count = ComputeParametersCount(); 163 int param_count = ComputeParametersCount();
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 DCHECK(!done()); 289 DCHECK(!done());
288 DCHECK(frame_->is_java_script() || frame_->is_exit()); 290 DCHECK(frame_->is_java_script() || frame_->is_exit());
289 return frame_; 291 return frame_;
290 } 292 }
291 293
292 294
293 } // namespace internal 295 } // namespace internal
294 } // namespace v8 296 } // namespace v8
295 297
296 #endif // V8_FRAMES_INL_H_ 298 #endif // V8_FRAMES_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698