Chromium Code Reviews| OLD | NEW |
|---|---|
| 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_H_ | 5 #ifndef V8_FRAMES_H_ |
| 6 #define V8_FRAMES_H_ | 6 #define V8_FRAMES_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/handles.h" | 9 #include "src/handles.h" |
| 10 #include "src/safepoint-table.h" | 10 #include "src/safepoint-table.h" |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 407 this->iterator_ = NULL; | 407 this->iterator_ = NULL; |
| 408 this->isolate_ = original.isolate_; | 408 this->isolate_ = original.isolate_; |
| 409 } | 409 } |
| 410 | 410 |
| 411 // Type testers. | 411 // Type testers. |
| 412 bool is_entry() const { return type() == ENTRY; } | 412 bool is_entry() const { return type() == ENTRY; } |
| 413 bool is_entry_construct() const { return type() == ENTRY_CONSTRUCT; } | 413 bool is_entry_construct() const { return type() == ENTRY_CONSTRUCT; } |
| 414 bool is_exit() const { return type() == EXIT; } | 414 bool is_exit() const { return type() == EXIT; } |
| 415 bool is_optimized() const { return type() == OPTIMIZED; } | 415 bool is_optimized() const { return type() == OPTIMIZED; } |
| 416 bool is_interpreted() const { return type() == INTERPRETED; } | 416 bool is_interpreted() const { return type() == INTERPRETED; } |
| 417 bool is_wasm() const { return type() == WASM; } | 417 bool is_wasm() const { |
|
bradn
2016/03/28 23:46:06
Keeping the 3 sorts of wasm frames orthogonal seem
JF
2016/03/29 00:24:06
I don't mind either way, but if we keep them separ
| |
| 418 return type() == WASM || is_wasm_to_js() || is_js_to_wasm(); | |
| 419 } | |
| 418 bool is_wasm_to_js() const { return type() == WASM_TO_JS; } | 420 bool is_wasm_to_js() const { return type() == WASM_TO_JS; } |
| 419 bool is_js_to_wasm() const { return type() == JS_TO_WASM; } | 421 bool is_js_to_wasm() const { return type() == JS_TO_WASM; } |
| 420 bool is_arguments_adaptor() const { return type() == ARGUMENTS_ADAPTOR; } | 422 bool is_arguments_adaptor() const { return type() == ARGUMENTS_ADAPTOR; } |
| 421 bool is_internal() const { return type() == INTERNAL; } | 423 bool is_internal() const { return type() == INTERNAL; } |
| 422 bool is_stub_failure_trampoline() const { | 424 bool is_stub_failure_trampoline() const { |
| 423 return type() == STUB_FAILURE_TRAMPOLINE; | 425 return type() == STUB_FAILURE_TRAMPOLINE; |
| 424 } | 426 } |
| 425 bool is_construct() const { return type() == CONSTRUCT; } | 427 bool is_construct() const { return type() == CONSTRUCT; } |
| 426 virtual bool is_standard() const { return false; } | 428 virtual bool is_standard() const { return false; } |
| 427 | 429 |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 788 // - InterpretedFrame: Data is the register index holding the context. | 790 // - InterpretedFrame: Data is the register index holding the context. |
| 789 virtual int LookupExceptionHandlerInTable( | 791 virtual int LookupExceptionHandlerInTable( |
| 790 int* data, HandlerTable::CatchPrediction* prediction); | 792 int* data, HandlerTable::CatchPrediction* prediction); |
| 791 | 793 |
| 792 // Architecture-specific register description. | 794 // Architecture-specific register description. |
| 793 static Register fp_register(); | 795 static Register fp_register(); |
| 794 static Register context_register(); | 796 static Register context_register(); |
| 795 static Register constant_pool_pointer_register(); | 797 static Register constant_pool_pointer_register(); |
| 796 | 798 |
| 797 static JavaScriptFrame* cast(StackFrame* frame) { | 799 static JavaScriptFrame* cast(StackFrame* frame) { |
| 798 DCHECK(frame->is_java_script()); | 800 DCHECK(frame->is_java_script()); |
|
JF
2016/03/29 00:24:06
Compare to this, which is also true for OptimizedF
| |
| 799 return static_cast<JavaScriptFrame*>(frame); | 801 return static_cast<JavaScriptFrame*>(frame); |
| 800 } | 802 } |
| 801 | 803 |
| 802 static void PrintFunctionAndOffset(JSFunction* function, Code* code, | 804 static void PrintFunctionAndOffset(JSFunction* function, Code* code, |
| 803 Address pc, FILE* file, | 805 Address pc, FILE* file, |
| 804 bool print_line_number); | 806 bool print_line_number); |
| 805 | 807 |
| 806 static void PrintTop(Isolate* isolate, FILE* file, bool print_args, | 808 static void PrintTop(Isolate* isolate, FILE* file, bool print_args, |
| 807 bool print_line_number); | 809 bool print_line_number); |
| 808 | 810 |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 954 // GC support. | 956 // GC support. |
| 955 void Iterate(ObjectVisitor* v) const override; | 957 void Iterate(ObjectVisitor* v) const override; |
| 956 | 958 |
| 957 // Printing support. | 959 // Printing support. |
| 958 void Print(StringStream* accumulator, PrintMode mode, | 960 void Print(StringStream* accumulator, PrintMode mode, |
| 959 int index) const override; | 961 int index) const override; |
| 960 | 962 |
| 961 // Determine the code for the frame. | 963 // Determine the code for the frame. |
| 962 Code* unchecked_code() const override; | 964 Code* unchecked_code() const override; |
| 963 | 965 |
| 966 static WasmFrame* cast(StackFrame* frame) { | |
| 967 DCHECK(frame->is_wasm()); | |
|
bradn
2016/03/28 23:46:06
Why not preserve the existing categories and dchec
| |
| 968 return static_cast<WasmFrame*>(frame); | |
| 969 } | |
| 970 | |
| 964 protected: | 971 protected: |
| 965 inline explicit WasmFrame(StackFrameIteratorBase* iterator); | 972 inline explicit WasmFrame(StackFrameIteratorBase* iterator); |
| 966 | 973 |
| 967 Address GetCallerStackPointer() const override; | 974 Address GetCallerStackPointer() const override; |
| 968 | 975 |
| 969 private: | 976 private: |
| 970 friend class StackFrameIteratorBase; | 977 friend class StackFrameIteratorBase; |
| 971 }; | 978 }; |
| 972 | 979 |
| 973 class WasmToJsFrame : public WasmFrame { | 980 class WasmToJsFrame : public WasmFrame { |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1195 | 1202 |
| 1196 | 1203 |
| 1197 // Reads all frames on the current stack and copies them into the current | 1204 // Reads all frames on the current stack and copies them into the current |
| 1198 // zone memory. | 1205 // zone memory. |
| 1199 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); | 1206 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); |
| 1200 | 1207 |
| 1201 } // namespace internal | 1208 } // namespace internal |
| 1202 } // namespace v8 | 1209 } // namespace v8 |
| 1203 | 1210 |
| 1204 #endif // V8_FRAMES_H_ | 1211 #endif // V8_FRAMES_H_ |
| OLD | NEW |