| 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..44e277591dbd5f07adcc5ed69fa7311ce9f8fed3 100644
|
| --- a/src/x64/code-stubs-x64.h
|
| +++ b/src/x64/code-stubs-x64.h
|
| @@ -364,10 +364,9 @@ class SubStringStub: public CodeStub {
|
|
|
| class StringCompareStub: public CodeStub {
|
| public:
|
| - explicit StringCompareStub() {}
|
| + StringCompareStub() {}
|
|
|
| - // Compare two flat ascii strings and returns result in rax after popping two
|
| - // arguments from the stack.
|
| + // Compares two flat ASCII strings and returns result in rax.
|
| static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm,
|
| Register left,
|
| Register right,
|
| @@ -376,11 +375,25 @@ class StringCompareStub: public CodeStub {
|
| Register scratch3,
|
| Register scratch4);
|
|
|
| - private:
|
| - Major MajorKey() { return StringCompare; }
|
| - int MinorKey() { return 0; }
|
| + // Compares two flat ASCII strings for equality and returns result
|
| + // in rax.
|
| + static void GenerateFlatAsciiStringEquals(MacroAssembler* masm,
|
| + Register left,
|
| + Register right,
|
| + Register scratch1,
|
| + Register scratch2);
|
|
|
| - void Generate(MacroAssembler* masm);
|
| + private:
|
| + virtual Major MajorKey() { return StringCompare; }
|
| + virtual int MinorKey() { return 0; }
|
| + virtual void Generate(MacroAssembler* masm);
|
| +
|
| + static void GenerateAsciiCharsCompareLoop(MacroAssembler* masm,
|
| + Register left,
|
| + Register right,
|
| + Register length,
|
| + Register scratch,
|
| + NearLabel* chars_not_equal);
|
| };
|
|
|
|
|
| @@ -421,6 +434,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:
|
| + 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_
|
|
|