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 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // original function context. Original function context is the end of | 47 // original function context. Original function context is the end of |
48 // the chain. | 48 // the chain. |
49 class ContextBuilder { | 49 class ContextBuilder { |
50 public: | 50 public: |
51 ContextBuilder(Isolate* isolate, JavaScriptFrame* frame, | 51 ContextBuilder(Isolate* isolate, JavaScriptFrame* frame, |
52 int inlined_jsframe_index); | 52 int inlined_jsframe_index); |
53 | 53 |
54 void UpdateValues(); | 54 void UpdateValues(); |
55 | 55 |
56 Handle<Context> innermost_context() const { return innermost_context_; } | 56 Handle<Context> innermost_context() const { return innermost_context_; } |
| 57 Handle<Context> native_context() const { return native_context_; } |
57 Handle<SharedFunctionInfo> outer_info() const { return outer_info_; } | 58 Handle<SharedFunctionInfo> outer_info() const { return outer_info_; } |
58 | 59 |
59 private: | 60 private: |
60 struct ContextChainElement { | 61 struct ContextChainElement { |
61 Handle<Context> original_context; | 62 Handle<Context> original_context; |
62 Handle<Context> cloned_context; | 63 Handle<Context> cloned_context; |
63 Handle<JSObject> materialized_object; | 64 Handle<JSObject> materialized_object; |
64 Handle<ScopeInfo> scope_info; | 65 Handle<ScopeInfo> scope_info; |
65 }; | 66 }; |
66 | 67 |
(...skipping 13 matching lines...) Expand all Loading... |
80 void UpdateContextChainFromMaterializedObject(Handle<JSObject> source, | 81 void UpdateContextChainFromMaterializedObject(Handle<JSObject> source, |
81 Handle<Context> context); | 82 Handle<Context> context); |
82 | 83 |
83 Handle<Context> MaterializeReceiver(Handle<Context> parent_context, | 84 Handle<Context> MaterializeReceiver(Handle<Context> parent_context, |
84 Handle<Context> lookup_context, | 85 Handle<Context> lookup_context, |
85 Handle<JSFunction> local_function, | 86 Handle<JSFunction> local_function, |
86 Handle<JSFunction> global_function, | 87 Handle<JSFunction> global_function, |
87 bool this_is_non_local); | 88 bool this_is_non_local); |
88 | 89 |
89 MaybeHandle<Object> LoadFromContext(Handle<Context> context, | 90 MaybeHandle<Object> LoadFromContext(Handle<Context> context, |
90 Handle<String> name); | 91 Handle<String> name, bool* global); |
91 | 92 |
92 void StoreToContext(Handle<Context> context, Handle<String> name, | 93 void StoreToContext(Handle<Context> context, Handle<String> name, |
93 Handle<Object> value); | 94 Handle<Object> value); |
94 | 95 |
95 Handle<SharedFunctionInfo> outer_info_; | 96 Handle<SharedFunctionInfo> outer_info_; |
96 Handle<Context> innermost_context_; | 97 Handle<Context> innermost_context_; |
| 98 Handle<Context> native_context_; |
97 List<ContextChainElement> context_chain_; | 99 List<ContextChainElement> context_chain_; |
98 List<Handle<String> > non_locals_; | 100 List<Handle<String> > non_locals_; |
99 Isolate* isolate_; | 101 Isolate* isolate_; |
100 JavaScriptFrame* frame_; | 102 JavaScriptFrame* frame_; |
101 int inlined_jsframe_index_; | 103 int inlined_jsframe_index_; |
102 }; | 104 }; |
103 | 105 |
104 static MaybeHandle<Object> Evaluate(Isolate* isolate, | 106 static MaybeHandle<Object> Evaluate(Isolate* isolate, |
105 Handle<SharedFunctionInfo> outer_info, | 107 Handle<SharedFunctionInfo> outer_info, |
106 Handle<Context> context, | 108 Handle<Context> context, |
107 Handle<HeapObject> context_extension, | 109 Handle<HeapObject> context_extension, |
108 Handle<Object> receiver, | 110 Handle<Object> receiver, |
109 Handle<String> source); | 111 Handle<String> source); |
110 }; | 112 }; |
111 | 113 |
112 | 114 |
113 } // namespace internal | 115 } // namespace internal |
114 } // namespace v8 | 116 } // namespace v8 |
115 | 117 |
116 #endif // V8_DEBUG_DEBUG_EVALUATE_H_ | 118 #endif // V8_DEBUG_DEBUG_EVALUATE_H_ |
OLD | NEW |