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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 class FunctionInfoWrapper : public JSArrayBasedStruct<FunctionInfoWrapper> { | 288 class FunctionInfoWrapper : public JSArrayBasedStruct<FunctionInfoWrapper> { |
289 public: | 289 public: |
290 explicit FunctionInfoWrapper(Handle<JSArray> array) | 290 explicit FunctionInfoWrapper(Handle<JSArray> array) |
291 : JSArrayBasedStruct<FunctionInfoWrapper>(array) { | 291 : JSArrayBasedStruct<FunctionInfoWrapper>(array) { |
292 } | 292 } |
293 | 293 |
294 void SetInitialProperties(Handle<String> name, int start_position, | 294 void SetInitialProperties(Handle<String> name, int start_position, |
295 int end_position, int param_num, int literal_count, | 295 int end_position, int param_num, int literal_count, |
296 int parent_index); | 296 int parent_index); |
297 | 297 |
298 void SetFunctionCode(Handle<AbstractCode> function_code, | |
299 Handle<HeapObject> code_scope_info); | |
300 | |
301 void SetFunctionScopeInfo(Handle<Object> scope_info_array) { | 298 void SetFunctionScopeInfo(Handle<Object> scope_info_array) { |
302 this->SetField(kFunctionScopeInfoOffset_, scope_info_array); | 299 this->SetField(kFunctionScopeInfoOffset_, scope_info_array); |
303 } | 300 } |
304 | 301 |
305 void SetSharedFunctionInfo(Handle<SharedFunctionInfo> info); | 302 void SetSharedFunctionInfo(Handle<SharedFunctionInfo> info); |
306 | 303 |
| 304 Handle<SharedFunctionInfo> GetSharedFunctionInfo(); |
| 305 |
307 int GetLiteralCount() { | 306 int GetLiteralCount() { |
308 return this->GetSmiValueField(kLiteralNumOffset_); | 307 return this->GetSmiValueField(kLiteralNumOffset_); |
309 } | 308 } |
310 | 309 |
311 int GetParentIndex() { | 310 int GetParentIndex() { |
312 return this->GetSmiValueField(kParentIndexOffset_); | 311 return this->GetSmiValueField(kParentIndexOffset_); |
313 } | 312 } |
314 | 313 |
315 Handle<AbstractCode> GetFunctionCode(); | |
316 | |
317 MaybeHandle<TypeFeedbackMetadata> GetFeedbackMetadata(); | |
318 | |
319 Handle<Object> GetCodeScopeInfo(); | |
320 | |
321 int GetStartPosition() { | 314 int GetStartPosition() { |
322 return this->GetSmiValueField(kStartPositionOffset_); | 315 return this->GetSmiValueField(kStartPositionOffset_); |
323 } | 316 } |
324 | 317 |
325 int GetEndPosition() { return this->GetSmiValueField(kEndPositionOffset_); } | 318 int GetEndPosition() { return this->GetSmiValueField(kEndPositionOffset_); } |
326 | 319 |
327 private: | 320 private: |
328 static const int kFunctionNameOffset_ = 0; | 321 static const int kFunctionNameOffset_ = 0; |
329 static const int kStartPositionOffset_ = 1; | 322 static const int kStartPositionOffset_ = 1; |
330 static const int kEndPositionOffset_ = 2; | 323 static const int kEndPositionOffset_ = 2; |
331 static const int kParamNumOffset_ = 3; | 324 static const int kParamNumOffset_ = 3; |
332 static const int kCodeOffset_ = 4; | 325 static const int kFunctionScopeInfoOffset_ = 4; |
333 static const int kCodeScopeInfoOffset_ = 5; | 326 static const int kParentIndexOffset_ = 5; |
334 static const int kFunctionScopeInfoOffset_ = 6; | 327 static const int kSharedFunctionInfoOffset_ = 6; |
335 static const int kParentIndexOffset_ = 7; | 328 static const int kLiteralNumOffset_ = 7; |
336 static const int kSharedFunctionInfoOffset_ = 8; | 329 static const int kSize_ = 8; |
337 static const int kLiteralNumOffset_ = 9; | |
338 static const int kSize_ = 10; | |
339 | 330 |
340 friend class JSArrayBasedStruct<FunctionInfoWrapper>; | 331 friend class JSArrayBasedStruct<FunctionInfoWrapper>; |
341 }; | 332 }; |
342 | 333 |
343 | 334 |
344 // Wraps SharedFunctionInfo along with some of its fields for passing it | 335 // Wraps SharedFunctionInfo along with some of its fields for passing it |
345 // back to JavaScript. SharedFunctionInfo object itself is additionally | 336 // back to JavaScript. SharedFunctionInfo object itself is additionally |
346 // wrapped into BlindReference for sanitizing reasons. | 337 // wrapped into BlindReference for sanitizing reasons. |
347 class SharedInfoWrapper : public JSArrayBasedStruct<SharedInfoWrapper> { | 338 class SharedInfoWrapper : public JSArrayBasedStruct<SharedInfoWrapper> { |
348 public: | 339 public: |
(...skipping 24 matching lines...) Expand all Loading... |
373 static const int kSharedInfoOffset_ = 3; | 364 static const int kSharedInfoOffset_ = 3; |
374 static const int kSize_ = 4; | 365 static const int kSize_ = 4; |
375 | 366 |
376 friend class JSArrayBasedStruct<SharedInfoWrapper>; | 367 friend class JSArrayBasedStruct<SharedInfoWrapper>; |
377 }; | 368 }; |
378 | 369 |
379 } // namespace internal | 370 } // namespace internal |
380 } // namespace v8 | 371 } // namespace v8 |
381 | 372 |
382 #endif /* V8_DEBUG_LIVEEDIT_H_ */ | 373 #endif /* V8_DEBUG_LIVEEDIT_H_ */ |
OLD | NEW |