Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: src/mips/lithium-mips.h

Issue 132623005: A64: Synchronize with r18642. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | src/mips/lithium-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
45 V(AddI) \ 45 V(AddI) \
46 V(Allocate) \ 46 V(Allocate) \
47 V(ApplyArguments) \ 47 V(ApplyArguments) \
48 V(ArgumentsElements) \ 48 V(ArgumentsElements) \
49 V(ArgumentsLength) \ 49 V(ArgumentsLength) \
50 V(ArithmeticD) \ 50 V(ArithmeticD) \
51 V(ArithmeticT) \ 51 V(ArithmeticT) \
52 V(BitI) \ 52 V(BitI) \
53 V(BoundsCheck) \ 53 V(BoundsCheck) \
54 V(Branch) \ 54 V(Branch) \
55 V(CallConstantFunction) \ 55 V(CallJSFunction) \
56 V(CallWithDescriptor) \
56 V(CallFunction) \ 57 V(CallFunction) \
57 V(CallGlobal) \
58 V(CallKeyed) \
59 V(CallKnownGlobal) \
60 V(CallNamed) \
61 V(CallNew) \ 58 V(CallNew) \
62 V(CallNewArray) \ 59 V(CallNewArray) \
63 V(CallRuntime) \ 60 V(CallRuntime) \
64 V(CallStub) \ 61 V(CallStub) \
65 V(CheckInstanceType) \ 62 V(CheckInstanceType) \
66 V(CheckMaps) \ 63 V(CheckMaps) \
67 V(CheckMapValue) \ 64 V(CheckMapValue) \
68 V(CheckNonSmi) \ 65 V(CheckNonSmi) \
69 V(CheckSmi) \ 66 V(CheckSmi) \
70 V(CheckValue) \ 67 V(CheckValue) \
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 class IsCallBits: public BitField<bool, 0, 1> {}; 290 class IsCallBits: public BitField<bool, 0, 1> {};
294 291
295 LEnvironment* environment_; 292 LEnvironment* environment_;
296 SetOncePointer<LPointerMap> pointer_map_; 293 SetOncePointer<LPointerMap> pointer_map_;
297 HValue* hydrogen_value_; 294 HValue* hydrogen_value_;
298 int bit_field_; 295 int bit_field_;
299 }; 296 };
300 297
301 298
302 // R = number of result operands (0 or 1). 299 // R = number of result operands (0 or 1).
303 // I = number of input operands. 300 template<int R>
304 // T = number of temporary operands. 301 class LTemplateResultInstruction : public LInstruction {
305 template<int R, int I, int T>
306 class LTemplateInstruction : public LInstruction {
307 public: 302 public:
308 // Allow 0 or 1 output operands. 303 // Allow 0 or 1 output operands.
309 STATIC_ASSERT(R == 0 || R == 1); 304 STATIC_ASSERT(R == 0 || R == 1);
310 virtual bool HasResult() const V8_FINAL V8_OVERRIDE { 305 virtual bool HasResult() const V8_FINAL V8_OVERRIDE {
311 return R != 0 && result() != NULL; 306 return R != 0 && result() != NULL;
312 } 307 }
313 void set_result(LOperand* operand) { results_[0] = operand; } 308 void set_result(LOperand* operand) { results_[0] = operand; }
314 LOperand* result() const { return results_[0]; } 309 LOperand* result() const { return results_[0]; }
315 310
316 protected: 311 protected:
317 EmbeddedContainer<LOperand*, R> results_; 312 EmbeddedContainer<LOperand*, R> results_;
313 };
314
315
316 // R = number of result operands (0 or 1).
317 // I = number of input operands.
318 // T = number of temporary operands.
319 template<int R, int I, int T>
320 class LTemplateInstruction : public LTemplateResultInstruction<R> {
321 protected:
318 EmbeddedContainer<LOperand*, I> inputs_; 322 EmbeddedContainer<LOperand*, I> inputs_;
319 EmbeddedContainer<LOperand*, T> temps_; 323 EmbeddedContainer<LOperand*, T> temps_;
320 324
321 private: 325 private:
326 // Iterator support.
322 virtual int InputCount() V8_FINAL V8_OVERRIDE { return I; } 327 virtual int InputCount() V8_FINAL V8_OVERRIDE { return I; }
323 virtual LOperand* InputAt(int i) V8_FINAL V8_OVERRIDE { return inputs_[i]; } 328 virtual LOperand* InputAt(int i) V8_FINAL V8_OVERRIDE { return inputs_[i]; }
324 329
325 virtual int TempCount() V8_FINAL V8_OVERRIDE { return T; } 330 virtual int TempCount() V8_FINAL V8_OVERRIDE { return T; }
326 virtual LOperand* TempAt(int i) V8_FINAL V8_OVERRIDE { return temps_[i]; } 331 virtual LOperand* TempAt(int i) V8_FINAL V8_OVERRIDE { return temps_[i]; }
327 }; 332 };
328 333
329 334
330 class LGap : public LTemplateInstruction<0, 0, 0> { 335 class LGap : public LTemplateInstruction<0, 0, 0> {
331 public: 336 public:
(...skipping 1475 matching lines...) Expand 10 before | Expand all | Expand 10 after
1807 explicit LGlobalReceiver(LOperand* global_object) { 1812 explicit LGlobalReceiver(LOperand* global_object) {
1808 inputs_[0] = global_object; 1813 inputs_[0] = global_object;
1809 } 1814 }
1810 1815
1811 LOperand* global_object() { return inputs_[0]; } 1816 LOperand* global_object() { return inputs_[0]; }
1812 1817
1813 DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver") 1818 DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver")
1814 }; 1819 };
1815 1820
1816 1821
1817 class LCallConstantFunction V8_FINAL : public LTemplateInstruction<1, 0, 0> { 1822 class LCallJSFunction V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1818 public: 1823 public:
1819 DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call-constant-function") 1824 explicit LCallJSFunction(LOperand* function) {
1820 DECLARE_HYDROGEN_ACCESSOR(CallConstantFunction) 1825 inputs_[0] = function;
1826 }
1827
1828 LOperand* function() { return inputs_[0]; }
1829
1830 DECLARE_CONCRETE_INSTRUCTION(CallJSFunction, "call-js-function")
1831 DECLARE_HYDROGEN_ACCESSOR(CallJSFunction)
1821 1832
1822 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; 1833 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1823 1834
1824 Handle<JSFunction> function() { return hydrogen()->function(); }
1825 int arity() const { return hydrogen()->argument_count() - 1; }
1826 };
1827
1828
1829 class LInvokeFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1830 public:
1831 LInvokeFunction(LOperand* context, LOperand* function) {
1832 inputs_[0] = context;
1833 inputs_[1] = function;
1834 }
1835
1836 LOperand* context() { return inputs_[0]; }
1837 LOperand* function() { return inputs_[1]; }
1838
1839 DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function")
1840 DECLARE_HYDROGEN_ACCESSOR(InvokeFunction)
1841
1842 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1843
1844 int arity() const { return hydrogen()->argument_count() - 1; } 1835 int arity() const { return hydrogen()->argument_count() - 1; }
1845 }; 1836 };
1846 1837
1847 1838
1848 class LCallKeyed V8_FINAL : public LTemplateInstruction<1, 2, 0> { 1839 class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> {
1849 public: 1840 public:
1850 LCallKeyed(LOperand* context, LOperand* key) { 1841 LCallWithDescriptor(const CallInterfaceDescriptor* descriptor,
1842 ZoneList<LOperand*>& operands,
1843 Zone* zone)
1844 : descriptor_(descriptor),
1845 inputs_(descriptor->environment_length() + 1, zone) {
1846 ASSERT(descriptor->environment_length() + 1 == operands.length());
1847 inputs_.AddAll(operands, zone);
1848 }
1849
1850 LOperand* target() const { return inputs_[0]; }
1851
1852 const CallInterfaceDescriptor* descriptor() { return descriptor_; }
1853
1854 private:
1855 DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor")
1856 DECLARE_HYDROGEN_ACCESSOR(CallWithDescriptor)
1857
1858 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1859
1860 int arity() const { return hydrogen()->argument_count() - 1; }
1861
1862 const CallInterfaceDescriptor* descriptor_;
1863 ZoneList<LOperand*> inputs_;
1864
1865 // Iterator support.
1866 virtual int InputCount() V8_FINAL V8_OVERRIDE { return inputs_.length(); }
1867 virtual LOperand* InputAt(int i) V8_FINAL V8_OVERRIDE { return inputs_[i]; }
1868
1869 virtual int TempCount() V8_FINAL V8_OVERRIDE { return 0; }
1870 virtual LOperand* TempAt(int i) V8_FINAL V8_OVERRIDE { return NULL; }
1871 };
1872
1873
1874 class LInvokeFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1875 public:
1876 LInvokeFunction(LOperand* context, LOperand* function) {
1851 inputs_[0] = context; 1877 inputs_[0] = context;
1852 inputs_[1] = key; 1878 inputs_[1] = function;
1853 } 1879 }
1854 1880
1855 LOperand* context() { return inputs_[0]; } 1881 LOperand* context() { return inputs_[0]; }
1856 LOperand* key() { return inputs_[1]; } 1882 LOperand* function() { return inputs_[1]; }
1857 1883
1858 DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call-keyed") 1884 DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function")
1859 DECLARE_HYDROGEN_ACCESSOR(CallKeyed) 1885 DECLARE_HYDROGEN_ACCESSOR(InvokeFunction)
1860 1886
1861 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; 1887 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1862 1888
1863 int arity() const { return hydrogen()->argument_count() - 1; } 1889 int arity() const { return hydrogen()->argument_count() - 1; }
1864 }; 1890 };
1865 1891
1866
1867
1868 class LCallNamed V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1869 public:
1870 explicit LCallNamed(LOperand* context) {
1871 inputs_[0] = context;
1872 }
1873
1874 LOperand* context() { return inputs_[0]; }
1875
1876 DECLARE_CONCRETE_INSTRUCTION(CallNamed, "call-named")
1877 DECLARE_HYDROGEN_ACCESSOR(CallNamed)
1878
1879 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1880
1881 Handle<String> name() const { return hydrogen()->name(); }
1882 int arity() const { return hydrogen()->argument_count() - 1; }
1883 };
1884
1885 1892
1886 class LCallFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> { 1893 class LCallFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1887 public: 1894 public:
1888 LCallFunction(LOperand* context, LOperand* function) { 1895 LCallFunction(LOperand* context, LOperand* function) {
1889 inputs_[0] = context; 1896 inputs_[0] = context;
1890 inputs_[1] = function; 1897 inputs_[1] = function;
1891 } 1898 }
1892 1899
1893 LOperand* context() { return inputs_[0]; } 1900 LOperand* context() { return inputs_[0]; }
1894 LOperand* function() { return inputs_[1]; } 1901 LOperand* function() { return inputs_[1]; }
1895 1902
1896 DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function") 1903 DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function")
1897 DECLARE_HYDROGEN_ACCESSOR(CallFunction) 1904 DECLARE_HYDROGEN_ACCESSOR(CallFunction)
1898 1905
1899 int arity() const { return hydrogen()->argument_count() - 1; } 1906 int arity() const { return hydrogen()->argument_count() - 1; }
1900 }; 1907 };
1901 1908
1902 1909
1903 class LCallGlobal V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1904 public:
1905 explicit LCallGlobal(LOperand* context) {
1906 inputs_[0] = context;
1907 }
1908
1909 LOperand* context() { return inputs_[0]; }
1910
1911 DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call-global")
1912 DECLARE_HYDROGEN_ACCESSOR(CallGlobal)
1913
1914 virtual void PrintDataTo(StringStream* stream);
1915
1916 Handle<String> name() const {return hydrogen()->name(); }
1917 int arity() const { return hydrogen()->argument_count() - 1; }
1918 };
1919
1920
1921 class LCallKnownGlobal V8_FINAL : public LTemplateInstruction<1, 0, 0> {
1922 public:
1923 DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal, "call-known-global")
1924 DECLARE_HYDROGEN_ACCESSOR(CallKnownGlobal)
1925
1926 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1927
1928 int arity() const { return hydrogen()->argument_count() - 1; }
1929 };
1930
1931
1932 class LCallNew V8_FINAL : public LTemplateInstruction<1, 2, 0> { 1910 class LCallNew V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1933 public: 1911 public:
1934 LCallNew(LOperand* context, LOperand* constructor) { 1912 LCallNew(LOperand* context, LOperand* constructor) {
1935 inputs_[0] = context; 1913 inputs_[0] = context;
1936 inputs_[1] = constructor; 1914 inputs_[1] = constructor;
1937 } 1915 }
1938 1916
1939 LOperand* context() { return inputs_[0]; } 1917 LOperand* context() { return inputs_[0]; }
1940 LOperand* constructor() { return inputs_[1]; } 1918 LOperand* constructor() { return inputs_[1]; }
1941 1919
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after
2774 // Will not be moved to a register even if one is freely available. 2752 // Will not be moved to a register even if one is freely available.
2775 virtual MUST_USE_RESULT LOperand* UseAny(HValue* value) V8_OVERRIDE; 2753 virtual MUST_USE_RESULT LOperand* UseAny(HValue* value) V8_OVERRIDE;
2776 2754
2777 // Temporary operand that must be in a register. 2755 // Temporary operand that must be in a register.
2778 MUST_USE_RESULT LUnallocated* TempRegister(); 2756 MUST_USE_RESULT LUnallocated* TempRegister();
2779 MUST_USE_RESULT LOperand* FixedTemp(Register reg); 2757 MUST_USE_RESULT LOperand* FixedTemp(Register reg);
2780 MUST_USE_RESULT LOperand* FixedTemp(DoubleRegister reg); 2758 MUST_USE_RESULT LOperand* FixedTemp(DoubleRegister reg);
2781 2759
2782 // Methods for setting up define-use relationships. 2760 // Methods for setting up define-use relationships.
2783 // Return the same instruction that they are passed. 2761 // Return the same instruction that they are passed.
2784 template<int I, int T> 2762 LInstruction* Define(LTemplateResultInstruction<1>* instr,
2785 LInstruction* Define(LTemplateInstruction<1, I, T>* instr, 2763 LUnallocated* result);
2786 LUnallocated* result); 2764 LInstruction* DefineAsRegister(LTemplateResultInstruction<1>* instr);
2787 template<int I, int T> 2765 LInstruction* DefineAsSpilled(LTemplateResultInstruction<1>* instr,
2788 LInstruction* DefineAsRegister(LTemplateInstruction<1, I, T>* instr); 2766 int index);
2789 template<int I, int T> 2767 LInstruction* DefineSameAsFirst(LTemplateResultInstruction<1>* instr);
2790 LInstruction* DefineAsSpilled(LTemplateInstruction<1, I, T>* instr, 2768 LInstruction* DefineFixed(LTemplateResultInstruction<1>* instr,
2791 int index); 2769 Register reg);
2792 template<int I, int T> 2770 LInstruction* DefineFixedDouble(LTemplateResultInstruction<1>* instr,
2793 LInstruction* DefineSameAsFirst(LTemplateInstruction<1, I, T>* instr); 2771 DoubleRegister reg);
2794 template<int I, int T>
2795 LInstruction* DefineFixed(LTemplateInstruction<1, I, T>* instr,
2796 Register reg);
2797 template<int I, int T>
2798 LInstruction* DefineFixedDouble(LTemplateInstruction<1, I, T>* instr,
2799 DoubleRegister reg);
2800 LInstruction* AssignEnvironment(LInstruction* instr); 2772 LInstruction* AssignEnvironment(LInstruction* instr);
2801 LInstruction* AssignPointerMap(LInstruction* instr); 2773 LInstruction* AssignPointerMap(LInstruction* instr);
2802 2774
2803 enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY }; 2775 enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY };
2804 2776
2805 // By default we assume that instruction sequences generated for calls 2777 // By default we assume that instruction sequences generated for calls
2806 // cannot deoptimize eagerly and we do not attach environment to this 2778 // cannot deoptimize eagerly and we do not attach environment to this
2807 // instruction. 2779 // instruction.
2808 LInstruction* MarkAsCall( 2780 LInstruction* MarkAsCall(
2809 LInstruction* instr, 2781 LInstruction* instr,
(...skipping 24 matching lines...) Expand all
2834 2806
2835 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2807 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2836 }; 2808 };
2837 2809
2838 #undef DECLARE_HYDROGEN_ACCESSOR 2810 #undef DECLARE_HYDROGEN_ACCESSOR
2839 #undef DECLARE_CONCRETE_INSTRUCTION 2811 #undef DECLARE_CONCRETE_INSTRUCTION
2840 2812
2841 } } // namespace v8::internal 2813 } } // namespace v8::internal
2842 2814
2843 #endif // V8_MIPS_LITHIUM_MIPS_H_ 2815 #endif // V8_MIPS_LITHIUM_MIPS_H_
OLDNEW
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | src/mips/lithium-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698