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

Side by Side Diff: src/liveedit.h

Issue 301563004: Refactor after break target computation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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 | « src/debug.cc ('k') | 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 static bool IsActive(Isolate* isolate); 52 static bool IsActive(Isolate* isolate);
53 53
54 private: 54 private:
55 Isolate* isolate_; 55 Isolate* isolate_;
56 }; 56 };
57 57
58 58
59 class LiveEdit : AllStatic { 59 class LiveEdit : AllStatic {
60 public: 60 public:
61 // Describes how exactly a frame has been dropped from stack.
62 enum FrameDropMode {
63 // No frame has been dropped.
64 FRAMES_UNTOUCHED,
65 // The top JS frame had been calling IC stub. IC stub mustn't be called now.
66 FRAME_DROPPED_IN_IC_CALL,
67 // The top JS frame had been calling debug break slot stub. Patch the
68 // address this stub jumps to in the end.
69 FRAME_DROPPED_IN_DEBUG_SLOT_CALL,
70 // The top JS frame had been calling some C++ function. The return address
71 // gets patched automatically.
72 FRAME_DROPPED_IN_DIRECT_CALL,
73 FRAME_DROPPED_IN_RETURN_CALL,
74 CURRENTLY_SET_MODE
75 };
76
77 static Address AfterBreakTarget(FrameDropMode mode, Isolate* isolate);
78
61 MUST_USE_RESULT static MaybeHandle<JSArray> GatherCompileInfo( 79 MUST_USE_RESULT static MaybeHandle<JSArray> GatherCompileInfo(
62 Handle<Script> script, 80 Handle<Script> script,
63 Handle<String> source); 81 Handle<String> source);
64 82
65 static void WrapSharedFunctionInfos(Handle<JSArray> array); 83 static void WrapSharedFunctionInfos(Handle<JSArray> array);
66 84
67 static void ReplaceFunctionCode(Handle<JSArray> new_compile_info_array, 85 static void ReplaceFunctionCode(Handle<JSArray> new_compile_info_array,
68 Handle<JSArray> shared_info_array); 86 Handle<JSArray> shared_info_array);
69 87
70 static void FunctionSourceUpdated(Handle<JSArray> shared_info_array); 88 static void FunctionSourceUpdated(Handle<JSArray> shared_info_array);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 */ 173 */
156 // A size of frame base including fp. Padding words starts right above 174 // A size of frame base including fp. Padding words starts right above
157 // the base. 175 // the base.
158 static const int kFrameDropperFrameSize = 4; 176 static const int kFrameDropperFrameSize = 4;
159 // A number of words that should be reserved on stack for the LiveEdit use. 177 // A number of words that should be reserved on stack for the LiveEdit use.
160 // Stored on stack in form of Smi. 178 // Stored on stack in form of Smi.
161 static const int kFramePaddingInitialSize = 1; 179 static const int kFramePaddingInitialSize = 1;
162 // A value that padding words are filled with (in form of Smi). Going 180 // A value that padding words are filled with (in form of Smi). Going
163 // bottom-top, the first word not having this value is a counter word. 181 // bottom-top, the first word not having this value is a counter word.
164 static const int kFramePaddingValue = kFramePaddingInitialSize + 1; 182 static const int kFramePaddingValue = kFramePaddingInitialSize + 1;
165
166
167 // Describes how exactly a frame has been dropped from stack.
168 enum FrameDropMode {
169 // No frame has been dropped.
170 FRAMES_UNTOUCHED,
171 // The top JS frame had been calling IC stub. IC stub mustn't be called now.
172 FRAME_DROPPED_IN_IC_CALL,
173 // The top JS frame had been calling debug break slot stub. Patch the
174 // address this stub jumps to in the end.
175 FRAME_DROPPED_IN_DEBUG_SLOT_CALL,
176 // The top JS frame had been calling some C++ function. The return address
177 // gets patched automatically.
178 FRAME_DROPPED_IN_DIRECT_CALL,
179 FRAME_DROPPED_IN_RETURN_CALL,
180 CURRENTLY_SET_MODE
181 };
182 }; 183 };
183 184
184 185
185 // A general-purpose comparator between 2 arrays. 186 // A general-purpose comparator between 2 arrays.
186 class Comparator { 187 class Comparator {
187 public: 188 public:
188 // Holds 2 arrays of some elements allowing to compare any pair of 189 // Holds 2 arrays of some elements allowing to compare any pair of
189 // element from the first array and element from the second array. 190 // element from the first array and element from the second array.
190 class Input { 191 class Input {
191 public: 192 public:
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 static const int kEndPositionOffset_ = 2; 369 static const int kEndPositionOffset_ = 2;
369 static const int kSharedInfoOffset_ = 3; 370 static const int kSharedInfoOffset_ = 3;
370 static const int kSize_ = 4; 371 static const int kSize_ = 4;
371 372
372 friend class JSArrayBasedStruct<SharedInfoWrapper>; 373 friend class JSArrayBasedStruct<SharedInfoWrapper>;
373 }; 374 };
374 375
375 } } // namespace v8::internal 376 } } // namespace v8::internal
376 377
377 #endif /* V*_LIVEEDIT_H_ */ 378 #endif /* V*_LIVEEDIT_H_ */
OLDNEW
« no previous file with comments | « src/debug.cc ('k') | src/liveedit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698