OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 29 matching lines...) Expand all Loading... | |
40 V(CallFunction) \ | 40 V(CallFunction) \ |
41 V(CallConstruct) \ | 41 V(CallConstruct) \ |
42 V(UnaryOp) \ | 42 V(UnaryOp) \ |
43 V(BinaryOp) \ | 43 V(BinaryOp) \ |
44 V(StringAdd) \ | 44 V(StringAdd) \ |
45 V(SubString) \ | 45 V(SubString) \ |
46 V(StringCompare) \ | 46 V(StringCompare) \ |
47 V(Compare) \ | 47 V(Compare) \ |
48 V(CompareIC) \ | 48 V(CompareIC) \ |
49 V(MathPow) \ | 49 V(MathPow) \ |
50 V(ArrayLength) \ | |
50 V(StringLength) \ | 51 V(StringLength) \ |
51 V(RecordWrite) \ | 52 V(RecordWrite) \ |
52 V(StoreBufferOverflow) \ | 53 V(StoreBufferOverflow) \ |
53 V(RegExpExec) \ | 54 V(RegExpExec) \ |
54 V(TranscendentalCache) \ | 55 V(TranscendentalCache) \ |
55 V(Instanceof) \ | 56 V(Instanceof) \ |
56 V(ConvertToDouble) \ | 57 V(ConvertToDouble) \ |
57 V(WriteInt32ToHeapNumber) \ | 58 V(WriteInt32ToHeapNumber) \ |
58 V(StackCheck) \ | 59 V(StackCheck) \ |
59 V(Interrupt) \ | 60 V(Interrupt) \ |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
549 bool Describes(Code* code) { | 550 bool Describes(Code* code) { |
550 return GetMajorKey(code) == MajorKey() && code->stub_info() == MinorKey(); | 551 return GetMajorKey(code) == MajorKey() && code->stub_info() == MinorKey(); |
551 } | 552 } |
552 | 553 |
553 protected: | 554 protected: |
554 class KindBits: public BitField<Code::Kind, 0, 4> {}; | 555 class KindBits: public BitField<Code::Kind, 0, 4> {}; |
555 virtual void FinishCode(Handle<Code> code) { | 556 virtual void FinishCode(Handle<Code> code) { |
556 code->set_stub_info(MinorKey()); | 557 code->set_stub_info(MinorKey()); |
557 } | 558 } |
558 | 559 |
560 virtual int MinorKey() { | |
561 return KindBits::encode(kind_); | |
562 } | |
563 | |
559 Code::Kind kind_; | 564 Code::Kind kind_; |
Jakob Kummerow
2013/01/21 16:35:15
again, make the field private and define a protect
Toon Verwaest
2013/01/21 17:16:17
Done.
| |
560 }; | 565 }; |
561 | 566 |
562 | 567 |
568 class ArrayLengthStub: public ICStub { | |
569 public: | |
570 explicit ArrayLengthStub(Code::Kind kind) : ICStub(kind) { } | |
571 virtual void Generate(MacroAssembler* masm); | |
572 | |
573 private: | |
574 virtual CodeStub::Major MajorKey() { return ArrayLength; } | |
575 }; | |
576 | |
577 | |
563 class StringLengthStub: public ICStub { | 578 class StringLengthStub: public ICStub { |
564 public: | 579 public: |
565 StringLengthStub(Code::Kind kind, bool support_wrapper) | 580 StringLengthStub(Code::Kind kind, bool support_wrapper) |
566 : ICStub(kind), support_wrapper_(support_wrapper) { } | 581 : ICStub(kind), support_wrapper_(support_wrapper) { } |
567 virtual void Generate(MacroAssembler* masm); | 582 virtual void Generate(MacroAssembler* masm); |
568 | 583 |
569 private: | 584 private: |
570 class WrapperModeBits: public BitField<bool, 4, 1> {}; | 585 class WrapperModeBits: public BitField<bool, 4, 1> {}; |
571 virtual CodeStub::Major MajorKey() { return StringLength; } | 586 virtual CodeStub::Major MajorKey() { return StringLength; } |
572 virtual int MinorKey() { | 587 virtual int MinorKey() { |
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1350 | 1365 |
1351 // The current function entry hook. | 1366 // The current function entry hook. |
1352 static FunctionEntryHook entry_hook_; | 1367 static FunctionEntryHook entry_hook_; |
1353 | 1368 |
1354 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); | 1369 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); |
1355 }; | 1370 }; |
1356 | 1371 |
1357 } } // namespace v8::internal | 1372 } } // namespace v8::internal |
1358 | 1373 |
1359 #endif // V8_CODE_STUBS_H_ | 1374 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |