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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 | 273 |
274 // Represents some function compilation details. This structure will be used | 274 // Represents some function compilation details. This structure will be used |
275 // from JavaScript. It contains Code object, which is kept wrapped | 275 // from JavaScript. It contains Code object, which is kept wrapped |
276 // into a BlindReference for sanitizing reasons. | 276 // into a BlindReference for sanitizing reasons. |
277 class FunctionInfoWrapper : public JSArrayBasedStruct<FunctionInfoWrapper> { | 277 class FunctionInfoWrapper : public JSArrayBasedStruct<FunctionInfoWrapper> { |
278 public: | 278 public: |
279 explicit FunctionInfoWrapper(Handle<JSArray> array) | 279 explicit FunctionInfoWrapper(Handle<JSArray> array) |
280 : JSArrayBasedStruct<FunctionInfoWrapper>(array) { | 280 : JSArrayBasedStruct<FunctionInfoWrapper>(array) { |
281 } | 281 } |
282 | 282 |
283 void SetInitialProperties(Handle<String> name, | 283 void SetInitialProperties(Handle<String> name, int start_position, |
284 int start_position, | 284 int end_position, int param_num, int literal_count, |
285 int end_position, | 285 int slot_count, int ic_slot_count, |
286 int param_num, | |
287 int literal_count, | |
288 int slot_count, | |
289 int parent_index); | 286 int parent_index); |
290 | 287 |
291 void SetFunctionCode(Handle<Code> function_code, | 288 void SetFunctionCode(Handle<Code> function_code, |
292 Handle<HeapObject> code_scope_info); | 289 Handle<HeapObject> code_scope_info); |
293 | 290 |
294 void SetFunctionScopeInfo(Handle<Object> scope_info_array) { | 291 void SetFunctionScopeInfo(Handle<Object> scope_info_array) { |
295 this->SetField(kFunctionScopeInfoOffset_, scope_info_array); | 292 this->SetField(kFunctionScopeInfoOffset_, scope_info_array); |
296 } | 293 } |
297 | 294 |
298 void SetSharedFunctionInfo(Handle<SharedFunctionInfo> info); | 295 void SetSharedFunctionInfo(Handle<SharedFunctionInfo> info); |
(...skipping 15 matching lines...) Expand all Loading... |
314 int GetStartPosition() { | 311 int GetStartPosition() { |
315 return this->GetSmiValueField(kStartPositionOffset_); | 312 return this->GetSmiValueField(kStartPositionOffset_); |
316 } | 313 } |
317 | 314 |
318 int GetEndPosition() { return this->GetSmiValueField(kEndPositionOffset_); } | 315 int GetEndPosition() { return this->GetSmiValueField(kEndPositionOffset_); } |
319 | 316 |
320 int GetSlotCount() { | 317 int GetSlotCount() { |
321 return this->GetSmiValueField(kSlotNumOffset_); | 318 return this->GetSmiValueField(kSlotNumOffset_); |
322 } | 319 } |
323 | 320 |
| 321 int GetICSlotCount() { return this->GetSmiValueField(kICSlotNumOffset_); } |
| 322 |
324 private: | 323 private: |
325 static const int kFunctionNameOffset_ = 0; | 324 static const int kFunctionNameOffset_ = 0; |
326 static const int kStartPositionOffset_ = 1; | 325 static const int kStartPositionOffset_ = 1; |
327 static const int kEndPositionOffset_ = 2; | 326 static const int kEndPositionOffset_ = 2; |
328 static const int kParamNumOffset_ = 3; | 327 static const int kParamNumOffset_ = 3; |
329 static const int kCodeOffset_ = 4; | 328 static const int kCodeOffset_ = 4; |
330 static const int kCodeScopeInfoOffset_ = 5; | 329 static const int kCodeScopeInfoOffset_ = 5; |
331 static const int kFunctionScopeInfoOffset_ = 6; | 330 static const int kFunctionScopeInfoOffset_ = 6; |
332 static const int kParentIndexOffset_ = 7; | 331 static const int kParentIndexOffset_ = 7; |
333 static const int kSharedFunctionInfoOffset_ = 8; | 332 static const int kSharedFunctionInfoOffset_ = 8; |
334 static const int kLiteralNumOffset_ = 9; | 333 static const int kLiteralNumOffset_ = 9; |
335 static const int kSlotNumOffset_ = 10; | 334 static const int kSlotNumOffset_ = 10; |
336 static const int kSize_ = 11; | 335 static const int kICSlotNumOffset_ = 11; |
| 336 static const int kSize_ = 12; |
337 | 337 |
338 friend class JSArrayBasedStruct<FunctionInfoWrapper>; | 338 friend class JSArrayBasedStruct<FunctionInfoWrapper>; |
339 }; | 339 }; |
340 | 340 |
341 | 341 |
342 // Wraps SharedFunctionInfo along with some of its fields for passing it | 342 // Wraps SharedFunctionInfo along with some of its fields for passing it |
343 // back to JavaScript. SharedFunctionInfo object itself is additionally | 343 // back to JavaScript. SharedFunctionInfo object itself is additionally |
344 // wrapped into BlindReference for sanitizing reasons. | 344 // wrapped into BlindReference for sanitizing reasons. |
345 class SharedInfoWrapper : public JSArrayBasedStruct<SharedInfoWrapper> { | 345 class SharedInfoWrapper : public JSArrayBasedStruct<SharedInfoWrapper> { |
346 public: | 346 public: |
(...skipping 24 matching lines...) Expand all Loading... |
371 static const int kEndPositionOffset_ = 2; | 371 static const int kEndPositionOffset_ = 2; |
372 static const int kSharedInfoOffset_ = 3; | 372 static const int kSharedInfoOffset_ = 3; |
373 static const int kSize_ = 4; | 373 static const int kSize_ = 4; |
374 | 374 |
375 friend class JSArrayBasedStruct<SharedInfoWrapper>; | 375 friend class JSArrayBasedStruct<SharedInfoWrapper>; |
376 }; | 376 }; |
377 | 377 |
378 } } // namespace v8::internal | 378 } } // namespace v8::internal |
379 | 379 |
380 #endif /* V*_LIVEEDIT_H_ */ | 380 #endif /* V*_LIVEEDIT_H_ */ |
OLD | NEW |