| 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 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 int MinorKey() { return 1; } | 647 int MinorKey() { return 1; } |
| 648 | 648 |
| 649 const char* GetName() { return "JSConstructEntryStub"; } | 649 const char* GetName() { return "JSConstructEntryStub"; } |
| 650 }; | 650 }; |
| 651 | 651 |
| 652 | 652 |
| 653 class ArgumentsAccessStub: public CodeStub { | 653 class ArgumentsAccessStub: public CodeStub { |
| 654 public: | 654 public: |
| 655 enum Type { | 655 enum Type { |
| 656 READ_ELEMENT, | 656 READ_ELEMENT, |
| 657 NEW_OBJECT | 657 NEW_NON_STRICT, |
| 658 NEW_STRICT |
| 658 }; | 659 }; |
| 659 | 660 |
| 660 explicit ArgumentsAccessStub(Type type) : type_(type) { } | 661 explicit ArgumentsAccessStub(Type type) : type_(type) { } |
| 661 | 662 |
| 662 private: | 663 private: |
| 663 Type type_; | 664 Type type_; |
| 664 | 665 |
| 665 Major MajorKey() { return ArgumentsAccess; } | 666 Major MajorKey() { return ArgumentsAccess; } |
| 666 int MinorKey() { return type_; } | 667 int MinorKey() { return type_; } |
| 667 | 668 |
| 668 void Generate(MacroAssembler* masm); | 669 void Generate(MacroAssembler* masm); |
| 669 void GenerateReadElement(MacroAssembler* masm); | 670 void GenerateReadElement(MacroAssembler* masm); |
| 670 void GenerateNewObject(MacroAssembler* masm); | 671 void GenerateNewObject(MacroAssembler* masm); |
| 671 | 672 |
| 673 int GetArgumentsBoilerplateIndex() const { |
| 674 return (type_ == NEW_STRICT) |
| 675 ? Context::STRICT_MODE_ARGUMENTS_BOILERPLATE_INDEX |
| 676 : Context::ARGUMENTS_BOILERPLATE_INDEX; |
| 677 } |
| 678 |
| 679 int GetArgumentsObjectSize() const { |
| 680 return (type_ == NEW_STRICT) |
| 681 ? Heap::kArgumentsObjectSizeStrict |
| 682 : Heap::kArgumentsObjectSize; |
| 683 } |
| 684 |
| 672 const char* GetName() { return "ArgumentsAccessStub"; } | 685 const char* GetName() { return "ArgumentsAccessStub"; } |
| 673 | 686 |
| 674 #ifdef DEBUG | 687 #ifdef DEBUG |
| 675 void Print() { | 688 void Print() { |
| 676 PrintF("ArgumentsAccessStub (type %d)\n", type_); | 689 PrintF("ArgumentsAccessStub (type %d)\n", type_); |
| 677 } | 690 } |
| 678 #endif | 691 #endif |
| 679 }; | 692 }; |
| 680 | 693 |
| 681 | 694 |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 private: | 947 private: |
| 935 MacroAssembler* masm_; | 948 MacroAssembler* masm_; |
| 936 bool previous_allow_; | 949 bool previous_allow_; |
| 937 | 950 |
| 938 DISALLOW_COPY_AND_ASSIGN(AllowStubCallsScope); | 951 DISALLOW_COPY_AND_ASSIGN(AllowStubCallsScope); |
| 939 }; | 952 }; |
| 940 | 953 |
| 941 } } // namespace v8::internal | 954 } } // namespace v8::internal |
| 942 | 955 |
| 943 #endif // V8_CODE_STUBS_H_ | 956 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |