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

Side by Side Diff: src/code-stubs.h

Issue 18612005: Implement truncated d-to-i with a stub on x86 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merge with ToT Created 7 years, 5 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 | « no previous file | src/ia32/code-stubs-ia32.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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 V(FastNewContext) \ 65 V(FastNewContext) \
66 V(FastNewBlockContext) \ 66 V(FastNewBlockContext) \
67 V(FastCloneShallowArray) \ 67 V(FastCloneShallowArray) \
68 V(FastCloneShallowObject) \ 68 V(FastCloneShallowObject) \
69 V(CreateAllocationSite) \ 69 V(CreateAllocationSite) \
70 V(ToBoolean) \ 70 V(ToBoolean) \
71 V(ToNumber) \ 71 V(ToNumber) \
72 V(ArgumentsAccess) \ 72 V(ArgumentsAccess) \
73 V(RegExpConstructResult) \ 73 V(RegExpConstructResult) \
74 V(NumberToString) \ 74 V(NumberToString) \
75 V(DoubleToI) \
75 V(CEntry) \ 76 V(CEntry) \
76 V(JSEntry) \ 77 V(JSEntry) \
77 V(KeyedLoadElement) \ 78 V(KeyedLoadElement) \
78 V(ArrayNoArgumentConstructor) \ 79 V(ArrayNoArgumentConstructor) \
79 V(ArraySingleArgumentConstructor) \ 80 V(ArraySingleArgumentConstructor) \
80 V(ArrayNArgumentsConstructor) \ 81 V(ArrayNArgumentsConstructor) \
81 V(InternalArrayNoArgumentConstructor) \ 82 V(InternalArrayNoArgumentConstructor) \
82 V(InternalArraySingleArgumentConstructor) \ 83 V(InternalArraySingleArgumentConstructor) \
83 V(InternalArrayNArgumentsConstructor) \ 84 V(InternalArrayNArgumentsConstructor) \
84 V(KeyedStoreElement) \ 85 V(KeyedStoreElement) \
(...skipping 1674 matching lines...) Expand 10 before | Expand all | Expand 10 after
1759 void Generate(MacroAssembler* masm); 1760 void Generate(MacroAssembler* masm);
1760 1761
1761 private: 1762 private:
1762 Major MajorKey() { return KeyedLoadElement; } 1763 Major MajorKey() { return KeyedLoadElement; }
1763 int MinorKey() { return DICTIONARY_ELEMENTS; } 1764 int MinorKey() { return DICTIONARY_ELEMENTS; }
1764 1765
1765 DISALLOW_COPY_AND_ASSIGN(KeyedLoadDictionaryElementStub); 1766 DISALLOW_COPY_AND_ASSIGN(KeyedLoadDictionaryElementStub);
1766 }; 1767 };
1767 1768
1768 1769
1770 class DoubleToIStub : public PlatformCodeStub {
1771 public:
1772 DoubleToIStub(Register source,
1773 Register destination,
1774 int offset,
1775 bool is_truncating) : bit_field_(0) {
1776 bit_field_ = SourceRegisterBits::encode(source.code_) |
1777 DestinationRegisterBits::encode(destination.code_) |
1778 OffsetBits::encode(offset) |
1779 IsTruncatingBits::encode(is_truncating);
1780 }
1781
1782 Register source() {
1783 Register result = { SourceRegisterBits::decode(bit_field_) };
1784 return result;
1785 }
1786
1787 Register destination() {
1788 Register result = { DestinationRegisterBits::decode(bit_field_) };
1789 return result;
1790 }
1791
1792 bool is_truncating() {
1793 return IsTruncatingBits::decode(bit_field_);
1794 }
1795
1796 int offset() {
1797 return OffsetBits::decode(bit_field_);
1798 }
1799
1800 void Generate(MacroAssembler* masm);
1801
1802 private:
1803 static const int kBitsPerRegisterNumber = 6;
1804 STATIC_ASSERT((1L << kBitsPerRegisterNumber) >= Register::kNumRegisters);
1805 class SourceRegisterBits:
1806 public BitField<int, 0, kBitsPerRegisterNumber> {}; // NOLINT
1807 class DestinationRegisterBits:
1808 public BitField<int, kBitsPerRegisterNumber,
1809 kBitsPerRegisterNumber> {}; // NOLINT
1810 class IsTruncatingBits:
1811 public BitField<bool, 2 * kBitsPerRegisterNumber, 1> {}; // NOLINT
1812 class OffsetBits:
1813 public BitField<int, 2 * kBitsPerRegisterNumber + 1, 3> {}; // NOLINT
1814
1815 Major MajorKey() { return DoubleToI; }
1816 int MinorKey() { return bit_field_; }
1817
1818 int bit_field_;
1819
1820 DISALLOW_COPY_AND_ASSIGN(DoubleToIStub);
1821 };
1822
1823
1769 class KeyedLoadFastElementStub : public HydrogenCodeStub { 1824 class KeyedLoadFastElementStub : public HydrogenCodeStub {
1770 public: 1825 public:
1771 KeyedLoadFastElementStub(bool is_js_array, ElementsKind elements_kind) { 1826 KeyedLoadFastElementStub(bool is_js_array, ElementsKind elements_kind) {
1772 bit_field_ = ElementsKindBits::encode(elements_kind) | 1827 bit_field_ = ElementsKindBits::encode(elements_kind) |
1773 IsJSArrayBits::encode(is_js_array); 1828 IsJSArrayBits::encode(is_js_array);
1774 } 1829 }
1775 1830
1776 bool is_js_array() const { 1831 bool is_js_array() const {
1777 return IsJSArrayBits::decode(bit_field_); 1832 return IsJSArrayBits::decode(bit_field_);
1778 } 1833 }
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
2322 int MinorKey() { return 0; } 2377 int MinorKey() { return 0; }
2323 2378
2324 void Generate(MacroAssembler* masm); 2379 void Generate(MacroAssembler* masm);
2325 2380
2326 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); 2381 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub);
2327 }; 2382 };
2328 2383
2329 } } // namespace v8::internal 2384 } } // namespace v8::internal
2330 2385
2331 #endif // V8_CODE_STUBS_H_ 2386 #endif // V8_CODE_STUBS_H_
OLDNEW
« no previous file with comments | « no previous file | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698