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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
51 V(RegExpExec) \ | 51 V(RegExpExec) \ |
52 V(TranscendentalCache) \ | 52 V(TranscendentalCache) \ |
53 V(Instanceof) \ | 53 V(Instanceof) \ |
54 V(ConvertToDouble) \ | 54 V(ConvertToDouble) \ |
55 V(WriteInt32ToHeapNumber) \ | 55 V(WriteInt32ToHeapNumber) \ |
56 V(StackCheck) \ | 56 V(StackCheck) \ |
57 V(FastNewClosure) \ | 57 V(FastNewClosure) \ |
58 V(FastNewContext) \ | 58 V(FastNewContext) \ |
59 V(FastNewBlockContext) \ | 59 V(FastNewBlockContext) \ |
60 V(FastCloneShallowArray) \ | 60 V(FastCloneShallowArray) \ |
61 V(FastCloneShallowObject) \ | |
61 V(ToBoolean) \ | 62 V(ToBoolean) \ |
62 V(ToNumber) \ | 63 V(ToNumber) \ |
63 V(ArgumentsAccess) \ | 64 V(ArgumentsAccess) \ |
64 V(RegExpConstructResult) \ | 65 V(RegExpConstructResult) \ |
65 V(NumberToString) \ | 66 V(NumberToString) \ |
66 V(CEntry) \ | 67 V(CEntry) \ |
67 V(JSEntry) \ | 68 V(JSEntry) \ |
68 V(KeyedLoadElement) \ | 69 V(KeyedLoadElement) \ |
69 V(KeyedStoreElement) \ | 70 V(KeyedStoreElement) \ |
70 V(DebuggerStatement) \ | 71 V(DebuggerStatement) \ |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
373 int length_; | 374 int length_; |
374 | 375 |
375 Major MajorKey() { return FastCloneShallowArray; } | 376 Major MajorKey() { return FastCloneShallowArray; } |
376 int MinorKey() { | 377 int MinorKey() { |
377 ASSERT(mode_ == 0 || mode_ == 1 || mode_ == 2 || mode_ == 3); | 378 ASSERT(mode_ == 0 || mode_ == 1 || mode_ == 2 || mode_ == 3); |
378 return length_ * 4 + mode_; | 379 return length_ * 4 + mode_; |
379 } | 380 } |
380 }; | 381 }; |
381 | 382 |
382 | 383 |
384 class FastCloneShallowObjectStub : public CodeStub { | |
385 public: | |
386 // Maximum number of properties in copied object. | |
387 static const int kMaximumClonedProperties = 6; | |
388 | |
389 FastCloneShallowObjectStub(int length) : length_(length) { | |
390 ASSERT(length_ >= 0); | |
fschneider
2011/11/21 12:27:03
Maybe use ASSERT_GE / ASSERT_LE instead of ASSERT.
Michael Starzinger
2011/11/21 13:28:15
Done.
| |
391 ASSERT(length_ <= kMaximumClonedProperties); | |
392 } | |
393 | |
394 void Generate(MacroAssembler* masm); | |
395 | |
396 private: | |
397 int length_; | |
398 | |
399 Major MajorKey() { return FastCloneShallowObject; } | |
400 int MinorKey() { return length_; } | |
401 }; | |
402 | |
403 | |
383 class InstanceofStub: public CodeStub { | 404 class InstanceofStub: public CodeStub { |
384 public: | 405 public: |
385 enum Flags { | 406 enum Flags { |
386 kNoFlags = 0, | 407 kNoFlags = 0, |
387 kArgsInRegisters = 1 << 0, | 408 kArgsInRegisters = 1 << 0, |
388 kCallSiteInlineCheck = 1 << 1, | 409 kCallSiteInlineCheck = 1 << 1, |
389 kReturnTrueFalseObject = 1 << 2 | 410 kReturnTrueFalseObject = 1 << 2 |
390 }; | 411 }; |
391 | 412 |
392 explicit InstanceofStub(Flags flags) : flags_(flags) { } | 413 explicit InstanceofStub(Flags flags) : flags_(flags) { } |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1063 int MinorKey() { return 0; } | 1084 int MinorKey() { return 0; } |
1064 | 1085 |
1065 void Generate(MacroAssembler* masm); | 1086 void Generate(MacroAssembler* masm); |
1066 | 1087 |
1067 DISALLOW_COPY_AND_ASSIGN(StoreArrayLiteralElementStub); | 1088 DISALLOW_COPY_AND_ASSIGN(StoreArrayLiteralElementStub); |
1068 }; | 1089 }; |
1069 | 1090 |
1070 } } // namespace v8::internal | 1091 } } // namespace v8::internal |
1071 | 1092 |
1072 #endif // V8_CODE_STUBS_H_ | 1093 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |