| Index: src/arm/code-stubs-arm.h
|
| ===================================================================
|
| --- src/arm/code-stubs-arm.h (revision 7948)
|
| +++ src/arm/code-stubs-arm.h (working copy)
|
| @@ -1,4 +1,4 @@
|
| -// Copyright 2010 the V8 project authors. All rights reserved.
|
| +// Copyright 2011 the V8 project authors. All rights reserved.
|
| // Redistribution and use in source and binary forms, with or without
|
| // modification, are permitted provided that the following conditions are
|
| // met:
|
| @@ -327,8 +327,7 @@
|
| public:
|
| StringCompareStub() { }
|
|
|
| - // Compare two flat ASCII strings and returns result in r0.
|
| - // Does not use the stack.
|
| + // Compares two flat ASCII strings and returns result in r0.
|
| static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm,
|
| Register left,
|
| Register right,
|
| @@ -337,11 +336,27 @@
|
| Register scratch3,
|
| Register scratch4);
|
|
|
| + // Compares two flat ASCII strings for equality and returns result
|
| + // in r0.
|
| + static void GenerateFlatAsciiStringEquals(MacroAssembler* masm,
|
| + Register left,
|
| + Register right,
|
| + Register scratch1,
|
| + Register scratch2,
|
| + Register scratch3);
|
| +
|
| private:
|
| - Major MajorKey() { return StringCompare; }
|
| - int MinorKey() { return 0; }
|
| + virtual Major MajorKey() { return StringCompare; }
|
| + virtual int MinorKey() { return 0; }
|
| + virtual void Generate(MacroAssembler* masm);
|
|
|
| - void Generate(MacroAssembler* masm);
|
| + static void GenerateAsciiCharsCompareLoop(MacroAssembler* masm,
|
| + Register left,
|
| + Register right,
|
| + Register length,
|
| + Register scratch1,
|
| + Register scratch2,
|
| + Label* chars_not_equal);
|
| };
|
|
|
|
|
| @@ -597,6 +612,62 @@
|
| };
|
|
|
|
|
| +class StringDictionaryLookupStub: public CodeStub {
|
| + public:
|
| + enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP };
|
| +
|
| + explicit StringDictionaryLookupStub(LookupMode mode) : mode_(mode) { }
|
| +
|
| + void Generate(MacroAssembler* masm);
|
| +
|
| + MUST_USE_RESULT static MaybeObject* GenerateNegativeLookup(
|
| + MacroAssembler* masm,
|
| + Label* miss,
|
| + Label* done,
|
| + Register receiver,
|
| + Register properties,
|
| + String* name,
|
| + Register scratch0);
|
| +
|
| + 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 LookupModeBits::encode(mode_);
|
| + }
|
| +
|
| + class LookupModeBits: public BitField<LookupMode, 0, 1> {};
|
| +
|
| + LookupMode mode_;
|
| +};
|
| +
|
| +
|
| } } // namespace v8::internal
|
|
|
| #endif // V8_ARM_CODE_STUBS_ARM_H_
|
|
|