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

Side by Side Diff: src/liveedit.h

Issue 670953003: Move feedback slot allocation to post-pass (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased patch Created 6 years, 1 month 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/full-codegen.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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, int start_position, 283 void SetInitialProperties(Handle<String> name, int start_position,
284 int end_position, int param_num, int literal_count, 284 int end_position, int param_num, int literal_count,
285 int slot_count, int ic_slot_count,
286 int parent_index); 285 int parent_index);
287 286
288 void SetFunctionCode(Handle<Code> function_code, 287 void SetFunctionCode(Handle<Code> function_code,
289 Handle<HeapObject> code_scope_info); 288 Handle<HeapObject> code_scope_info);
290 289
291 void SetFunctionScopeInfo(Handle<Object> scope_info_array) { 290 void SetFunctionScopeInfo(Handle<Object> scope_info_array) {
292 this->SetField(kFunctionScopeInfoOffset_, scope_info_array); 291 this->SetField(kFunctionScopeInfoOffset_, scope_info_array);
293 } 292 }
294 293
295 void SetSharedFunctionInfo(Handle<SharedFunctionInfo> info); 294 void SetSharedFunctionInfo(Handle<SharedFunctionInfo> info);
296 295
297 int GetLiteralCount() { 296 int GetLiteralCount() {
298 return this->GetSmiValueField(kLiteralNumOffset_); 297 return this->GetSmiValueField(kLiteralNumOffset_);
299 } 298 }
300 299
301 int GetParentIndex() { 300 int GetParentIndex() {
302 return this->GetSmiValueField(kParentIndexOffset_); 301 return this->GetSmiValueField(kParentIndexOffset_);
303 } 302 }
304 303
305 Handle<Code> GetFunctionCode(); 304 Handle<Code> GetFunctionCode();
306 305
307 Handle<TypeFeedbackVector> GetFeedbackVector(); 306 MaybeHandle<TypeFeedbackVector> GetFeedbackVector();
308 307
309 Handle<Object> GetCodeScopeInfo(); 308 Handle<Object> GetCodeScopeInfo();
310 309
311 int GetStartPosition() { 310 int GetStartPosition() {
312 return this->GetSmiValueField(kStartPositionOffset_); 311 return this->GetSmiValueField(kStartPositionOffset_);
313 } 312 }
314 313
315 int GetEndPosition() { return this->GetSmiValueField(kEndPositionOffset_); } 314 int GetEndPosition() { return this->GetSmiValueField(kEndPositionOffset_); }
316 315
317 int GetSlotCount() {
318 return this->GetSmiValueField(kSlotNumOffset_);
319 }
320
321 int GetICSlotCount() { return this->GetSmiValueField(kICSlotNumOffset_); }
322
323 private: 316 private:
324 static const int kFunctionNameOffset_ = 0; 317 static const int kFunctionNameOffset_ = 0;
325 static const int kStartPositionOffset_ = 1; 318 static const int kStartPositionOffset_ = 1;
326 static const int kEndPositionOffset_ = 2; 319 static const int kEndPositionOffset_ = 2;
327 static const int kParamNumOffset_ = 3; 320 static const int kParamNumOffset_ = 3;
328 static const int kCodeOffset_ = 4; 321 static const int kCodeOffset_ = 4;
329 static const int kCodeScopeInfoOffset_ = 5; 322 static const int kCodeScopeInfoOffset_ = 5;
330 static const int kFunctionScopeInfoOffset_ = 6; 323 static const int kFunctionScopeInfoOffset_ = 6;
331 static const int kParentIndexOffset_ = 7; 324 static const int kParentIndexOffset_ = 7;
332 static const int kSharedFunctionInfoOffset_ = 8; 325 static const int kSharedFunctionInfoOffset_ = 8;
333 static const int kLiteralNumOffset_ = 9; 326 static const int kLiteralNumOffset_ = 9;
334 static const int kSlotNumOffset_ = 10; 327 static const int kSize_ = 10;
335 static const int kICSlotNumOffset_ = 11;
336 static const int kSize_ = 12;
337 328
338 friend class JSArrayBasedStruct<FunctionInfoWrapper>; 329 friend class JSArrayBasedStruct<FunctionInfoWrapper>;
339 }; 330 };
340 331
341 332
342 // Wraps SharedFunctionInfo along with some of its fields for passing it 333 // Wraps SharedFunctionInfo along with some of its fields for passing it
343 // back to JavaScript. SharedFunctionInfo object itself is additionally 334 // back to JavaScript. SharedFunctionInfo object itself is additionally
344 // wrapped into BlindReference for sanitizing reasons. 335 // wrapped into BlindReference for sanitizing reasons.
345 class SharedInfoWrapper : public JSArrayBasedStruct<SharedInfoWrapper> { 336 class SharedInfoWrapper : public JSArrayBasedStruct<SharedInfoWrapper> {
346 public: 337 public:
(...skipping 24 matching lines...) Expand all
371 static const int kEndPositionOffset_ = 2; 362 static const int kEndPositionOffset_ = 2;
372 static const int kSharedInfoOffset_ = 3; 363 static const int kSharedInfoOffset_ = 3;
373 static const int kSize_ = 4; 364 static const int kSize_ = 4;
374 365
375 friend class JSArrayBasedStruct<SharedInfoWrapper>; 366 friend class JSArrayBasedStruct<SharedInfoWrapper>;
376 }; 367 };
377 368
378 } } // namespace v8::internal 369 } } // namespace v8::internal
379 370
380 #endif /* V*_LIVEEDIT_H_ */ 371 #endif /* V*_LIVEEDIT_H_ */
OLDNEW
« no previous file with comments | « src/full-codegen.cc ('k') | src/liveedit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698