| 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 | 272 |
| 273 private: | 273 private: |
| 274 Major MajorKey() { return ToNumber; } | 274 Major MajorKey() { return ToNumber; } |
| 275 int MinorKey() { return 0; } | 275 int MinorKey() { return 0; } |
| 276 const char* GetName() { return "ToNumberStub"; } | 276 const char* GetName() { return "ToNumberStub"; } |
| 277 }; | 277 }; |
| 278 | 278 |
| 279 | 279 |
| 280 class FastNewClosureStub : public CodeStub { | 280 class FastNewClosureStub : public CodeStub { |
| 281 public: | 281 public: |
| 282 explicit FastNewClosureStub(StrictModeFlag strict_mode) |
| 283 : strict_mode_(strict_mode) { } |
| 284 |
| 282 void Generate(MacroAssembler* masm); | 285 void Generate(MacroAssembler* masm); |
| 283 | 286 |
| 284 private: | 287 private: |
| 285 const char* GetName() { return "FastNewClosureStub"; } | 288 const char* GetName() { return "FastNewClosureStub"; } |
| 286 Major MajorKey() { return FastNewClosure; } | 289 Major MajorKey() { return FastNewClosure; } |
| 287 int MinorKey() { return 0; } | 290 int MinorKey() { return strict_mode_; } |
| 291 |
| 292 StrictModeFlag strict_mode_; |
| 288 }; | 293 }; |
| 289 | 294 |
| 290 | 295 |
| 291 class FastNewContextStub : public CodeStub { | 296 class FastNewContextStub : public CodeStub { |
| 292 public: | 297 public: |
| 293 static const int kMaximumSlots = 64; | 298 static const int kMaximumSlots = 64; |
| 294 | 299 |
| 295 explicit FastNewContextStub(int slots) : slots_(slots) { | 300 explicit FastNewContextStub(int slots) : slots_(slots) { |
| 296 ASSERT(slots_ > 0 && slots <= kMaximumSlots); | 301 ASSERT(slots_ > 0 && slots <= kMaximumSlots); |
| 297 } | 302 } |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 int MinorKey() { return 1; } | 654 int MinorKey() { return 1; } |
| 650 | 655 |
| 651 const char* GetName() { return "JSConstructEntryStub"; } | 656 const char* GetName() { return "JSConstructEntryStub"; } |
| 652 }; | 657 }; |
| 653 | 658 |
| 654 | 659 |
| 655 class ArgumentsAccessStub: public CodeStub { | 660 class ArgumentsAccessStub: public CodeStub { |
| 656 public: | 661 public: |
| 657 enum Type { | 662 enum Type { |
| 658 READ_ELEMENT, | 663 READ_ELEMENT, |
| 659 NEW_OBJECT | 664 NEW_NON_STRICT, |
| 665 NEW_STRICT |
| 660 }; | 666 }; |
| 661 | 667 |
| 662 explicit ArgumentsAccessStub(Type type) : type_(type) { } | 668 explicit ArgumentsAccessStub(Type type) : type_(type) { } |
| 663 | 669 |
| 664 private: | 670 private: |
| 665 Type type_; | 671 Type type_; |
| 666 | 672 |
| 667 Major MajorKey() { return ArgumentsAccess; } | 673 Major MajorKey() { return ArgumentsAccess; } |
| 668 int MinorKey() { return type_; } | 674 int MinorKey() { return type_; } |
| 669 | 675 |
| 670 void Generate(MacroAssembler* masm); | 676 void Generate(MacroAssembler* masm); |
| 671 void GenerateReadElement(MacroAssembler* masm); | 677 void GenerateReadElement(MacroAssembler* masm); |
| 672 void GenerateNewObject(MacroAssembler* masm); | 678 void GenerateNewObject(MacroAssembler* masm); |
| 673 | 679 |
| 680 int GetArgumentsBoilerplateIndex() const { |
| 681 return (type_ == NEW_STRICT) |
| 682 ? Context::STRICT_MODE_ARGUMENTS_BOILERPLATE_INDEX |
| 683 : Context::ARGUMENTS_BOILERPLATE_INDEX; |
| 684 } |
| 685 |
| 686 int GetArgumentsObjectSize() const { |
| 687 if (type_ == NEW_STRICT) |
| 688 return Heap::kArgumentsObjectSizeStrict; |
| 689 else |
| 690 return Heap::kArgumentsObjectSize; |
| 691 } |
| 692 |
| 674 const char* GetName() { return "ArgumentsAccessStub"; } | 693 const char* GetName() { return "ArgumentsAccessStub"; } |
| 675 | 694 |
| 676 #ifdef DEBUG | 695 #ifdef DEBUG |
| 677 void Print() { | 696 void Print() { |
| 678 PrintF("ArgumentsAccessStub (type %d)\n", type_); | 697 PrintF("ArgumentsAccessStub (type %d)\n", type_); |
| 679 } | 698 } |
| 680 #endif | 699 #endif |
| 681 }; | 700 }; |
| 682 | 701 |
| 683 | 702 |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 936 private: | 955 private: |
| 937 MacroAssembler* masm_; | 956 MacroAssembler* masm_; |
| 938 bool previous_allow_; | 957 bool previous_allow_; |
| 939 | 958 |
| 940 DISALLOW_COPY_AND_ASSIGN(AllowStubCallsScope); | 959 DISALLOW_COPY_AND_ASSIGN(AllowStubCallsScope); |
| 941 }; | 960 }; |
| 942 | 961 |
| 943 } } // namespace v8::internal | 962 } } // namespace v8::internal |
| 944 | 963 |
| 945 #endif // V8_CODE_STUBS_H_ | 964 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |