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