Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Side by Side Diff: src/liveedit.h

Issue 270283002: Reland "Prevent liveedit on or under generators with open activations" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/liveedit.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 static const int kEndPositionOffset_ = 2; 307 static const int kEndPositionOffset_ = 2;
301 static const int kSharedInfoOffset_ = 3; 308 static const int kSharedInfoOffset_ = 3;
302 static const int kSize_ = 4; 309 static const int kSize_ = 4;
303 310
304 friend class JSArrayBasedStruct<SharedInfoWrapper>; 311 friend class JSArrayBasedStruct<SharedInfoWrapper>;
305 }; 312 };
306 313
307 } } // namespace v8::internal 314 } } // namespace v8::internal
308 315
309 #endif /* V*_LIVEEDIT_H_ */ 316 #endif /* V*_LIVEEDIT_H_ */
OLDNEW
« no previous file with comments | « no previous file | src/liveedit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698