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

Side by Side Diff: src/arm/lithium-arm.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/arm/ic-arm.cc ('k') | src/arm/lithium-arm.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(CheckNonSmi) \ 63 V(CheckNonSmi) \
67 V(CheckMaps) \ 64 V(CheckMaps) \
68 V(CheckMapValue) \ 65 V(CheckMapValue) \
69 V(CheckSmi) \ 66 V(CheckSmi) \
70 V(CheckValue) \ 67 V(CheckValue) \
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 class IsCallBits: public BitField<bool, 0, 1> {}; 293 class IsCallBits: public BitField<bool, 0, 1> {};
297 294
298 LEnvironment* environment_; 295 LEnvironment* environment_;
299 SetOncePointer<LPointerMap> pointer_map_; 296 SetOncePointer<LPointerMap> pointer_map_;
300 HValue* hydrogen_value_; 297 HValue* hydrogen_value_;
301 int bit_field_; 298 int bit_field_;
302 }; 299 };
303 300
304 301
305 // R = number of result operands (0 or 1). 302 // R = number of result operands (0 or 1).
306 // I = number of input operands. 303 template<int R>
307 // T = number of temporary operands. 304 class LTemplateResultInstruction : public LInstruction {
308 template<int R, int I, int T>
309 class LTemplateInstruction : public LInstruction {
310 public: 305 public:
311 // Allow 0 or 1 output operands. 306 // Allow 0 or 1 output operands.
312 STATIC_ASSERT(R == 0 || R == 1); 307 STATIC_ASSERT(R == 0 || R == 1);
313 virtual bool HasResult() const V8_FINAL V8_OVERRIDE { 308 virtual bool HasResult() const V8_FINAL V8_OVERRIDE {
314 return R != 0 && result() != NULL; 309 return R != 0 && result() != NULL;
315 } 310 }
316 void set_result(LOperand* operand) { results_[0] = operand; } 311 void set_result(LOperand* operand) { results_[0] = operand; }
317 LOperand* result() const { return results_[0]; } 312 LOperand* result() const { return results_[0]; }
318 313
319 protected: 314 protected:
320 EmbeddedContainer<LOperand*, R> results_; 315 EmbeddedContainer<LOperand*, R> results_;
316 };
317
318
319 // R = number of result operands (0 or 1).
320 // I = number of input operands.
321 // T = number of temporary operands.
322 template<int R, int I, int T>
323 class LTemplateInstruction : public LTemplateResultInstruction<R> {
324 protected:
321 EmbeddedContainer<LOperand*, I> inputs_; 325 EmbeddedContainer<LOperand*, I> inputs_;
322 EmbeddedContainer<LOperand*, T> temps_; 326 EmbeddedContainer<LOperand*, T> temps_;
323 327
324 private: 328 private:
329 // Iterator support.
325 virtual int InputCount() V8_FINAL V8_OVERRIDE { return I; } 330 virtual int InputCount() V8_FINAL V8_OVERRIDE { return I; }
326 virtual LOperand* InputAt(int i) V8_FINAL V8_OVERRIDE { return inputs_[i]; } 331 virtual LOperand* InputAt(int i) V8_FINAL V8_OVERRIDE { return inputs_[i]; }
327 332
328 virtual int TempCount() V8_FINAL V8_OVERRIDE { return T; } 333 virtual int TempCount() V8_FINAL V8_OVERRIDE { return T; }
329 virtual LOperand* TempAt(int i) V8_FINAL V8_OVERRIDE { return temps_[i]; } 334 virtual LOperand* TempAt(int i) V8_FINAL V8_OVERRIDE { return temps_[i]; }
330 }; 335 };
331 336
332 337
333 class LGap : public LTemplateInstruction<0, 0, 0> { 338 class LGap : public LTemplateInstruction<0, 0, 0> {
334 public: 339 public:
(...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after
1827 explicit LGlobalReceiver(LOperand* global_object) { 1832 explicit LGlobalReceiver(LOperand* global_object) {
1828 inputs_[0] = global_object; 1833 inputs_[0] = global_object;
1829 } 1834 }
1830 1835
1831 LOperand* global_object() { return inputs_[0]; } 1836 LOperand* global_object() { return inputs_[0]; }
1832 1837
1833 DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver") 1838 DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver")
1834 }; 1839 };
1835 1840
1836 1841
1837 class LCallConstantFunction V8_FINAL : public LTemplateInstruction<1, 0, 0> { 1842 class LCallJSFunction V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1838 public: 1843 public:
1839 DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call-constant-function") 1844 explicit LCallJSFunction(LOperand* function) {
1840 DECLARE_HYDROGEN_ACCESSOR(CallConstantFunction) 1845 inputs_[0] = function;
1846 }
1847
1848 LOperand* function() { return inputs_[0]; }
1849
1850 DECLARE_CONCRETE_INSTRUCTION(CallJSFunction, "call-js-function")
1851 DECLARE_HYDROGEN_ACCESSOR(CallJSFunction)
1841 1852
1842 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; 1853 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1843 1854
1844 Handle<JSFunction> function() { return hydrogen()->function(); }
1845 int arity() const { return hydrogen()->argument_count() - 1; }
1846 };
1847
1848
1849 class LInvokeFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1850 public:
1851 LInvokeFunction(LOperand* context, LOperand* function) {
1852 inputs_[0] = context;
1853 inputs_[1] = function;
1854 }
1855
1856 LOperand* context() { return inputs_[0]; }
1857 LOperand* function() { return inputs_[1]; }
1858
1859 DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function")
1860 DECLARE_HYDROGEN_ACCESSOR(InvokeFunction)
1861
1862 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1863
1864 int arity() const { return hydrogen()->argument_count() - 1; } 1855 int arity() const { return hydrogen()->argument_count() - 1; }
1865 }; 1856 };
1866 1857
1867 1858
1868 class LCallKeyed V8_FINAL : public LTemplateInstruction<1, 2, 0> { 1859 class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> {
1869 public: 1860 public:
1870 LCallKeyed(LOperand* context, LOperand* key) { 1861 LCallWithDescriptor(const CallInterfaceDescriptor* descriptor,
1862 ZoneList<LOperand*>& operands,
1863 Zone* zone)
1864 : descriptor_(descriptor),
1865 inputs_(descriptor->environment_length() + 1, zone) {
1866 ASSERT(descriptor->environment_length() + 1 == operands.length());
1867 inputs_.AddAll(operands, zone);
1868 }
1869
1870 LOperand* target() const { return inputs_[0]; }
1871
1872 const CallInterfaceDescriptor* descriptor() { return descriptor_; }
1873
1874 private:
1875 DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor")
1876 DECLARE_HYDROGEN_ACCESSOR(CallWithDescriptor)
1877
1878 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1879
1880 int arity() const { return hydrogen()->argument_count() - 1; }
1881
1882 const CallInterfaceDescriptor* descriptor_;
1883 ZoneList<LOperand*> inputs_;
1884
1885 // Iterator support.
1886 virtual int InputCount() V8_FINAL V8_OVERRIDE { return inputs_.length(); }
1887 virtual LOperand* InputAt(int i) V8_FINAL V8_OVERRIDE { return inputs_[i]; }
1888
1889 virtual int TempCount() V8_FINAL V8_OVERRIDE { return 0; }
1890 virtual LOperand* TempAt(int i) V8_FINAL V8_OVERRIDE { return NULL; }
1891 };
1892
1893
1894 class LInvokeFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1895 public:
1896 LInvokeFunction(LOperand* context, LOperand* function) {
1871 inputs_[0] = context; 1897 inputs_[0] = context;
1872 inputs_[1] = key; 1898 inputs_[1] = function;
1873 } 1899 }
1874 1900
1875 LOperand* context() { return inputs_[0]; } 1901 LOperand* context() { return inputs_[0]; }
1876 LOperand* key() { return inputs_[1]; } 1902 LOperand* function() { return inputs_[1]; }
1877 1903
1878 DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call-keyed") 1904 DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function")
1879 DECLARE_HYDROGEN_ACCESSOR(CallKeyed) 1905 DECLARE_HYDROGEN_ACCESSOR(InvokeFunction)
1880 1906
1881 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; 1907 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1882 1908
1883 int arity() const { return hydrogen()->argument_count() - 1; } 1909 int arity() const { return hydrogen()->argument_count() - 1; }
1884 }; 1910 };
1885 1911
1886
1887
1888 class LCallNamed V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1889 public:
1890 explicit LCallNamed(LOperand* context) {
1891 inputs_[0] = context;
1892 }
1893
1894 LOperand* context() { return inputs_[0]; }
1895
1896 DECLARE_CONCRETE_INSTRUCTION(CallNamed, "call-named")
1897 DECLARE_HYDROGEN_ACCESSOR(CallNamed)
1898
1899 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1900
1901 Handle<String> name() const { return hydrogen()->name(); }
1902 int arity() const { return hydrogen()->argument_count() - 1; }
1903 };
1904
1905 1912
1906 class LCallFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> { 1913 class LCallFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1907 public: 1914 public:
1908 LCallFunction(LOperand* context, LOperand* function) { 1915 LCallFunction(LOperand* context, LOperand* function) {
1909 inputs_[0] = context; 1916 inputs_[0] = context;
1910 inputs_[1] = function; 1917 inputs_[1] = function;
1911 } 1918 }
1912 1919
1913 LOperand* context() { return inputs_[0]; } 1920 LOperand* context() { return inputs_[0]; }
1914 LOperand* function() { return inputs_[1]; } 1921 LOperand* function() { return inputs_[1]; }
1915 1922
1916 DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function") 1923 DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function")
1917 DECLARE_HYDROGEN_ACCESSOR(CallFunction) 1924 DECLARE_HYDROGEN_ACCESSOR(CallFunction)
1918 1925
1919 int arity() const { return hydrogen()->argument_count() - 1; } 1926 int arity() const { return hydrogen()->argument_count() - 1; }
1920 }; 1927 };
1921 1928
1922 1929
1923 class LCallGlobal V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1924 public:
1925 explicit LCallGlobal(LOperand* context) {
1926 inputs_[0] = context;
1927 }
1928
1929 LOperand* context() { return inputs_[0]; }
1930
1931 DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call-global")
1932 DECLARE_HYDROGEN_ACCESSOR(CallGlobal)
1933
1934 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1935
1936 Handle<String> name() const {return hydrogen()->name(); }
1937 int arity() const { return hydrogen()->argument_count() - 1; }
1938 };
1939
1940
1941 class LCallKnownGlobal V8_FINAL : public LTemplateInstruction<1, 0, 0> {
1942 public:
1943 DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal, "call-known-global")
1944 DECLARE_HYDROGEN_ACCESSOR(CallKnownGlobal)
1945
1946 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1947
1948 int arity() const { return hydrogen()->argument_count() - 1; }
1949 };
1950
1951
1952 class LCallNew V8_FINAL : public LTemplateInstruction<1, 2, 0> { 1930 class LCallNew V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1953 public: 1931 public:
1954 LCallNew(LOperand* context, LOperand* constructor) { 1932 LCallNew(LOperand* context, LOperand* constructor) {
1955 inputs_[0] = context; 1933 inputs_[0] = context;
1956 inputs_[1] = constructor; 1934 inputs_[1] = constructor;
1957 } 1935 }
1958 1936
1959 LOperand* context() { return inputs_[0]; } 1937 LOperand* context() { return inputs_[0]; }
1960 LOperand* constructor() { return inputs_[1]; } 1938 LOperand* constructor() { return inputs_[1]; }
1961 1939
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
2800 // Will not be moved to a register even if one is freely available. 2778 // Will not be moved to a register even if one is freely available.
2801 virtual MUST_USE_RESULT LOperand* UseAny(HValue* value) V8_OVERRIDE; 2779 virtual MUST_USE_RESULT LOperand* UseAny(HValue* value) V8_OVERRIDE;
2802 2780
2803 // Temporary operand that must be in a register. 2781 // Temporary operand that must be in a register.
2804 MUST_USE_RESULT LUnallocated* TempRegister(); 2782 MUST_USE_RESULT LUnallocated* TempRegister();
2805 MUST_USE_RESULT LOperand* FixedTemp(Register reg); 2783 MUST_USE_RESULT LOperand* FixedTemp(Register reg);
2806 MUST_USE_RESULT LOperand* FixedTemp(DoubleRegister reg); 2784 MUST_USE_RESULT LOperand* FixedTemp(DoubleRegister reg);
2807 2785
2808 // Methods for setting up define-use relationships. 2786 // Methods for setting up define-use relationships.
2809 // Return the same instruction that they are passed. 2787 // Return the same instruction that they are passed.
2810 template<int I, int T> 2788 LInstruction* Define(LTemplateResultInstruction<1>* instr,
2811 LInstruction* Define(LTemplateInstruction<1, I, T>* instr, 2789 LUnallocated* result);
2812 LUnallocated* result); 2790 LInstruction* DefineAsRegister(LTemplateResultInstruction<1>* instr);
2813 template<int I, int T> 2791 LInstruction* DefineAsSpilled(LTemplateResultInstruction<1>* instr,
2814 LInstruction* DefineAsRegister(LTemplateInstruction<1, I, T>* instr); 2792 int index);
2815 template<int I, int T> 2793 LInstruction* DefineSameAsFirst(LTemplateResultInstruction<1>* instr);
2816 LInstruction* DefineAsSpilled(LTemplateInstruction<1, I, T>* instr, 2794 LInstruction* DefineFixed(LTemplateResultInstruction<1>* instr,
2817 int index); 2795 Register reg);
2818 template<int I, int T> 2796 LInstruction* DefineFixedDouble(LTemplateResultInstruction<1>* instr,
2819 LInstruction* DefineSameAsFirst(LTemplateInstruction<1, I, T>* instr); 2797 DoubleRegister reg);
2820 template<int I, int T>
2821 LInstruction* DefineFixed(LTemplateInstruction<1, I, T>* instr,
2822 Register reg);
2823 template<int I, int T>
2824 LInstruction* DefineFixedDouble(LTemplateInstruction<1, I, T>* instr,
2825 DoubleRegister reg);
2826 LInstruction* AssignEnvironment(LInstruction* instr); 2798 LInstruction* AssignEnvironment(LInstruction* instr);
2827 LInstruction* AssignPointerMap(LInstruction* instr); 2799 LInstruction* AssignPointerMap(LInstruction* instr);
2828 2800
2829 enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY }; 2801 enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY };
2830 2802
2831 // By default we assume that instruction sequences generated for calls 2803 // By default we assume that instruction sequences generated for calls
2832 // cannot deoptimize eagerly and we do not attach environment to this 2804 // cannot deoptimize eagerly and we do not attach environment to this
2833 // instruction. 2805 // instruction.
2834 LInstruction* MarkAsCall( 2806 LInstruction* MarkAsCall(
2835 LInstruction* instr, 2807 LInstruction* instr,
(...skipping 23 matching lines...) Expand all
2859 2831
2860 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2832 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2861 }; 2833 };
2862 2834
2863 #undef DECLARE_HYDROGEN_ACCESSOR 2835 #undef DECLARE_HYDROGEN_ACCESSOR
2864 #undef DECLARE_CONCRETE_INSTRUCTION 2836 #undef DECLARE_CONCRETE_INSTRUCTION
2865 2837
2866 } } // namespace v8::internal 2838 } } // namespace v8::internal
2867 2839
2868 #endif // V8_ARM_LITHIUM_ARM_H_ 2840 #endif // V8_ARM_LITHIUM_ARM_H_
OLDNEW
« no previous file with comments | « src/arm/ic-arm.cc ('k') | src/arm/lithium-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698