| 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_DEBUG_LIVEEDIT_H_ | 5 #ifndef V8_DEBUG_LIVEEDIT_H_ |
| 6 #define V8_DEBUG_LIVEEDIT_H_ | 6 #define V8_DEBUG_LIVEEDIT_H_ |
| 7 | 7 |
| 8 | 8 |
| 9 // Live Edit feature implementation. | 9 // Live Edit feature implementation. |
| 10 // User should be able to change script on already running VM. This feature | 10 // User should be able to change script on already running VM. This feature |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 static bool SetAfterBreakTarget(Debug* debug); | 77 static bool SetAfterBreakTarget(Debug* debug); |
| 78 | 78 |
| 79 MUST_USE_RESULT static MaybeHandle<JSArray> GatherCompileInfo( | 79 MUST_USE_RESULT static MaybeHandle<JSArray> GatherCompileInfo( |
| 80 Handle<Script> script, | 80 Handle<Script> script, |
| 81 Handle<String> source); | 81 Handle<String> source); |
| 82 | 82 |
| 83 static void ReplaceFunctionCode(Handle<JSArray> new_compile_info_array, | 83 static void ReplaceFunctionCode(Handle<JSArray> new_compile_info_array, |
| 84 Handle<JSArray> shared_info_array); | 84 Handle<JSArray> shared_info_array); |
| 85 | 85 |
| 86 static void FixupScript(Handle<Script> script, int max_function_literal_id); | 86 static void FunctionSourceUpdated(Handle<JSArray> shared_info_array); |
| 87 | |
| 88 static void FunctionSourceUpdated(Handle<JSArray> shared_info_array, | |
| 89 int new_function_literal_id); | |
| 90 | 87 |
| 91 // Updates script field in FunctionSharedInfo. | 88 // Updates script field in FunctionSharedInfo. |
| 92 static void SetFunctionScript(Handle<JSValue> function_wrapper, | 89 static void SetFunctionScript(Handle<JSValue> function_wrapper, |
| 93 Handle<Object> script_handle); | 90 Handle<Object> script_handle); |
| 94 | 91 |
| 95 static void PatchFunctionPositions(Handle<JSArray> shared_info_array, | 92 static void PatchFunctionPositions(Handle<JSArray> shared_info_array, |
| 96 Handle<JSArray> position_change_array); | 93 Handle<JSArray> position_change_array); |
| 97 | 94 |
| 98 // For a script updates its source field. If old_script_name is provided | 95 // For a script updates its source field. If old_script_name is provided |
| 99 // (i.e. is a String), also creates a copy of the script with its original | 96 // (i.e. is a String), also creates a copy of the script with its original |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 // from JavaScript. It contains Code object, which is kept wrapped | 271 // from JavaScript. It contains Code object, which is kept wrapped |
| 275 // into a BlindReference for sanitizing reasons. | 272 // into a BlindReference for sanitizing reasons. |
| 276 class FunctionInfoWrapper : public JSArrayBasedStruct<FunctionInfoWrapper> { | 273 class FunctionInfoWrapper : public JSArrayBasedStruct<FunctionInfoWrapper> { |
| 277 public: | 274 public: |
| 278 explicit FunctionInfoWrapper(Handle<JSArray> array) | 275 explicit FunctionInfoWrapper(Handle<JSArray> array) |
| 279 : JSArrayBasedStruct<FunctionInfoWrapper>(array) { | 276 : JSArrayBasedStruct<FunctionInfoWrapper>(array) { |
| 280 } | 277 } |
| 281 | 278 |
| 282 void SetInitialProperties(Handle<String> name, int start_position, | 279 void SetInitialProperties(Handle<String> name, int start_position, |
| 283 int end_position, int param_num, int literal_count, | 280 int end_position, int param_num, int literal_count, |
| 284 int parent_index, int function_literal_id); | 281 int parent_index); |
| 285 | 282 |
| 286 void SetFunctionScopeInfo(Handle<Object> scope_info_array) { | 283 void SetFunctionScopeInfo(Handle<Object> scope_info_array) { |
| 287 this->SetField(kFunctionScopeInfoOffset_, scope_info_array); | 284 this->SetField(kFunctionScopeInfoOffset_, scope_info_array); |
| 288 } | 285 } |
| 289 | 286 |
| 290 void SetSharedFunctionInfo(Handle<SharedFunctionInfo> info); | 287 void SetSharedFunctionInfo(Handle<SharedFunctionInfo> info); |
| 291 | 288 |
| 292 Handle<SharedFunctionInfo> GetSharedFunctionInfo(); | 289 Handle<SharedFunctionInfo> GetSharedFunctionInfo(); |
| 293 | 290 |
| 294 int GetLiteralCount() { | 291 int GetLiteralCount() { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 307 | 304 |
| 308 private: | 305 private: |
| 309 static const int kFunctionNameOffset_ = 0; | 306 static const int kFunctionNameOffset_ = 0; |
| 310 static const int kStartPositionOffset_ = 1; | 307 static const int kStartPositionOffset_ = 1; |
| 311 static const int kEndPositionOffset_ = 2; | 308 static const int kEndPositionOffset_ = 2; |
| 312 static const int kParamNumOffset_ = 3; | 309 static const int kParamNumOffset_ = 3; |
| 313 static const int kFunctionScopeInfoOffset_ = 4; | 310 static const int kFunctionScopeInfoOffset_ = 4; |
| 314 static const int kParentIndexOffset_ = 5; | 311 static const int kParentIndexOffset_ = 5; |
| 315 static const int kSharedFunctionInfoOffset_ = 6; | 312 static const int kSharedFunctionInfoOffset_ = 6; |
| 316 static const int kLiteralNumOffset_ = 7; | 313 static const int kLiteralNumOffset_ = 7; |
| 317 static const int kFunctionLiteralIdOffset_ = 8; | 314 static const int kSize_ = 8; |
| 318 static const int kSize_ = 9; | |
| 319 | 315 |
| 320 friend class JSArrayBasedStruct<FunctionInfoWrapper>; | 316 friend class JSArrayBasedStruct<FunctionInfoWrapper>; |
| 321 }; | 317 }; |
| 322 | 318 |
| 323 | 319 |
| 324 // Wraps SharedFunctionInfo along with some of its fields for passing it | 320 // Wraps SharedFunctionInfo along with some of its fields for passing it |
| 325 // back to JavaScript. SharedFunctionInfo object itself is additionally | 321 // back to JavaScript. SharedFunctionInfo object itself is additionally |
| 326 // wrapped into BlindReference for sanitizing reasons. | 322 // wrapped into BlindReference for sanitizing reasons. |
| 327 class SharedInfoWrapper : public JSArrayBasedStruct<SharedInfoWrapper> { | 323 class SharedInfoWrapper : public JSArrayBasedStruct<SharedInfoWrapper> { |
| 328 public: | 324 public: |
| (...skipping 24 matching lines...) Expand all Loading... |
| 353 static const int kSharedInfoOffset_ = 3; | 349 static const int kSharedInfoOffset_ = 3; |
| 354 static const int kSize_ = 4; | 350 static const int kSize_ = 4; |
| 355 | 351 |
| 356 friend class JSArrayBasedStruct<SharedInfoWrapper>; | 352 friend class JSArrayBasedStruct<SharedInfoWrapper>; |
| 357 }; | 353 }; |
| 358 | 354 |
| 359 } // namespace internal | 355 } // namespace internal |
| 360 } // namespace v8 | 356 } // namespace v8 |
| 361 | 357 |
| 362 #endif /* V8_DEBUG_LIVEEDIT_H_ */ | 358 #endif /* V8_DEBUG_LIVEEDIT_H_ */ |
| OLD | NEW |