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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.h
diff --git a/src/code-stubs.h b/src/code-stubs.h
index eb80859ccb1eb6900b6dccc89eb902c83465348c..5b804d60bc99d82ee3bd60cc63d14ca225eecb39 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -72,6 +72,7 @@ namespace internal {
V(ArgumentsAccess) \
V(RegExpConstructResult) \
V(NumberToString) \
+ V(DoubleToI) \
V(CEntry) \
V(JSEntry) \
V(KeyedLoadElement) \
@@ -1766,6 +1767,60 @@ class KeyedLoadDictionaryElementStub : public PlatformCodeStub {
};
+class DoubleToIStub : public PlatformCodeStub {
+ public:
+ DoubleToIStub(Register source,
+ Register destination,
+ int offset,
+ bool is_truncating) : bit_field_(0) {
+ bit_field_ = SourceRegisterBits::encode(source.code_) |
+ DestinationRegisterBits::encode(destination.code_) |
+ OffsetBits::encode(offset) |
+ IsTruncatingBits::encode(is_truncating);
+ }
+
+ Register source() {
+ Register result = { SourceRegisterBits::decode(bit_field_) };
+ return result;
+ }
+
+ Register destination() {
+ Register result = { DestinationRegisterBits::decode(bit_field_) };
+ return result;
+ }
+
+ bool is_truncating() {
+ return IsTruncatingBits::decode(bit_field_);
+ }
+
+ int offset() {
+ return OffsetBits::decode(bit_field_);
+ }
+
+ void Generate(MacroAssembler* masm);
+
+ private:
+ static const int kBitsPerRegisterNumber = 6;
+ STATIC_ASSERT((1L << kBitsPerRegisterNumber) >= Register::kNumRegisters);
+ class SourceRegisterBits:
+ public BitField<int, 0, kBitsPerRegisterNumber> {}; // NOLINT
+ class DestinationRegisterBits:
+ public BitField<int, kBitsPerRegisterNumber,
+ kBitsPerRegisterNumber> {}; // NOLINT
+ class IsTruncatingBits:
+ public BitField<bool, 2 * kBitsPerRegisterNumber, 1> {}; // NOLINT
+ class OffsetBits:
+ public BitField<int, 2 * kBitsPerRegisterNumber + 1, 3> {}; // NOLINT
+
+ Major MajorKey() { return DoubleToI; }
+ int MinorKey() { return bit_field_; }
+
+ int bit_field_;
+
+ DISALLOW_COPY_AND_ASSIGN(DoubleToIStub);
+};
+
+
class KeyedLoadFastElementStub : public HydrogenCodeStub {
public:
KeyedLoadFastElementStub(bool is_js_array, ElementsKind elements_kind) {
« 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