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

Side by Side Diff: src/x64/lithium-x64.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/x64/lithium-codegen-x64.cc ('k') | src/x64/lithium-x64.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:
322 // Iterator support. 326 // Iterator support.
323 virtual int InputCount() V8_FINAL V8_OVERRIDE { return I; } 327 virtual int InputCount() V8_FINAL V8_OVERRIDE { return I; }
324 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]; }
325 329
326 virtual int TempCount() V8_FINAL V8_OVERRIDE { return T; } 330 virtual int TempCount() V8_FINAL V8_OVERRIDE { return T; }
327 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]; }
(...skipping 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after
1775 explicit LGlobalReceiver(LOperand* global_object) { 1779 explicit LGlobalReceiver(LOperand* global_object) {
1776 inputs_[0] = global_object; 1780 inputs_[0] = global_object;
1777 } 1781 }
1778 1782
1779 LOperand* global() { return inputs_[0]; } 1783 LOperand* global() { return inputs_[0]; }
1780 1784
1781 DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver") 1785 DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver")
1782 }; 1786 };
1783 1787
1784 1788
1785 class LCallConstantFunction V8_FINAL : public LTemplateInstruction<1, 0, 0> { 1789 class LCallJSFunction V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1786 public: 1790 public:
1787 DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call-constant-function") 1791 explicit LCallJSFunction(LOperand* function) {
1788 DECLARE_HYDROGEN_ACCESSOR(CallConstantFunction) 1792 inputs_[0] = function;
1789
1790 virtual void PrintDataTo(StringStream* stream);
1791
1792 Handle<JSFunction> function() { return hydrogen()->function(); }
1793 int arity() const { return hydrogen()->argument_count() - 1; }
1794 };
1795
1796
1797 class LInvokeFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1798 public:
1799 LInvokeFunction(LOperand* context, LOperand* function) {
1800 inputs_[0] = context;
1801 inputs_[1] = function;
1802 } 1793 }
1803 1794
1804 LOperand* context() { return inputs_[0]; } 1795 LOperand* function() { return inputs_[0]; }
1805 LOperand* function() { return inputs_[1]; }
1806 1796
1807 DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function") 1797 DECLARE_CONCRETE_INSTRUCTION(CallJSFunction, "call-js-function")
1808 DECLARE_HYDROGEN_ACCESSOR(InvokeFunction) 1798 DECLARE_HYDROGEN_ACCESSOR(CallJSFunction)
1809 1799
1810 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; 1800 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1811 1801
1812 int arity() const { return hydrogen()->argument_count() - 1; } 1802 int arity() const { return hydrogen()->argument_count() - 1; }
1813 }; 1803 };
1814 1804
1815 1805
1816 class LCallKeyed V8_FINAL : public LTemplateInstruction<1, 2, 0> { 1806 class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> {
1817 public: 1807 public:
1818 LCallKeyed(LOperand* context, LOperand* key) { 1808 LCallWithDescriptor(const CallInterfaceDescriptor* descriptor,
1819 inputs_[0] = context; 1809 ZoneList<LOperand*>& operands,
1820 inputs_[1] = key; 1810 Zone* zone)
1811 : descriptor_(descriptor),
1812 inputs_(descriptor->environment_length() + 1, zone) {
1813 ASSERT(descriptor->environment_length() + 1 == operands.length());
1814 inputs_.AddAll(operands, zone);
1821 } 1815 }
1822 1816
1823 DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call-keyed") 1817 LOperand* target() const { return inputs_[0]; }
1824 DECLARE_HYDROGEN_ACCESSOR(CallKeyed) 1818
1819 private:
1820 DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor")
1821 DECLARE_HYDROGEN_ACCESSOR(CallWithDescriptor)
1822
1823 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1824
1825 int arity() const { return hydrogen()->argument_count() - 1; }
1826
1827 const CallInterfaceDescriptor* descriptor_;
1828 ZoneList<LOperand*> inputs_;
1829
1830 // Iterator support.
1831 virtual int InputCount() V8_FINAL V8_OVERRIDE { return inputs_.length(); }
1832 virtual LOperand* InputAt(int i) V8_FINAL V8_OVERRIDE { return inputs_[i]; }
1833
1834 virtual int TempCount() V8_FINAL V8_OVERRIDE { return 0; }
1835 virtual LOperand* TempAt(int i) V8_FINAL V8_OVERRIDE { return NULL; }
1836 };
1837
1838
1839 class LInvokeFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1840 public:
1841 LInvokeFunction(LOperand* context, LOperand* function) {
1842 inputs_[0] = context;
1843 inputs_[1] = function;
1844 }
1825 1845
1826 LOperand* context() { return inputs_[0]; } 1846 LOperand* context() { return inputs_[0]; }
1827 LOperand* key() { return inputs_[1]; } 1847 LOperand* function() { return inputs_[1]; }
1848
1849 DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function")
1850 DECLARE_HYDROGEN_ACCESSOR(InvokeFunction)
1828 1851
1829 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; 1852 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1830 1853
1831 int arity() const { return hydrogen()->argument_count() - 1; } 1854 int arity() const { return hydrogen()->argument_count() - 1; }
1832 }; 1855 };
1833 1856
1834
1835 class LCallNamed V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1836 public:
1837 explicit LCallNamed(LOperand* context) {
1838 inputs_[0] = context;
1839 }
1840
1841 LOperand* context() { return inputs_[0]; }
1842
1843 DECLARE_CONCRETE_INSTRUCTION(CallNamed, "call-named")
1844 DECLARE_HYDROGEN_ACCESSOR(CallNamed)
1845
1846 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1847
1848 Handle<String> name() const { return hydrogen()->name(); }
1849 int arity() const { return hydrogen()->argument_count() - 1; }
1850 };
1851
1852 1857
1853 class LCallFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> { 1858 class LCallFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1854 public: 1859 public:
1855 LCallFunction(LOperand* context, LOperand* function) { 1860 LCallFunction(LOperand* context, LOperand* function) {
1856 inputs_[0] = context; 1861 inputs_[0] = context;
1857 inputs_[1] = function; 1862 inputs_[1] = function;
1858 } 1863 }
1859 1864
1860 DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function") 1865 DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function")
1861 DECLARE_HYDROGEN_ACCESSOR(CallFunction) 1866 DECLARE_HYDROGEN_ACCESSOR(CallFunction)
1862 1867
1863 LOperand* context() { return inputs_[0]; } 1868 LOperand* context() { return inputs_[0]; }
1864 LOperand* function() { return inputs_[1]; } 1869 LOperand* function() { return inputs_[1]; }
1865 int arity() const { return hydrogen()->argument_count() - 1; } 1870 int arity() const { return hydrogen()->argument_count() - 1; }
1866 }; 1871 };
1867 1872
1868 1873
1869 class LCallGlobal V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1870 public:
1871 explicit LCallGlobal(LOperand* context) {
1872 inputs_[0] = context;
1873 }
1874
1875 LOperand* context() { return inputs_[0]; }
1876
1877 DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call-global")
1878 DECLARE_HYDROGEN_ACCESSOR(CallGlobal)
1879
1880 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1881
1882 Handle<String> name() const {return hydrogen()->name(); }
1883 int arity() const { return hydrogen()->argument_count() - 1; }
1884 };
1885
1886
1887 class LCallKnownGlobal V8_FINAL : public LTemplateInstruction<1, 0, 0> {
1888 public:
1889 DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal, "call-known-global")
1890 DECLARE_HYDROGEN_ACCESSOR(CallKnownGlobal)
1891
1892 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1893
1894 int arity() const { return hydrogen()->argument_count() - 1; }
1895 };
1896
1897
1898 class LCallNew V8_FINAL : public LTemplateInstruction<1, 2, 0> { 1874 class LCallNew V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1899 public: 1875 public:
1900 LCallNew(LOperand* context, LOperand* constructor) { 1876 LCallNew(LOperand* context, LOperand* constructor) {
1901 inputs_[0] = context; 1877 inputs_[0] = context;
1902 inputs_[1] = constructor; 1878 inputs_[1] = constructor;
1903 } 1879 }
1904 1880
1905 LOperand* context() { return inputs_[0]; } 1881 LOperand* context() { return inputs_[0]; }
1906 LOperand* constructor() { return inputs_[1]; } 1882 LOperand* constructor() { return inputs_[1]; }
1907 1883
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
2730 // Will not be moved to a register even if one is freely available. 2706 // Will not be moved to a register even if one is freely available.
2731 virtual MUST_USE_RESULT LOperand* UseAny(HValue* value) V8_OVERRIDE; 2707 virtual MUST_USE_RESULT LOperand* UseAny(HValue* value) V8_OVERRIDE;
2732 2708
2733 // Temporary operand that must be in a register. 2709 // Temporary operand that must be in a register.
2734 MUST_USE_RESULT LUnallocated* TempRegister(); 2710 MUST_USE_RESULT LUnallocated* TempRegister();
2735 MUST_USE_RESULT LOperand* FixedTemp(Register reg); 2711 MUST_USE_RESULT LOperand* FixedTemp(Register reg);
2736 MUST_USE_RESULT LOperand* FixedTemp(XMMRegister reg); 2712 MUST_USE_RESULT LOperand* FixedTemp(XMMRegister reg);
2737 2713
2738 // Methods for setting up define-use relationships. 2714 // Methods for setting up define-use relationships.
2739 // Return the same instruction that they are passed. 2715 // Return the same instruction that they are passed.
2740 template<int I, int T> 2716 LInstruction* Define(LTemplateResultInstruction<1>* instr,
2741 LInstruction* Define(LTemplateInstruction<1, I, T>* instr, 2717 LUnallocated* result);
2742 LUnallocated* result); 2718 LInstruction* DefineAsRegister(LTemplateResultInstruction<1>* instr);
2743 template<int I, int T> 2719 LInstruction* DefineAsSpilled(LTemplateResultInstruction<1>* instr,
2744 LInstruction* DefineAsRegister(LTemplateInstruction<1, I, T>* instr); 2720 int index);
2745 template<int I, int T> 2721 LInstruction* DefineSameAsFirst(LTemplateResultInstruction<1>* instr);
2746 LInstruction* DefineAsSpilled(LTemplateInstruction<1, I, T>* instr, 2722 LInstruction* DefineFixed(LTemplateResultInstruction<1>* instr,
2747 int index); 2723 Register reg);
2748 template<int I, int T> 2724 LInstruction* DefineFixedDouble(LTemplateResultInstruction<1>* instr,
2749 LInstruction* DefineSameAsFirst(LTemplateInstruction<1, I, T>* instr); 2725 XMMRegister reg);
2750 template<int I, int T>
2751 LInstruction* DefineFixed(LTemplateInstruction<1, I, T>* instr,
2752 Register reg);
2753 template<int I, int T>
2754 LInstruction* DefineFixedDouble(LTemplateInstruction<1, I, T>* instr,
2755 XMMRegister reg);
2756 // Assigns an environment to an instruction. An instruction which can 2726 // Assigns an environment to an instruction. An instruction which can
2757 // deoptimize must have an environment. 2727 // deoptimize must have an environment.
2758 LInstruction* AssignEnvironment(LInstruction* instr); 2728 LInstruction* AssignEnvironment(LInstruction* instr);
2759 // Assigns a pointer map to an instruction. An instruction which can 2729 // Assigns a pointer map to an instruction. An instruction which can
2760 // trigger a GC or a lazy deoptimization must have a pointer map. 2730 // trigger a GC or a lazy deoptimization must have a pointer map.
2761 LInstruction* AssignPointerMap(LInstruction* instr); 2731 LInstruction* AssignPointerMap(LInstruction* instr);
2762 2732
2763 enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY }; 2733 enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY };
2764 2734
2765 // Marks a call for the register allocator. Assigns a pointer map to 2735 // Marks a call for the register allocator. Assigns a pointer map to
(...skipping 26 matching lines...) Expand all
2792 2762
2793 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2763 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2794 }; 2764 };
2795 2765
2796 #undef DECLARE_HYDROGEN_ACCESSOR 2766 #undef DECLARE_HYDROGEN_ACCESSOR
2797 #undef DECLARE_CONCRETE_INSTRUCTION 2767 #undef DECLARE_CONCRETE_INSTRUCTION
2798 2768
2799 } } // namespace v8::int 2769 } } // namespace v8::int
2800 2770
2801 #endif // V8_X64_LITHIUM_X64_H_ 2771 #endif // V8_X64_LITHIUM_X64_H_
OLDNEW
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698