Index: src/x64/code-stubs-x64.h |
diff --git a/src/x64/code-stubs-x64.h b/src/x64/code-stubs-x64.h |
index 5398452e09614df64acdaa155eafd0752becad55..e7bbef0e50b5754c6d7703f65fe11d0f816d161f 100644 |
--- a/src/x64/code-stubs-x64.h |
+++ b/src/x64/code-stubs-x64.h |
@@ -421,6 +421,73 @@ class NumberToStringStub: public CodeStub { |
}; |
+class StringDictionaryLookupStub: public CodeStub { |
+ public: |
+ enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; |
+ |
+ StringDictionaryLookupStub(Register dictionary, |
+ Register result, |
+ Register index, |
+ LookupMode mode) |
+ : dictionary_(dictionary), result_(result), index_(index), mode_(mode) { } |
+ |
+ void Generate(MacroAssembler* masm); |
+ |
+ static void GenerateNegativeLookup(MacroAssembler* masm, |
+ Label* miss, |
+ Label* done, |
+ Register properties, |
+ String* name, |
+ Register r0); |
+ |
+ static void GeneratePositiveLookup(MacroAssembler* masm, |
+ Label* miss, |
+ Label* done, |
+ Register elements, |
+ Register name, |
+ Register r0, |
+ Register r1); |
+ private: |
Mads Ager (chromium)
2011/05/05 11:54:56
Move.
Vyacheslav Egorov (Chromium)
2011/05/05 12:30:16
Done.
|
+ |
+ static const int kInlinedProbes = 4; |
+ static const int kTotalProbes = 20; |
+ |
+ static const int kCapacityOffset = |
+ StringDictionary::kHeaderSize + |
+ StringDictionary::kCapacityIndex * kPointerSize; |
+ |
+ static const int kElementsStartOffset = |
+ StringDictionary::kHeaderSize + |
+ StringDictionary::kElementsStartIndex * kPointerSize; |
+ |
+ |
+#ifdef DEBUG |
+ void Print() { |
+ PrintF("StringDictionaryLookupStub\n"); |
+ } |
+#endif |
+ |
+ Major MajorKey() { return StringDictionaryNegativeLookup; } |
+ |
+ int MinorKey() { |
+ return DictionaryBits::encode(dictionary_.code()) | |
+ ResultBits::encode(result_.code()) | |
+ IndexBits::encode(index_.code()) | |
+ LookupModeBits::encode(mode_); |
+ } |
+ |
+ class DictionaryBits: public BitField<int, 0, 4> {}; |
+ class ResultBits: public BitField<int, 4, 4> {}; |
+ class IndexBits: public BitField<int, 8, 4> {}; |
+ class LookupModeBits: public BitField<LookupMode, 12, 1> {}; |
+ |
+ Register dictionary_; |
+ Register result_; |
+ Register index_; |
+ LookupMode mode_; |
+}; |
+ |
+ |
} } // namespace v8::internal |
#endif // V8_X64_CODE_STUBS_X64_H_ |