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