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 | |
97 // Checks listed functions on stack and return array with corresponding | 92 // Checks listed functions on stack and return array with corresponding |
98 // FunctionPatchabilityStatus statuses; extra array element may | 93 // FunctionPatchabilityStatus statuses; extra array element may |
99 // contain general error message. Modifies the current stack and | 94 // contain general error message. Modifies the current stack and |
100 // has restart the lowest found frames and drops all other frames above | 95 // has restart the lowest found frames and drops all other frames above |
101 // if possible and if do_drop is true. | 96 // if possible and if do_drop is true. |
102 static Handle<JSArray> CheckAndDropActivations( | 97 static Handle<JSArray> CheckAndDropActivations( |
103 Handle<JSArray> shared_info_array, bool do_drop); | 98 Handle<JSArray> shared_info_array, bool do_drop); |
104 | 99 |
105 // Restarts the call frame and completely drops all frames above it. | 100 // Restarts the call frame and completely drops all frames above it. |
106 // Return error message or NULL. | 101 // Return error message or NULL. |
107 static const char* RestartFrame(JavaScriptFrame* frame); | 102 static const char* RestartFrame(JavaScriptFrame* frame); |
108 | 103 |
109 // A copy of this is in liveedit-debugger.js. | 104 // A copy of this is in liveedit-debugger.js. |
110 enum FunctionPatchabilityStatus { | 105 enum FunctionPatchabilityStatus { |
111 FUNCTION_AVAILABLE_FOR_PATCH = 1, | 106 FUNCTION_AVAILABLE_FOR_PATCH = 1, |
112 FUNCTION_BLOCKED_ON_ACTIVE_STACK = 2, | 107 FUNCTION_BLOCKED_ON_ACTIVE_STACK = 2, |
113 FUNCTION_BLOCKED_ON_OTHER_STACK = 3, | 108 FUNCTION_BLOCKED_ON_OTHER_STACK = 3, |
114 FUNCTION_BLOCKED_UNDER_NATIVE_CODE = 4, | 109 FUNCTION_BLOCKED_UNDER_NATIVE_CODE = 4, |
115 FUNCTION_REPLACED_ON_ACTIVE_STACK = 5, | 110 FUNCTION_REPLACED_ON_ACTIVE_STACK = 5 |
116 FUNCTION_BLOCKED_UNDER_GENERATOR = 6, | |
117 FUNCTION_BLOCKED_ACTIVE_GENERATOR = 7 | |
118 }; | 111 }; |
119 | 112 |
120 // Compares 2 strings line-by-line, then token-wise and returns diff in form | 113 // Compares 2 strings line-by-line, then token-wise and returns diff in form |
121 // of array of triplets (pos1, pos1_end, pos2_end) describing list | 114 // of array of triplets (pos1, pos1_end, pos2_end) describing list |
122 // of diff chunks. | 115 // of diff chunks. |
123 static Handle<JSArray> CompareStrings(Handle<String> s1, | 116 static Handle<JSArray> CompareStrings(Handle<String> s1, |
124 Handle<String> s2); | 117 Handle<String> s2); |
125 }; | 118 }; |
126 | 119 |
127 | 120 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 static const int kEndPositionOffset_ = 2; | 300 static const int kEndPositionOffset_ = 2; |
308 static const int kSharedInfoOffset_ = 3; | 301 static const int kSharedInfoOffset_ = 3; |
309 static const int kSize_ = 4; | 302 static const int kSize_ = 4; |
310 | 303 |
311 friend class JSArrayBasedStruct<SharedInfoWrapper>; | 304 friend class JSArrayBasedStruct<SharedInfoWrapper>; |
312 }; | 305 }; |
313 | 306 |
314 } } // namespace v8::internal | 307 } } // namespace v8::internal |
315 | 308 |
316 #endif /* V*_LIVEEDIT_H_ */ | 309 #endif /* V*_LIVEEDIT_H_ */ |
OLD | NEW |