Index: src/ia32/code-stubs-ia32.h |
diff --git a/src/ia32/code-stubs-ia32.h b/src/ia32/code-stubs-ia32.h |
index dcbcc61acb0e049b257ac90000b2b49d3b73a37a..cc5f270201a4782d3edb6fed68a22183899f8233 100644 |
--- a/src/ia32/code-stubs-ia32.h |
+++ b/src/ia32/code-stubs-ia32.h |
@@ -424,6 +424,74 @@ class NumberToStringStub: public CodeStub { |
#endif |
}; |
+ |
+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
Ditto.
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, 3> {}; |
+ class ResultBits: public BitField<int, 3, 3> {}; |
+ class IndexBits: public BitField<int, 6, 3> {}; |
+ class LookupModeBits: public BitField<LookupMode, 9, 1> {}; |
+ |
+ Register dictionary_; |
+ Register result_; |
+ Register index_; |
+ LookupMode mode_; |
+}; |
+ |
+ |
} } // namespace v8::internal |
#endif // V8_IA32_CODE_STUBS_IA32_H_ |