Chromium Code Reviews| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 V(BinaryOpICWithAllocationSite) \ | 45 V(BinaryOpICWithAllocationSite) \ |
| 46 V(BinaryOpWithAllocationSite) \ | 46 V(BinaryOpWithAllocationSite) \ |
| 47 V(StringAdd) \ | 47 V(StringAdd) \ |
| 48 V(SubString) \ | 48 V(SubString) \ |
| 49 V(StringCompare) \ | 49 V(StringCompare) \ |
| 50 V(Compare) \ | 50 V(Compare) \ |
| 51 V(CompareIC) \ | 51 V(CompareIC) \ |
| 52 V(CompareNilIC) \ | 52 V(CompareNilIC) \ |
| 53 V(MathPow) \ | 53 V(MathPow) \ |
| 54 V(StringLength) \ | 54 V(StringLength) \ |
| 55 V(CallIC) \ | |
| 55 V(FunctionPrototype) \ | 56 V(FunctionPrototype) \ |
| 56 V(StoreArrayLength) \ | 57 V(StoreArrayLength) \ |
| 57 V(RecordWrite) \ | 58 V(RecordWrite) \ |
| 58 V(StoreBufferOverflow) \ | 59 V(StoreBufferOverflow) \ |
| 59 V(RegExpExec) \ | 60 V(RegExpExec) \ |
| 60 V(Instanceof) \ | 61 V(Instanceof) \ |
| 61 V(ConvertToDouble) \ | 62 V(ConvertToDouble) \ |
| 62 V(WriteInt32ToHeapNumber) \ | 63 V(WriteInt32ToHeapNumber) \ |
| 63 V(StackCheck) \ | 64 V(StackCheck) \ |
| 64 V(Interrupt) \ | 65 V(Interrupt) \ |
| (...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 817 | 818 |
| 818 virtual int MinorKey() { | 819 virtual int MinorKey() { |
| 819 return KindBits::encode(kind_); | 820 return KindBits::encode(kind_); |
| 820 } | 821 } |
| 821 | 822 |
| 822 private: | 823 private: |
| 823 Code::Kind kind_; | 824 Code::Kind kind_; |
| 824 }; | 825 }; |
| 825 | 826 |
| 826 | 827 |
| 828 class CallICStub: public PlatformCodeStub { | |
| 829 public: | |
| 830 explicit CallICStub(const CallIC::State& state) | |
| 831 : state_(state) {} | |
| 832 | |
| 833 int arg_count() const { return state_.arg_count(); } | |
| 834 bool call_as_method() const { return state_.call_as_method(); } | |
| 835 bool monomorphic() const { return state_.monomorphic(); } | |
| 836 bool args_match() const { return state_.args_match(); } | |
| 837 bool strict_native() const { return state_.strict_native(); } | |
|
Toon Verwaest
2014/03/10 13:50:44
is_strict_or_native?
mvstanton
2014/03/20 15:51:53
The move to enums addressed this satisfactorily I
| |
| 838 | |
| 839 static int ExtractArgcFromMinorKey(int minor_key) { | |
| 840 return CallIC::State::ExtractArgcFromMinorKey(minor_key); | |
| 841 } | |
| 842 | |
| 843 virtual void Generate(MacroAssembler* masm); | |
| 844 | |
| 845 virtual Code::Kind GetCodeKind() const V8_OVERRIDE { | |
| 846 return Code::CALL_IC; | |
| 847 } | |
| 848 | |
| 849 virtual InlineCacheState GetICState() V8_FINAL V8_OVERRIDE { | |
| 850 return state_.GetICState(); | |
| 851 } | |
| 852 | |
| 853 virtual ExtraICState GetExtraICState() V8_FINAL V8_OVERRIDE { | |
| 854 return state_.GetExtraICState(); | |
| 855 } | |
| 856 | |
| 857 static void GenerateAheadOfTime(Isolate* isolate); | |
| 858 | |
| 859 protected: | |
| 860 virtual int MinorKey() { return GetExtraICState(); } | |
| 861 virtual void PrintState(StringStream* stream) V8_FINAL V8_OVERRIDE; | |
| 862 | |
| 863 private: | |
| 864 virtual CodeStub::Major MajorKey() { return CallIC; } | |
| 865 | |
| 866 // Code generation helpers. | |
| 867 void GenerateCall(MacroAssembler* masm, bool monomorphic, | |
| 868 bool args_match, bool strict_or_native); | |
| 869 void GenerateMiss(MacroAssembler* masm); | |
| 870 | |
| 871 CallIC::State state_; | |
| 872 }; | |
| 873 | |
| 874 | |
| 827 class FunctionPrototypeStub: public ICStub { | 875 class FunctionPrototypeStub: public ICStub { |
| 828 public: | 876 public: |
| 829 explicit FunctionPrototypeStub(Code::Kind kind) : ICStub(kind) { } | 877 explicit FunctionPrototypeStub(Code::Kind kind) : ICStub(kind) { } |
| 830 virtual void Generate(MacroAssembler* masm); | 878 virtual void Generate(MacroAssembler* masm); |
| 831 | 879 |
| 832 private: | 880 private: |
| 833 virtual CodeStub::Major MajorKey() { return FunctionPrototype; } | 881 virtual CodeStub::Major MajorKey() { return FunctionPrototype; } |
| 834 }; | 882 }; |
| 835 | 883 |
| 836 | 884 |
| (...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1579 static const int kInput = 2; | 1627 static const int kInput = 2; |
| 1580 | 1628 |
| 1581 private: | 1629 private: |
| 1582 DISALLOW_COPY_AND_ASSIGN(RegExpConstructResultStub); | 1630 DISALLOW_COPY_AND_ASSIGN(RegExpConstructResultStub); |
| 1583 }; | 1631 }; |
| 1584 | 1632 |
| 1585 | 1633 |
| 1586 class CallFunctionStub: public PlatformCodeStub { | 1634 class CallFunctionStub: public PlatformCodeStub { |
| 1587 public: | 1635 public: |
| 1588 CallFunctionStub(int argc, CallFunctionFlags flags) | 1636 CallFunctionStub(int argc, CallFunctionFlags flags) |
| 1589 : argc_(argc), flags_(flags) { } | 1637 : argc_(argc), flags_(flags) { |
| 1638 // CallFunctionStub no longer supports RECORD_CALL_TARGET. | |
| 1639 ASSERT(flags != RECORD_CALL_TARGET); | |
| 1640 } | |
| 1590 | 1641 |
| 1591 void Generate(MacroAssembler* masm); | 1642 void Generate(MacroAssembler* masm); |
| 1592 | 1643 |
| 1593 virtual void FinishCode(Handle<Code> code) { | 1644 virtual void FinishCode(Handle<Code> code) { |
| 1594 code->set_has_function_cache(RecordCallTarget()); | 1645 code->set_has_function_cache(RecordCallTarget()); |
| 1595 } | 1646 } |
| 1596 | 1647 |
| 1597 static int ExtractArgcFromMinorKey(int minor_key) { | 1648 static int ExtractArgcFromMinorKey(int minor_key) { |
| 1598 return ArgcBits::decode(minor_key); | 1649 return ArgcBits::decode(minor_key); |
| 1599 } | 1650 } |
| (...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2477 | 2528 |
| 2478 | 2529 |
| 2479 class CallDescriptors { | 2530 class CallDescriptors { |
| 2480 public: | 2531 public: |
| 2481 static void InitializeForIsolate(Isolate* isolate); | 2532 static void InitializeForIsolate(Isolate* isolate); |
| 2482 }; | 2533 }; |
| 2483 | 2534 |
| 2484 } } // namespace v8::internal | 2535 } } // namespace v8::internal |
| 2485 | 2536 |
| 2486 #endif // V8_CODE_STUBS_H_ | 2537 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |