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_LIVEEDIT_H_ | 5 #ifndef V8_LIVEEDIT_H_ |
6 #define V8_LIVEEDIT_H_ | 6 #define V8_LIVEEDIT_H_ |
7 | 7 |
8 | 8 |
9 | 9 |
10 // Live Edit feature implementation. | 10 // Live Edit feature implementation. |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 static Handle<Object> ChangeScriptSource(Handle<Script> original_script, | 82 static Handle<Object> ChangeScriptSource(Handle<Script> original_script, |
83 Handle<String> new_source, | 83 Handle<String> new_source, |
84 Handle<Object> old_script_name); | 84 Handle<Object> old_script_name); |
85 | 85 |
86 // In a code of a parent function replaces original function as embedded | 86 // In a code of a parent function replaces original function as embedded |
87 // object with a substitution one. | 87 // object with a substitution one. |
88 static void ReplaceRefToNestedFunction(Handle<JSValue> parent_function_shared, | 88 static void ReplaceRefToNestedFunction(Handle<JSValue> parent_function_shared, |
89 Handle<JSValue> orig_function_shared, | 89 Handle<JSValue> orig_function_shared, |
90 Handle<JSValue> subst_function_shared); | 90 Handle<JSValue> subst_function_shared); |
91 | 91 |
| 92 // Find open generator activations, and set corresponding "result" elements to |
| 93 // FUNCTION_BLOCKED_ACTIVE_GENERATOR. |
| 94 static bool FindActiveGenerators(Handle<FixedArray> shared_info_array, |
| 95 Handle<FixedArray> result, int len); |
| 96 |
92 // Checks listed functions on stack and return array with corresponding | 97 // Checks listed functions on stack and return array with corresponding |
93 // FunctionPatchabilityStatus statuses; extra array element may | 98 // FunctionPatchabilityStatus statuses; extra array element may |
94 // contain general error message. Modifies the current stack and | 99 // contain general error message. Modifies the current stack and |
95 // has restart the lowest found frames and drops all other frames above | 100 // has restart the lowest found frames and drops all other frames above |
96 // if possible and if do_drop is true. | 101 // if possible and if do_drop is true. |
97 static Handle<JSArray> CheckAndDropActivations( | 102 static Handle<JSArray> CheckAndDropActivations( |
98 Handle<JSArray> shared_info_array, bool do_drop); | 103 Handle<JSArray> shared_info_array, bool do_drop); |
99 | 104 |
100 // Restarts the call frame and completely drops all frames above it. | 105 // Restarts the call frame and completely drops all frames above it. |
101 // Return error message or NULL. | 106 // Return error message or NULL. |
102 static const char* RestartFrame(JavaScriptFrame* frame); | 107 static const char* RestartFrame(JavaScriptFrame* frame); |
103 | 108 |
104 // A copy of this is in liveedit-debugger.js. | 109 // A copy of this is in liveedit-debugger.js. |
105 enum FunctionPatchabilityStatus { | 110 enum FunctionPatchabilityStatus { |
106 FUNCTION_AVAILABLE_FOR_PATCH = 1, | 111 FUNCTION_AVAILABLE_FOR_PATCH = 1, |
107 FUNCTION_BLOCKED_ON_ACTIVE_STACK = 2, | 112 FUNCTION_BLOCKED_ON_ACTIVE_STACK = 2, |
108 FUNCTION_BLOCKED_ON_OTHER_STACK = 3, | 113 FUNCTION_BLOCKED_ON_OTHER_STACK = 3, |
109 FUNCTION_BLOCKED_UNDER_NATIVE_CODE = 4, | 114 FUNCTION_BLOCKED_UNDER_NATIVE_CODE = 4, |
110 FUNCTION_REPLACED_ON_ACTIVE_STACK = 5 | 115 FUNCTION_REPLACED_ON_ACTIVE_STACK = 5, |
| 116 FUNCTION_BLOCKED_UNDER_GENERATOR = 6, |
| 117 FUNCTION_BLOCKED_ACTIVE_GENERATOR = 7 |
111 }; | 118 }; |
112 | 119 |
113 // Compares 2 strings line-by-line, then token-wise and returns diff in form | 120 // Compares 2 strings line-by-line, then token-wise and returns diff in form |
114 // of array of triplets (pos1, pos1_end, pos2_end) describing list | 121 // of array of triplets (pos1, pos1_end, pos2_end) describing list |
115 // of diff chunks. | 122 // of diff chunks. |
116 static Handle<JSArray> CompareStrings(Handle<String> s1, | 123 static Handle<JSArray> CompareStrings(Handle<String> s1, |
117 Handle<String> s2); | 124 Handle<String> s2); |
118 }; | 125 }; |
119 | 126 |
120 | 127 |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 static const int kEndPositionOffset_ = 2; | 299 static const int kEndPositionOffset_ = 2; |
293 static const int kSharedInfoOffset_ = 3; | 300 static const int kSharedInfoOffset_ = 3; |
294 static const int kSize_ = 4; | 301 static const int kSize_ = 4; |
295 | 302 |
296 friend class JSArrayBasedStruct<SharedInfoWrapper>; | 303 friend class JSArrayBasedStruct<SharedInfoWrapper>; |
297 }; | 304 }; |
298 | 305 |
299 } } // namespace v8::internal | 306 } } // namespace v8::internal |
300 | 307 |
301 #endif /* V*_LIVEEDIT_H_ */ | 308 #endif /* V*_LIVEEDIT_H_ */ |
OLD | NEW |