OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 public: | 237 public: |
238 explicit FunctionInfoWrapper(Handle<JSArray> array) | 238 explicit FunctionInfoWrapper(Handle<JSArray> array) |
239 : JSArrayBasedStruct<FunctionInfoWrapper>(array) { | 239 : JSArrayBasedStruct<FunctionInfoWrapper>(array) { |
240 } | 240 } |
241 | 241 |
242 void SetInitialProperties(Handle<String> name, | 242 void SetInitialProperties(Handle<String> name, |
243 int start_position, | 243 int start_position, |
244 int end_position, | 244 int end_position, |
245 int param_num, | 245 int param_num, |
246 int literal_count, | 246 int literal_count, |
| 247 int slot_count, |
247 int parent_index); | 248 int parent_index); |
248 | 249 |
249 void SetFunctionCode(Handle<Code> function_code, | 250 void SetFunctionCode(Handle<Code> function_code, |
250 Handle<HeapObject> code_scope_info); | 251 Handle<HeapObject> code_scope_info); |
251 | 252 |
252 void SetFunctionScopeInfo(Handle<Object> scope_info_array) { | 253 void SetFunctionScopeInfo(Handle<Object> scope_info_array) { |
253 this->SetField(kFunctionScopeInfoOffset_, scope_info_array); | 254 this->SetField(kFunctionScopeInfoOffset_, scope_info_array); |
254 } | 255 } |
255 | 256 |
256 void SetSharedFunctionInfo(Handle<SharedFunctionInfo> info); | 257 void SetSharedFunctionInfo(Handle<SharedFunctionInfo> info); |
257 | 258 |
258 int GetLiteralCount() { | 259 int GetLiteralCount() { |
259 return this->GetSmiValueField(kLiteralNumOffset_); | 260 return this->GetSmiValueField(kLiteralNumOffset_); |
260 } | 261 } |
261 | 262 |
262 int GetParentIndex() { | 263 int GetParentIndex() { |
263 return this->GetSmiValueField(kParentIndexOffset_); | 264 return this->GetSmiValueField(kParentIndexOffset_); |
264 } | 265 } |
265 | 266 |
266 Handle<Code> GetFunctionCode(); | 267 Handle<Code> GetFunctionCode(); |
267 | 268 |
| 269 Handle<FixedArray> GetFeedbackVector(); |
| 270 |
268 Handle<Object> GetCodeScopeInfo(); | 271 Handle<Object> GetCodeScopeInfo(); |
269 | 272 |
270 int GetStartPosition() { | 273 int GetStartPosition() { |
271 return this->GetSmiValueField(kStartPositionOffset_); | 274 return this->GetSmiValueField(kStartPositionOffset_); |
272 } | 275 } |
273 | 276 |
274 int GetEndPosition() { return this->GetSmiValueField(kEndPositionOffset_); } | 277 int GetEndPosition() { return this->GetSmiValueField(kEndPositionOffset_); } |
275 | 278 |
| 279 int GetSlotCount() { |
| 280 return this->GetSmiValueField(kSlotNumOffset_); |
| 281 } |
| 282 |
276 private: | 283 private: |
277 static const int kFunctionNameOffset_ = 0; | 284 static const int kFunctionNameOffset_ = 0; |
278 static const int kStartPositionOffset_ = 1; | 285 static const int kStartPositionOffset_ = 1; |
279 static const int kEndPositionOffset_ = 2; | 286 static const int kEndPositionOffset_ = 2; |
280 static const int kParamNumOffset_ = 3; | 287 static const int kParamNumOffset_ = 3; |
281 static const int kCodeOffset_ = 4; | 288 static const int kCodeOffset_ = 4; |
282 static const int kCodeScopeInfoOffset_ = 5; | 289 static const int kCodeScopeInfoOffset_ = 5; |
283 static const int kFunctionScopeInfoOffset_ = 6; | 290 static const int kFunctionScopeInfoOffset_ = 6; |
284 static const int kParentIndexOffset_ = 7; | 291 static const int kParentIndexOffset_ = 7; |
285 static const int kSharedFunctionInfoOffset_ = 8; | 292 static const int kSharedFunctionInfoOffset_ = 8; |
286 static const int kLiteralNumOffset_ = 9; | 293 static const int kLiteralNumOffset_ = 9; |
287 static const int kSize_ = 10; | 294 static const int kSlotNumOffset_ = 10; |
| 295 static const int kSize_ = 11; |
288 | 296 |
289 friend class JSArrayBasedStruct<FunctionInfoWrapper>; | 297 friend class JSArrayBasedStruct<FunctionInfoWrapper>; |
290 }; | 298 }; |
291 | 299 |
292 | 300 |
293 // Wraps SharedFunctionInfo along with some of its fields for passing it | 301 // Wraps SharedFunctionInfo along with some of its fields for passing it |
294 // back to JavaScript. SharedFunctionInfo object itself is additionally | 302 // back to JavaScript. SharedFunctionInfo object itself is additionally |
295 // wrapped into BlindReference for sanitizing reasons. | 303 // wrapped into BlindReference for sanitizing reasons. |
296 class SharedInfoWrapper : public JSArrayBasedStruct<SharedInfoWrapper> { | 304 class SharedInfoWrapper : public JSArrayBasedStruct<SharedInfoWrapper> { |
297 public: | 305 public: |
(...skipping 23 matching lines...) Expand all Loading... |
321 | 329 |
322 friend class JSArrayBasedStruct<SharedInfoWrapper>; | 330 friend class JSArrayBasedStruct<SharedInfoWrapper>; |
323 }; | 331 }; |
324 | 332 |
325 #endif // ENABLE_DEBUGGER_SUPPORT | 333 #endif // ENABLE_DEBUGGER_SUPPORT |
326 | 334 |
327 | 335 |
328 } } // namespace v8::internal | 336 } } // namespace v8::internal |
329 | 337 |
330 #endif /* V*_LIVEEDIT_H_ */ | 338 #endif /* V*_LIVEEDIT_H_ */ |
OLD | NEW |