| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_DEBUG_DEBUG_EVALUATE_H_ | 5 #ifndef V8_DEBUG_DEBUG_EVALUATE_H_ |
| 6 #define V8_DEBUG_DEBUG_EVALUATE_H_ | 6 #define V8_DEBUG_DEBUG_EVALUATE_H_ |
| 7 | 7 |
| 8 #include "src/frames.h" | 8 #include "src/frames.h" |
| 9 #include "src/objects.h" | 9 #include "src/objects.h" |
| 10 | 10 |
| 11 namespace v8 { | 11 namespace v8 { |
| 12 namespace internal { | 12 namespace internal { |
| 13 | 13 |
| 14 class DebugEvaluate : public AllStatic { | 14 class DebugEvaluate : public AllStatic { |
| 15 public: | 15 public: |
| 16 static MaybeHandle<Object> Global(Isolate* isolate, Handle<String> source, | 16 static MaybeHandle<Object> Global(Isolate* isolate, Handle<String> source); |
| 17 bool disable_break, | |
| 18 Handle<HeapObject> context_extension); | |
| 19 | 17 |
| 20 // Evaluate a piece of JavaScript in the context of a stack frame for | 18 // Evaluate a piece of JavaScript in the context of a stack frame for |
| 21 // debugging. Things that need special attention are: | 19 // debugging. Things that need special attention are: |
| 22 // - Parameters and stack-allocated locals need to be materialized. Altered | 20 // - Parameters and stack-allocated locals need to be materialized. Altered |
| 23 // values need to be written back to the stack afterwards. | 21 // values need to be written back to the stack afterwards. |
| 24 // - The arguments object needs to materialized. | 22 // - The arguments object needs to materialized. |
| 25 static MaybeHandle<Object> Local(Isolate* isolate, StackFrame::Id frame_id, | 23 static MaybeHandle<Object> Local(Isolate* isolate, StackFrame::Id frame_id, |
| 26 int inlined_jsframe_index, | 24 int inlined_jsframe_index, |
| 27 Handle<String> source, bool disable_break, | 25 Handle<String> source); |
| 28 Handle<HeapObject> context_extension); | |
| 29 | 26 |
| 30 private: | 27 private: |
| 31 // This class builds a context chain for evaluation of expressions | 28 // This class builds a context chain for evaluation of expressions |
| 32 // in debugger. | 29 // in debugger. |
| 33 // The scope chain leading up to a breakpoint where evaluation occurs | 30 // The scope chain leading up to a breakpoint where evaluation occurs |
| 34 // looks like: | 31 // looks like: |
| 35 // - [a mix of with, catch and block scopes] | 32 // - [a mix of with, catch and block scopes] |
| 36 // - [function stack + context] | 33 // - [function stack + context] |
| 37 // - [outer context] | 34 // - [outer context] |
| 38 // The builder materializes all stack variables into properties of objects; | 35 // The builder materializes all stack variables into properties of objects; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 Handle<Context> evaluation_context_; | 75 Handle<Context> evaluation_context_; |
| 79 List<ContextChainElement> context_chain_; | 76 List<ContextChainElement> context_chain_; |
| 80 Isolate* isolate_; | 77 Isolate* isolate_; |
| 81 JavaScriptFrame* frame_; | 78 JavaScriptFrame* frame_; |
| 82 int inlined_jsframe_index_; | 79 int inlined_jsframe_index_; |
| 83 }; | 80 }; |
| 84 | 81 |
| 85 static MaybeHandle<Object> Evaluate(Isolate* isolate, | 82 static MaybeHandle<Object> Evaluate(Isolate* isolate, |
| 86 Handle<SharedFunctionInfo> outer_info, | 83 Handle<SharedFunctionInfo> outer_info, |
| 87 Handle<Context> context, | 84 Handle<Context> context, |
| 88 Handle<HeapObject> context_extension, | |
| 89 Handle<Object> receiver, | 85 Handle<Object> receiver, |
| 90 Handle<String> source); | 86 Handle<String> source); |
| 91 }; | 87 }; |
| 92 | 88 |
| 93 | 89 |
| 94 } // namespace internal | 90 } // namespace internal |
| 95 } // namespace v8 | 91 } // namespace v8 |
| 96 | 92 |
| 97 #endif // V8_DEBUG_DEBUG_EVALUATE_H_ | 93 #endif // V8_DEBUG_DEBUG_EVALUATE_H_ |
| OLD | NEW |