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 1798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1809 | 1809 |
1810 bool is_js_array_; | 1810 bool is_js_array_; |
1811 ElementsKind elements_kind_; | 1811 ElementsKind elements_kind_; |
1812 KeyedAccessStoreMode store_mode_; | 1812 KeyedAccessStoreMode store_mode_; |
1813 bool fp_registers_; | 1813 bool fp_registers_; |
1814 | 1814 |
1815 DISALLOW_COPY_AND_ASSIGN(KeyedStoreElementStub); | 1815 DISALLOW_COPY_AND_ASSIGN(KeyedStoreElementStub); |
1816 }; | 1816 }; |
1817 | 1817 |
1818 | 1818 |
1819 class ToBooleanStub: public PlatformCodeStub { | 1819 class ToBooleanStub: public HydrogenCodeStub { |
1820 public: | 1820 public: |
1821 enum Type { | 1821 enum Type { |
1822 UNDEFINED, | 1822 UNDEFINED, |
1823 BOOLEAN, | 1823 BOOLEAN, |
1824 NULL_TYPE, | 1824 NULL_TYPE, |
1825 SMI, | 1825 SMI, |
1826 SPEC_OBJECT, | 1826 SPEC_OBJECT, |
1827 STRING, | 1827 STRING, |
1828 SYMBOL, | 1828 SYMBOL, |
1829 HEAP_NUMBER, | 1829 HEAP_NUMBER, |
(...skipping 13 matching lines...) Expand all Loading... |
1843 void Print(StringStream* stream) const; | 1843 void Print(StringStream* stream) const; |
1844 void TraceTransition(Types to) const; | 1844 void TraceTransition(Types to) const; |
1845 bool Record(Handle<Object> object); | 1845 bool Record(Handle<Object> object); |
1846 bool NeedsMap() const; | 1846 bool NeedsMap() const; |
1847 bool CanBeUndetectable() const; | 1847 bool CanBeUndetectable() const; |
1848 }; | 1848 }; |
1849 | 1849 |
1850 static Types no_types() { return Types(); } | 1850 static Types no_types() { return Types(); } |
1851 static Types all_types() { return Types((1 << NUMBER_OF_TYPES) - 1); } | 1851 static Types all_types() { return Types((1 << NUMBER_OF_TYPES) - 1); } |
1852 | 1852 |
1853 explicit ToBooleanStub(Register tos, Types types = Types()) | 1853 explicit ToBooleanStub(Types types = Types()) |
1854 : tos_(tos), types_(types) { } | 1854 : types_(types) { } |
| 1855 explicit ToBooleanStub(Code::ExtraICState state) |
| 1856 : types_(static_cast<byte>(state)) { } |
1855 | 1857 |
1856 void Generate(MacroAssembler* masm); | 1858 bool Record(Handle<Object> object); |
| 1859 Types GetTypes() { return types_; } |
| 1860 |
| 1861 virtual Handle<Code> GenerateCode(); |
| 1862 virtual void InitializeInterfaceDescriptor( |
| 1863 Isolate* isolate, |
| 1864 CodeStubInterfaceDescriptor* descriptor); |
| 1865 |
1857 virtual Code::Kind GetCodeKind() const { return Code::TO_BOOLEAN_IC; } | 1866 virtual Code::Kind GetCodeKind() const { return Code::TO_BOOLEAN_IC; } |
1858 virtual void PrintName(StringStream* stream); | 1867 virtual void PrintName(StringStream* stream); |
1859 | 1868 |
1860 virtual bool SometimesSetsUpAFrame() { return false; } | 1869 virtual bool SometimesSetsUpAFrame() { return false; } |
1861 | 1870 |
| 1871 static void InitializeForIsolate(Isolate* isolate) { |
| 1872 ToBooleanStub stub; |
| 1873 stub.InitializeInterfaceDescriptor( |
| 1874 isolate, |
| 1875 isolate->code_stub_interface_descriptor(CodeStub::ToBoolean)); |
| 1876 } |
| 1877 |
| 1878 static Handle<Code> GetUninitialized(Isolate* isolate) { |
| 1879 return ToBooleanStub(UNINITIALIZED).GetCode(isolate); |
| 1880 } |
| 1881 |
| 1882 virtual Code::ExtraICState GetExtraICState() { |
| 1883 return types_.ToIntegral(); |
| 1884 } |
| 1885 |
| 1886 |
1862 private: | 1887 private: |
1863 Major MajorKey() { return ToBoolean; } | 1888 Major MajorKey() { return ToBoolean; } |
1864 int MinorKey() { return (tos_.code() << NUMBER_OF_TYPES) | | 1889 int NotMissMinorKey() { return GetExtraICState(); } |
1865 types_.ToByte(); } | |
1866 | 1890 |
1867 virtual void FinishCode(Handle<Code> code) { | 1891 explicit ToBooleanStub(InitializationState init_state) : |
1868 code->set_to_boolean_state(types_.ToByte()); | 1892 HydrogenCodeStub(init_state) {} |
1869 } | |
1870 | 1893 |
1871 void CheckOddball(MacroAssembler* masm, | |
1872 Type type, | |
1873 Heap::RootListIndex value, | |
1874 bool result); | |
1875 void GenerateTypeTransition(MacroAssembler* masm); | |
1876 | |
1877 Register tos_; | |
1878 Types types_; | 1894 Types types_; |
1879 }; | 1895 }; |
1880 | 1896 |
1881 | 1897 |
1882 class ElementsTransitionAndStoreStub : public PlatformCodeStub { | 1898 class ElementsTransitionAndStoreStub : public PlatformCodeStub { |
1883 public: | 1899 public: |
1884 ElementsTransitionAndStoreStub(ElementsKind from, | 1900 ElementsTransitionAndStoreStub(ElementsKind from, |
1885 ElementsKind to, | 1901 ElementsKind to, |
1886 bool is_jsarray, | 1902 bool is_jsarray, |
1887 StrictModeFlag strict_mode, | 1903 StrictModeFlag strict_mode, |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1995 | 2011 |
1996 // The current function entry hook. | 2012 // The current function entry hook. |
1997 static FunctionEntryHook entry_hook_; | 2013 static FunctionEntryHook entry_hook_; |
1998 | 2014 |
1999 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); | 2015 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); |
2000 }; | 2016 }; |
2001 | 2017 |
2002 } } // namespace v8::internal | 2018 } } // namespace v8::internal |
2003 | 2019 |
2004 #endif // V8_CODE_STUBS_H_ | 2020 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |