| OLD | NEW |
| 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 }; | 356 }; |
| 357 | 357 |
| 358 | 358 |
| 359 class FastCloneShallowArrayStub : public CodeStub { | 359 class FastCloneShallowArrayStub : public CodeStub { |
| 360 public: | 360 public: |
| 361 // Maximum length of copied elements array. | 361 // Maximum length of copied elements array. |
| 362 static const int kMaximumClonedLength = 8; | 362 static const int kMaximumClonedLength = 8; |
| 363 | 363 |
| 364 enum Mode { | 364 enum Mode { |
| 365 CLONE_ELEMENTS, | 365 CLONE_ELEMENTS, |
| 366 CLONE_DOUBLE_ELEMENTS, |
| 366 COPY_ON_WRITE_ELEMENTS | 367 COPY_ON_WRITE_ELEMENTS |
| 367 }; | 368 }; |
| 368 | 369 |
| 369 FastCloneShallowArrayStub(Mode mode, int length) | 370 FastCloneShallowArrayStub(Mode mode, int length) |
| 370 : mode_(mode), | 371 : mode_(mode), |
| 371 length_((mode == COPY_ON_WRITE_ELEMENTS) ? 0 : length) { | 372 length_((mode == COPY_ON_WRITE_ELEMENTS) ? 0 : length) { |
| 372 ASSERT(length_ >= 0); | 373 ASSERT(length_ >= 0); |
| 373 ASSERT(length_ <= kMaximumClonedLength); | 374 ASSERT(length_ <= kMaximumClonedLength); |
| 374 } | 375 } |
| 375 | 376 |
| 376 void Generate(MacroAssembler* masm); | 377 void Generate(MacroAssembler* masm); |
| 377 | 378 |
| 378 private: | 379 private: |
| 379 Mode mode_; | 380 Mode mode_; |
| 380 int length_; | 381 int length_; |
| 381 | 382 |
| 382 Major MajorKey() { return FastCloneShallowArray; } | 383 Major MajorKey() { return FastCloneShallowArray; } |
| 383 int MinorKey() { | 384 int MinorKey() { |
| 384 ASSERT(mode_ == 0 || mode_ == 1); | 385 ASSERT(mode_ == 0 || mode_ == 1 || mode_ == 2); |
| 385 return (length_ << 1) | mode_; | 386 return length_ * 3 + mode_; |
| 386 } | 387 } |
| 387 }; | 388 }; |
| 388 | 389 |
| 389 | 390 |
| 390 class InstanceofStub: public CodeStub { | 391 class InstanceofStub: public CodeStub { |
| 391 public: | 392 public: |
| 392 enum Flags { | 393 enum Flags { |
| 393 kNoFlags = 0, | 394 kNoFlags = 0, |
| 394 kArgsInRegisters = 1 << 0, | 395 kArgsInRegisters = 1 << 0, |
| 395 kCallSiteInlineCheck = 1 << 1, | 396 kCallSiteInlineCheck = 1 << 1, |
| (...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1063 ElementsKind to_; | 1064 ElementsKind to_; |
| 1064 bool is_jsarray_; | 1065 bool is_jsarray_; |
| 1065 StrictModeFlag strict_mode_; | 1066 StrictModeFlag strict_mode_; |
| 1066 | 1067 |
| 1067 DISALLOW_COPY_AND_ASSIGN(FastElementsConversionStub); | 1068 DISALLOW_COPY_AND_ASSIGN(FastElementsConversionStub); |
| 1068 }; | 1069 }; |
| 1069 | 1070 |
| 1070 } } // namespace v8::internal | 1071 } } // namespace v8::internal |
| 1071 | 1072 |
| 1072 #endif // V8_CODE_STUBS_H_ | 1073 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |