 Chromium Code Reviews
 Chromium Code Reviews Issue 11663005:
  Adapt Danno's Track Allocation Info idea to fast literals. When allocating a literal array,  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
    
  
    Issue 11663005:
  Adapt Danno's Track Allocation Info idea to fast literals. When allocating a literal array,  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge| 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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 415 | 415 | 
| 416 Major MajorKey() { return FastNewBlockContext; } | 416 Major MajorKey() { return FastNewBlockContext; } | 
| 417 int MinorKey() { return slots_; } | 417 int MinorKey() { return slots_; } | 
| 418 }; | 418 }; | 
| 419 | 419 | 
| 420 | 420 | 
| 421 class FastCloneShallowArrayStub : public PlatformCodeStub { | 421 class FastCloneShallowArrayStub : public PlatformCodeStub { | 
| 422 public: | 422 public: | 
| 423 // Maximum length of copied elements array. | 423 // Maximum length of copied elements array. | 
| 424 static const int kMaximumClonedLength = 8; | 424 static const int kMaximumClonedLength = 8; | 
| 425 | |
| 426 enum Mode { | 425 enum Mode { | 
| 427 CLONE_ELEMENTS, | 426 CLONE_ELEMENTS, | 
| 428 CLONE_DOUBLE_ELEMENTS, | 427 CLONE_DOUBLE_ELEMENTS, | 
| 429 COPY_ON_WRITE_ELEMENTS, | 428 COPY_ON_WRITE_ELEMENTS, | 
| 430 CLONE_ANY_ELEMENTS | 429 CLONE_ANY_ELEMENTS, | 
| 430 CLONE_ANY_ELEMENTS_WITH_ALLOCATION_INFO, | |
| 
danno
2013/01/04 08:50:55
CLONE_ANY_ELEMENTS_WITH_ALLOCATION_SITE_INFO?
 
mvstanton
2013/01/04 12:07:52
Done.
 | |
| 431 LAST_CLONE_MODE = CLONE_ANY_ELEMENTS_WITH_ALLOCATION_INFO | |
| 431 }; | 432 }; | 
| 432 | 433 | 
| 434 static const int kFastCloneModeCount = LAST_CLONE_MODE + 1; | |
| 435 | |
| 436 // The stub generator likes to treat the allocation info mode separately. | |
| 437 enum AllocationInfoMode { | |
| 
danno
2013/01/04 08:50:55
AllocationSiteInfoMode?
 
mvstanton
2013/01/04 12:07:52
Done.
 | |
| 438 DONT_TRACK_ALLOCATION_INFO, | |
| 439 TRACK_ALLOCATION_INFO | |
| 440 }; | |
| 
danno
2013/01/04 08:50:55
Soon this will be used for other things, so I thin
 
mvstanton
2013/01/04 12:07:52
Done.
 | |
| 441 | |
| 433 FastCloneShallowArrayStub(Mode mode, int length) | 442 FastCloneShallowArrayStub(Mode mode, int length) | 
| 434 : mode_(mode), | 443 : mode_(mode), | 
| 435 length_((mode == COPY_ON_WRITE_ELEMENTS) ? 0 : length) { | 444 length_((mode == COPY_ON_WRITE_ELEMENTS) ? 0 : length) { | 
| 436 ASSERT_GE(length_, 0); | 445 ASSERT_GE(length_, 0); | 
| 437 ASSERT_LE(length_, kMaximumClonedLength); | 446 ASSERT_LE(length_, kMaximumClonedLength); | 
| 438 } | 447 } | 
| 439 | 448 | 
| 440 void Generate(MacroAssembler* masm); | 449 void Generate(MacroAssembler* masm); | 
| 441 | 450 | 
| 442 private: | 451 private: | 
| 443 Mode mode_; | 452 Mode mode_; | 
| 444 int length_; | 453 int length_; | 
| 445 | 454 | 
| 446 Major MajorKey() { return FastCloneShallowArray; } | 455 Major MajorKey() { return FastCloneShallowArray; } | 
| 447 int MinorKey() { | 456 int MinorKey() { | 
| 448 ASSERT(mode_ == 0 || mode_ == 1 || mode_ == 2 || mode_ == 3); | 457 ASSERT(mode_ >= 0 && mode_ <= LAST_CLONE_MODE); | 
| 449 return length_ * 4 + mode_; | 458 return length_ * kFastCloneModeCount + mode_; | 
| 450 } | 459 } | 
| 451 }; | 460 }; | 
| 452 | 461 | 
| 453 | 462 | 
| 454 class FastCloneShallowObjectStub : public PlatformCodeStub { | 463 class FastCloneShallowObjectStub : public PlatformCodeStub { | 
| 455 public: | 464 public: | 
| 456 // Maximum number of properties in copied object. | 465 // Maximum number of properties in copied object. | 
| 457 static const int kMaximumClonedProperties = 6; | 466 static const int kMaximumClonedProperties = 6; | 
| 458 | 467 | 
| 459 explicit FastCloneShallowObjectStub(int length) : length_(length) { | 468 explicit FastCloneShallowObjectStub(int length) : length_(length) { | 
| (...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1298 | 1307 | 
| 1299 // The current function entry hook. | 1308 // The current function entry hook. | 
| 1300 static FunctionEntryHook entry_hook_; | 1309 static FunctionEntryHook entry_hook_; | 
| 1301 | 1310 | 
| 1302 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); | 1311 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); | 
| 1303 }; | 1312 }; | 
| 1304 | 1313 | 
| 1305 } } // namespace v8::internal | 1314 } } // namespace v8::internal | 
| 1306 | 1315 | 
| 1307 #endif // V8_CODE_STUBS_H_ | 1316 #endif // V8_CODE_STUBS_H_ | 
| OLD | NEW |