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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 /* them can't cause a new stub to be compiled, so compiling a call to */ \ | 55 /* them can't cause a new stub to be compiled, so compiling a call to */ \ |
56 /* them is GC safe. The ones below this line exist in many variants */ \ | 56 /* them is GC safe. The ones below this line exist in many variants */ \ |
57 /* so code compiling a call to one can cause a GC. This means they */ \ | 57 /* so code compiling a call to one can cause a GC. This means they */ \ |
58 /* can't be called from other stubs, since stub generation code is */ \ | 58 /* can't be called from other stubs, since stub generation code is */ \ |
59 /* not GC safe. */ \ | 59 /* not GC safe. */ \ |
60 V(ConvertToDouble) \ | 60 V(ConvertToDouble) \ |
61 V(WriteInt32ToHeapNumber) \ | 61 V(WriteInt32ToHeapNumber) \ |
62 V(StackCheck) \ | 62 V(StackCheck) \ |
63 V(FastNewClosure) \ | 63 V(FastNewClosure) \ |
64 V(FastNewContext) \ | 64 V(FastNewContext) \ |
| 65 V(FastNewBlockContext) \ |
65 V(FastCloneShallowArray) \ | 66 V(FastCloneShallowArray) \ |
66 V(RevertToNumber) \ | 67 V(RevertToNumber) \ |
67 V(ToBoolean) \ | 68 V(ToBoolean) \ |
68 V(ToNumber) \ | 69 V(ToNumber) \ |
69 V(CounterOp) \ | 70 V(CounterOp) \ |
70 V(ArgumentsAccess) \ | 71 V(ArgumentsAccess) \ |
71 V(RegExpConstructResult) \ | 72 V(RegExpConstructResult) \ |
72 V(NumberToString) \ | 73 V(NumberToString) \ |
73 V(CEntry) \ | 74 V(CEntry) \ |
74 V(JSEntry) \ | 75 V(JSEntry) \ |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 | 330 |
330 StrictModeFlag strict_mode_; | 331 StrictModeFlag strict_mode_; |
331 }; | 332 }; |
332 | 333 |
333 | 334 |
334 class FastNewContextStub : public CodeStub { | 335 class FastNewContextStub : public CodeStub { |
335 public: | 336 public: |
336 static const int kMaximumSlots = 64; | 337 static const int kMaximumSlots = 64; |
337 | 338 |
338 explicit FastNewContextStub(int slots) : slots_(slots) { | 339 explicit FastNewContextStub(int slots) : slots_(slots) { |
339 ASSERT(slots_ > 0 && slots <= kMaximumSlots); | 340 ASSERT(slots_ > 0 && slots_ <= kMaximumSlots); |
340 } | 341 } |
341 | 342 |
342 void Generate(MacroAssembler* masm); | 343 void Generate(MacroAssembler* masm); |
343 | 344 |
344 private: | 345 private: |
345 int slots_; | 346 int slots_; |
346 | 347 |
347 Major MajorKey() { return FastNewContext; } | 348 Major MajorKey() { return FastNewContext; } |
348 int MinorKey() { return slots_; } | 349 int MinorKey() { return slots_; } |
349 }; | 350 }; |
350 | 351 |
351 | 352 |
| 353 class FastNewBlockContextStub : public CodeStub { |
| 354 public: |
| 355 static const int kMaximumSlots = 64; |
| 356 |
| 357 explicit FastNewBlockContextStub(int slots) : slots_(slots) { |
| 358 ASSERT(slots_ > 0 && slots_ <= kMaximumSlots); |
| 359 } |
| 360 |
| 361 void Generate(MacroAssembler* masm); |
| 362 |
| 363 private: |
| 364 int slots_; |
| 365 |
| 366 Major MajorKey() { return FastNewBlockContext; } |
| 367 int MinorKey() { return slots_; } |
| 368 }; |
| 369 |
| 370 |
352 class FastCloneShallowArrayStub : public CodeStub { | 371 class FastCloneShallowArrayStub : public CodeStub { |
353 public: | 372 public: |
354 // Maximum length of copied elements array. | 373 // Maximum length of copied elements array. |
355 static const int kMaximumClonedLength = 8; | 374 static const int kMaximumClonedLength = 8; |
356 | 375 |
357 enum Mode { | 376 enum Mode { |
358 CLONE_ELEMENTS, | 377 CLONE_ELEMENTS, |
359 COPY_ON_WRITE_ELEMENTS | 378 COPY_ON_WRITE_ELEMENTS |
360 }; | 379 }; |
361 | 380 |
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1014 bool result); | 1033 bool result); |
1015 void GenerateTypeTransition(MacroAssembler* masm); | 1034 void GenerateTypeTransition(MacroAssembler* masm); |
1016 | 1035 |
1017 Register tos_; | 1036 Register tos_; |
1018 Types types_; | 1037 Types types_; |
1019 }; | 1038 }; |
1020 | 1039 |
1021 } } // namespace v8::internal | 1040 } } // namespace v8::internal |
1022 | 1041 |
1023 #endif // V8_CODE_STUBS_H_ | 1042 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |