| 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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 | 266 |
| 267 private: | 267 private: |
| 268 const char* GetName() { return "FastNewClosureStub"; } | 268 const char* GetName() { return "FastNewClosureStub"; } |
| 269 Major MajorKey() { return FastNewClosure; } | 269 Major MajorKey() { return FastNewClosure; } |
| 270 int MinorKey() { return 0; } | 270 int MinorKey() { return 0; } |
| 271 }; | 271 }; |
| 272 | 272 |
| 273 | 273 |
| 274 class FastNewContextStub : public CodeStub { | 274 class FastNewContextStub : public CodeStub { |
| 275 public: | 275 public: |
| 276 static const int kMaximumSlots = 64; | 276 // We want no more than 64 different stubs. |
| 277 static const int kMaximumSlots = Context::MIN_CONTEXT_SLOTS + 63; |
| 277 | 278 |
| 278 explicit FastNewContextStub(int slots) : slots_(slots) { | 279 explicit FastNewContextStub(int slots) : slots_(slots) { |
| 279 ASSERT(slots_ > 0 && slots <= kMaximumSlots); | 280 ASSERT(slots_ >= Context::MIN_CONTEXT_SLOTS && slots_ <= kMaximumSlots); |
| 280 } | 281 } |
| 281 | 282 |
| 282 void Generate(MacroAssembler* masm); | 283 void Generate(MacroAssembler* masm); |
| 283 | 284 |
| 284 private: | 285 private: |
| 286 virtual const char* GetName() { return "FastNewContextStub"; } |
| 287 virtual Major MajorKey() { return FastNewContext; } |
| 288 virtual int MinorKey() { return slots_; } |
| 289 |
| 285 int slots_; | 290 int slots_; |
| 286 | |
| 287 const char* GetName() { return "FastNewContextStub"; } | |
| 288 Major MajorKey() { return FastNewContext; } | |
| 289 int MinorKey() { return slots_; } | |
| 290 }; | 291 }; |
| 291 | 292 |
| 292 | 293 |
| 293 class FastCloneShallowArrayStub : public CodeStub { | 294 class FastCloneShallowArrayStub : public CodeStub { |
| 294 public: | 295 public: |
| 295 // Maximum length of copied elements array. | 296 // Maximum length of copied elements array. |
| 296 static const int kMaximumClonedLength = 8; | 297 static const int kMaximumClonedLength = 8; |
| 297 | 298 |
| 298 enum Mode { | 299 enum Mode { |
| 299 CLONE_ELEMENTS, | 300 CLONE_ELEMENTS, |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 private: | 931 private: |
| 931 MacroAssembler* masm_; | 932 MacroAssembler* masm_; |
| 932 bool previous_allow_; | 933 bool previous_allow_; |
| 933 | 934 |
| 934 DISALLOW_COPY_AND_ASSIGN(AllowStubCallsScope); | 935 DISALLOW_COPY_AND_ASSIGN(AllowStubCallsScope); |
| 935 }; | 936 }; |
| 936 | 937 |
| 937 } } // namespace v8::internal | 938 } } // namespace v8::internal |
| 938 | 939 |
| 939 #endif // V8_CODE_STUBS_H_ | 940 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |