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

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

Issue 8574053: Add ia32 FastCloneShallowArrayStub that copies all boilerplate kinds. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: review feedback Created 9 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 | « no previous file | src/ia32/code-stubs-ia32.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 348
349 349
350 class FastCloneShallowArrayStub : public CodeStub { 350 class FastCloneShallowArrayStub : public CodeStub {
351 public: 351 public:
352 // Maximum length of copied elements array. 352 // Maximum length of copied elements array.
353 static const int kMaximumClonedLength = 8; 353 static const int kMaximumClonedLength = 8;
354 354
355 enum Mode { 355 enum Mode {
356 CLONE_ELEMENTS, 356 CLONE_ELEMENTS,
357 CLONE_DOUBLE_ELEMENTS, 357 CLONE_DOUBLE_ELEMENTS,
358 COPY_ON_WRITE_ELEMENTS 358 COPY_ON_WRITE_ELEMENTS,
359 CLONE_ANY_ELEMENTS
359 }; 360 };
360 361
361 FastCloneShallowArrayStub(Mode mode, int length) 362 FastCloneShallowArrayStub(Mode mode, int length)
362 : mode_(mode), 363 : mode_(mode),
363 length_((mode == COPY_ON_WRITE_ELEMENTS) ? 0 : length) { 364 length_((mode == COPY_ON_WRITE_ELEMENTS) ? 0 : length) {
364 ASSERT(length_ >= 0); 365 ASSERT(length_ >= 0);
365 ASSERT(length_ <= kMaximumClonedLength); 366 ASSERT(length_ <= kMaximumClonedLength);
366 } 367 }
367 368
368 void Generate(MacroAssembler* masm); 369 void Generate(MacroAssembler* masm);
369 370
370 private: 371 private:
371 Mode mode_; 372 Mode mode_;
372 int length_; 373 int length_;
373 374
374 Major MajorKey() { return FastCloneShallowArray; } 375 Major MajorKey() { return FastCloneShallowArray; }
375 int MinorKey() { 376 int MinorKey() {
376 ASSERT(mode_ == 0 || mode_ == 1 || mode_ == 2); 377 ASSERT(mode_ == 0 || mode_ == 1 || mode_ == 2 || mode_ == 3);
377 return length_ * 3 + mode_; 378 return length_ * 4 + mode_;
378 } 379 }
379 }; 380 };
380 381
381 382
382 class InstanceofStub: public CodeStub { 383 class InstanceofStub: public CodeStub {
383 public: 384 public:
384 enum Flags { 385 enum Flags {
385 kNoFlags = 0, 386 kNoFlags = 0,
386 kArgsInRegisters = 1 << 0, 387 kArgsInRegisters = 1 << 0,
387 kCallSiteInlineCheck = 1 << 1, 388 kCallSiteInlineCheck = 1 << 1,
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
1062 int MinorKey() { return 0; } 1063 int MinorKey() { return 0; }
1063 1064
1064 void Generate(MacroAssembler* masm); 1065 void Generate(MacroAssembler* masm);
1065 1066
1066 DISALLOW_COPY_AND_ASSIGN(StoreArrayLiteralElementStub); 1067 DISALLOW_COPY_AND_ASSIGN(StoreArrayLiteralElementStub);
1067 }; 1068 };
1068 1069
1069 } } // namespace v8::internal 1070 } } // namespace v8::internal
1070 1071
1071 #endif // V8_CODE_STUBS_H_ 1072 #endif // V8_CODE_STUBS_H_
OLDNEW
« no previous file with comments | « no previous file | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698