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

Side by Side Diff: src/hydrogen-instructions.h

Issue 178583006: Introduce intrinsics for double values in Javascript. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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
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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 V(CheckValue) \ 95 V(CheckValue) \
96 V(ClampToUint8) \ 96 V(ClampToUint8) \
97 V(ClassOfTestAndBranch) \ 97 V(ClassOfTestAndBranch) \
98 V(CompareNumericAndBranch) \ 98 V(CompareNumericAndBranch) \
99 V(CompareHoleAndBranch) \ 99 V(CompareHoleAndBranch) \
100 V(CompareGeneric) \ 100 V(CompareGeneric) \
101 V(CompareMinusZeroAndBranch) \ 101 V(CompareMinusZeroAndBranch) \
102 V(CompareObjectEqAndBranch) \ 102 V(CompareObjectEqAndBranch) \
103 V(CompareMap) \ 103 V(CompareMap) \
104 V(Constant) \ 104 V(Constant) \
105 V(ConstructDouble) \
105 V(Context) \ 106 V(Context) \
106 V(DateField) \ 107 V(DateField) \
107 V(DebugBreak) \ 108 V(DebugBreak) \
108 V(DeclareGlobals) \ 109 V(DeclareGlobals) \
109 V(Deoptimize) \ 110 V(Deoptimize) \
110 V(Div) \ 111 V(Div) \
112 V(DoubleBits) \
111 V(DummyUse) \ 113 V(DummyUse) \
112 V(EnterInlined) \ 114 V(EnterInlined) \
113 V(EnvironmentMarker) \ 115 V(EnvironmentMarker) \
114 V(ForceRepresentation) \ 116 V(ForceRepresentation) \
115 V(ForInCacheArray) \ 117 V(ForInCacheArray) \
116 V(ForInPrepareMap) \ 118 V(ForInPrepareMap) \
117 V(FunctionLiteral) \ 119 V(FunctionLiteral) \
118 V(GetCachedArrayIndex) \ 120 V(GetCachedArrayIndex) \
119 V(Goto) \ 121 V(Goto) \
120 V(HasCachedArrayIndexAndBranch) \ 122 V(HasCachedArrayIndexAndBranch) \
(...skipping 1692 matching lines...) Expand 10 before | Expand all | Expand 10 after
1813 : HUnaryOperation(value) { 1815 : HUnaryOperation(value) {
1814 set_representation(Representation::Integer32()); 1816 set_representation(Representation::Integer32());
1815 SetFlag(kAllowUndefinedAsNaN); 1817 SetFlag(kAllowUndefinedAsNaN);
1816 SetFlag(kUseGVN); 1818 SetFlag(kUseGVN);
1817 } 1819 }
1818 1820
1819 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 1821 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
1820 }; 1822 };
1821 1823
1822 1824
1825 class HDoubleBits V8_FINAL : public HUnaryOperation {
1826 public:
1827 enum Bits { HIGH, LOW };
1828 DECLARE_INSTRUCTION_FACTORY_P2(HDoubleBits, HValue*, Bits);
1829
1830 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
1831 return Representation::Double();
1832 }
1833
1834 DECLARE_CONCRETE_INSTRUCTION(DoubleBits)
1835
1836 Bits bits() { return bits_; }
1837
1838 protected:
1839 virtual bool DataEquals(HValue* other) V8_OVERRIDE {
1840 if (!other->IsDoubleBits()) return false;
1841 HDoubleBits* db = HDoubleBits::cast(other);
1842 return db->value()->Equals(value()) && db->bits() == bits();
1843 }
1844
1845 private:
1846 HDoubleBits(HValue* value, Bits bits)
1847 : HUnaryOperation(value), bits_(bits) {
1848 set_representation(Representation::Integer32());
1849 SetFlag(kUseGVN);
1850 }
1851
1852 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
1853
1854 Bits bits_;
1855 };
1856
1857
1858 class HConstructDouble V8_FINAL : public HTemplateInstruction<2> {
1859 public:
1860 DECLARE_INSTRUCTION_FACTORY_P2(HConstructDouble, HValue*, HValue*);
1861
1862 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
1863 return Representation::Integer32();
1864 }
1865
1866 DECLARE_CONCRETE_INSTRUCTION(ConstructDouble)
1867
1868 HValue* hi() { return OperandAt(0); }
1869 HValue* lo() { return OperandAt(1); }
1870
1871 protected:
1872 virtual bool DataEquals(HValue* other) V8_OVERRIDE {
1873 if (!other->IsConstructDouble()) return false;
1874 HConstructDouble* cd = HConstructDouble::cast(other);
1875 return cd->hi()->Equals(hi()) && cd->lo()->Equals(lo());
1876 }
1877
1878 private:
1879 explicit HConstructDouble(HValue* hi, HValue* lo) {
1880 set_representation(Representation::Double());
1881 SetFlag(kUseGVN);
1882 SetOperandAt(0, hi);
1883 SetOperandAt(1, lo);
1884 }
1885
1886 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
1887 };
1888
1889
1823 enum RemovableSimulate { 1890 enum RemovableSimulate {
1824 REMOVABLE_SIMULATE, 1891 REMOVABLE_SIMULATE,
1825 FIXED_SIMULATE 1892 FIXED_SIMULATE
1826 }; 1893 };
1827 1894
1828 1895
1829 class HSimulate V8_FINAL : public HInstruction { 1896 class HSimulate V8_FINAL : public HInstruction {
1830 public: 1897 public:
1831 HSimulate(BailoutId ast_id, 1898 HSimulate(BailoutId ast_id,
1832 int pop_count, 1899 int pop_count,
(...skipping 5649 matching lines...) Expand 10 before | Expand all | Expand 10 after
7482 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 7549 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
7483 }; 7550 };
7484 7551
7485 7552
7486 #undef DECLARE_INSTRUCTION 7553 #undef DECLARE_INSTRUCTION
7487 #undef DECLARE_CONCRETE_INSTRUCTION 7554 #undef DECLARE_CONCRETE_INSTRUCTION
7488 7555
7489 } } // namespace v8::internal 7556 } } // namespace v8::internal
7490 7557
7491 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7558 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698