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

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

Issue 2090723005: [builtins] New frame type for exits to C++ builtins (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 inline EntryConstructFrame::EntryConstructFrame( 91 inline EntryConstructFrame::EntryConstructFrame(
92 StackFrameIteratorBase* iterator) 92 StackFrameIteratorBase* iterator)
93 : EntryFrame(iterator) { 93 : EntryFrame(iterator) {
94 } 94 }
95 95
96 96
97 inline ExitFrame::ExitFrame(StackFrameIteratorBase* iterator) 97 inline ExitFrame::ExitFrame(StackFrameIteratorBase* iterator)
98 : StackFrame(iterator) { 98 : StackFrame(iterator) {
99 } 99 }
100 100
101 inline BuiltinExitFrame::BuiltinExitFrame(StackFrameIteratorBase* iterator)
102 : ExitFrame(iterator) {}
103
104 inline Object* BuiltinExitFrame::function_slot_object() const {
105 return Memory::Object_at(fp() + kFunctionOffset);
106 }
101 107
102 inline StandardFrame::StandardFrame(StackFrameIteratorBase* iterator) 108 inline StandardFrame::StandardFrame(StackFrameIteratorBase* iterator)
103 : StackFrame(iterator) { 109 : StackFrame(iterator) {
104 } 110 }
105 111
106 112
107 inline Object* StandardFrame::GetExpression(int index) const { 113 inline Object* StandardFrame::GetExpression(int index) const {
108 return Memory::Object_at(GetExpressionAddress(index)); 114 return Memory::Object_at(GetExpressionAddress(index));
109 } 115 }
110 116
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 // the JavaScript frame type, because we may encounter arguments 283 // the JavaScript frame type, because we may encounter arguments
278 // adaptor frames. 284 // adaptor frames.
279 StackFrame* frame = iterator_.frame(); 285 StackFrame* frame = iterator_.frame();
280 DCHECK(frame->is_java_script() || frame->is_arguments_adaptor()); 286 DCHECK(frame->is_java_script() || frame->is_arguments_adaptor());
281 return static_cast<JavaScriptFrame*>(frame); 287 return static_cast<JavaScriptFrame*>(frame);
282 } 288 }
283 289
284 inline StandardFrame* StackTraceFrameIterator::frame() const { 290 inline StandardFrame* StackTraceFrameIterator::frame() const {
285 StackFrame* frame = iterator_.frame(); 291 StackFrame* frame = iterator_.frame();
286 DCHECK(frame->is_java_script() || frame->is_arguments_adaptor() || 292 DCHECK(frame->is_java_script() || frame->is_arguments_adaptor() ||
287 frame->is_wasm()); 293 frame->is_wasm() || frame->is_builtin_exit());
288 return static_cast<StandardFrame*>(frame); 294 return static_cast<StandardFrame*>(frame);
289 } 295 }
290 296
291 bool StackTraceFrameIterator::is_javascript() const { 297 bool StackTraceFrameIterator::is_javascript() const {
292 return frame()->is_java_script(); 298 return frame()->is_java_script();
293 } 299 }
294 300
295 bool StackTraceFrameIterator::is_wasm() const { return frame()->is_wasm(); } 301 bool StackTraceFrameIterator::is_wasm() const { return frame()->is_wasm(); }
296 302
303 bool StackTraceFrameIterator::is_builtin_exit() const {
304 return frame()->is_builtin_exit();
305 }
306
297 JavaScriptFrame* StackTraceFrameIterator::javascript_frame() const { 307 JavaScriptFrame* StackTraceFrameIterator::javascript_frame() const {
298 DCHECK(is_javascript()); 308 DCHECK(is_javascript());
299 return static_cast<JavaScriptFrame*>(frame()); 309 return static_cast<JavaScriptFrame*>(frame());
300 } 310 }
301 311
302 WasmFrame* StackTraceFrameIterator::wasm_frame() const { 312 WasmFrame* StackTraceFrameIterator::wasm_frame() const {
303 DCHECK(is_wasm()); 313 DCHECK(is_wasm());
304 return static_cast<WasmFrame*>(frame()); 314 return static_cast<WasmFrame*>(frame());
305 } 315 }
306 316
317 BuiltinExitFrame* StackTraceFrameIterator::builtin_exit_frame() const {
318 DCHECK(is_builtin_exit());
319 return static_cast<BuiltinExitFrame*>(iterator_.frame());
320 }
321
307 inline StackFrame* SafeStackFrameIterator::frame() const { 322 inline StackFrame* SafeStackFrameIterator::frame() const {
308 DCHECK(!done()); 323 DCHECK(!done());
309 DCHECK(frame_->is_java_script() || frame_->is_exit()); 324 DCHECK(frame_->is_java_script() || frame_->is_exit());
310 return frame_; 325 return frame_;
311 } 326 }
312 327
313 328
314 } // namespace internal 329 } // namespace internal
315 } // namespace v8 330 } // namespace v8
316 331
317 #endif // V8_FRAMES_INL_H_ 332 #endif // V8_FRAMES_INL_H_
OLDNEW
« src/builtins.h ('K') | « src/frames.cc ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698