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

Side by Side Diff: src/code-stubs.h

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
Patch Set: A few more review comments Created 7 years, 11 months 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/arm/macro-assembler-arm.cc ('k') | src/flag-definitions.h » ('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 // 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
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_SITE_INFO,
431 LAST_CLONE_MODE = CLONE_ANY_ELEMENTS_WITH_ALLOCATION_SITE_INFO
431 }; 432 };
432 433
434 static const int kFastCloneModeCount = LAST_CLONE_MODE + 1;
435
433 FastCloneShallowArrayStub(Mode mode, int length) 436 FastCloneShallowArrayStub(Mode mode, int length)
434 : mode_(mode), 437 : mode_(mode),
435 length_((mode == COPY_ON_WRITE_ELEMENTS) ? 0 : length) { 438 length_((mode == COPY_ON_WRITE_ELEMENTS) ? 0 : length) {
436 ASSERT_GE(length_, 0); 439 ASSERT_GE(length_, 0);
437 ASSERT_LE(length_, kMaximumClonedLength); 440 ASSERT_LE(length_, kMaximumClonedLength);
438 } 441 }
439 442
440 void Generate(MacroAssembler* masm); 443 void Generate(MacroAssembler* masm);
441 444
442 private: 445 private:
443 Mode mode_; 446 Mode mode_;
444 int length_; 447 int length_;
445 448
446 Major MajorKey() { return FastCloneShallowArray; } 449 Major MajorKey() { return FastCloneShallowArray; }
447 int MinorKey() { 450 int MinorKey() {
448 ASSERT(mode_ == 0 || mode_ == 1 || mode_ == 2 || mode_ == 3); 451 ASSERT(mode_ >= 0 && mode_ <= LAST_CLONE_MODE);
449 return length_ * 4 + mode_; 452 return length_ * kFastCloneModeCount + mode_;
450 } 453 }
451 }; 454 };
452 455
453 456
454 class FastCloneShallowObjectStub : public PlatformCodeStub { 457 class FastCloneShallowObjectStub : public PlatformCodeStub {
455 public: 458 public:
456 // Maximum number of properties in copied object. 459 // Maximum number of properties in copied object.
457 static const int kMaximumClonedProperties = 6; 460 static const int kMaximumClonedProperties = 6;
458 461
459 explicit FastCloneShallowObjectStub(int length) : length_(length) { 462 explicit FastCloneShallowObjectStub(int length) : length_(length) {
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 1301
1299 // The current function entry hook. 1302 // The current function entry hook.
1300 static FunctionEntryHook entry_hook_; 1303 static FunctionEntryHook entry_hook_;
1301 1304
1302 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); 1305 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub);
1303 }; 1306 };
1304 1307
1305 } } // namespace v8::internal 1308 } } // namespace v8::internal
1306 1309
1307 #endif // V8_CODE_STUBS_H_ 1310 #endif // V8_CODE_STUBS_H_
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698