| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_X87_CODE_STUBS_X87_H_ | 5 #ifndef V8_X87_CODE_STUBS_X87_H_ |
| 6 #define V8_X87_CODE_STUBS_X87_H_ | 6 #define V8_X87_CODE_STUBS_X87_H_ |
| 7 | 7 |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| 11 namespace internal { | 11 namespace internal { |
| 12 | 12 |
| 13 | 13 |
| 14 void ArrayNativeCode(MacroAssembler* masm, | 14 void ArrayNativeCode(MacroAssembler* masm, |
| 15 bool construct_call, | 15 bool construct_call, |
| 16 Label* call_generic_code); | 16 Label* call_generic_code); |
| 17 | 17 |
| 18 | 18 |
| 19 class StoreBufferOverflowStub : public PlatformCodeStub { | |
| 20 public: | |
| 21 explicit StoreBufferOverflowStub(Isolate* isolate) | |
| 22 : PlatformCodeStub(isolate) { } | |
| 23 | |
| 24 void Generate(MacroAssembler* masm); | |
| 25 | |
| 26 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); | |
| 27 virtual bool SometimesSetsUpAFrame() { return false; } | |
| 28 | |
| 29 private: | |
| 30 Major MajorKey() const { return StoreBufferOverflow; } | |
| 31 uint32_t MinorKey() const { return 0; } | |
| 32 }; | |
| 33 | |
| 34 | |
| 35 class StringHelper : public AllStatic { | 19 class StringHelper : public AllStatic { |
| 36 public: | 20 public: |
| 37 // Generate code for copying characters using the rep movs instruction. | 21 // Generate code for copying characters using the rep movs instruction. |
| 38 // Copies ecx characters from esi to edi. Copying of overlapping regions is | 22 // Copies ecx characters from esi to edi. Copying of overlapping regions is |
| 39 // not supported. | 23 // not supported. |
| 40 static void GenerateCopyCharacters(MacroAssembler* masm, | 24 static void GenerateCopyCharacters(MacroAssembler* masm, |
| 41 Register dest, | 25 Register dest, |
| 42 Register src, | 26 Register src, |
| 43 Register count, | 27 Register count, |
| 44 Register scratch, | 28 Register scratch, |
| 45 String::Encoding encoding); | 29 String::Encoding encoding); |
| 46 | 30 |
| 47 // Generate string hash. | 31 // Generate string hash. |
| 48 static void GenerateHashInit(MacroAssembler* masm, | 32 static void GenerateHashInit(MacroAssembler* masm, |
| 49 Register hash, | 33 Register hash, |
| 50 Register character, | 34 Register character, |
| 51 Register scratch); | 35 Register scratch); |
| 36 |
| 52 static void GenerateHashAddCharacter(MacroAssembler* masm, | 37 static void GenerateHashAddCharacter(MacroAssembler* masm, |
| 53 Register hash, | 38 Register hash, |
| 54 Register character, | 39 Register character, |
| 55 Register scratch); | 40 Register scratch); |
| 41 |
| 56 static void GenerateHashGetHash(MacroAssembler* masm, | 42 static void GenerateHashGetHash(MacroAssembler* masm, |
| 57 Register hash, | 43 Register hash, |
| 58 Register scratch); | 44 Register scratch); |
| 59 | 45 |
| 60 private: | |
| 61 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper); | |
| 62 }; | |
| 63 | |
| 64 | |
| 65 class SubStringStub: public PlatformCodeStub { | |
| 66 public: | |
| 67 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | |
| 68 | |
| 69 private: | |
| 70 Major MajorKey() const { return SubString; } | |
| 71 uint32_t MinorKey() const { return 0; } | |
| 72 | |
| 73 void Generate(MacroAssembler* masm); | |
| 74 }; | |
| 75 | |
| 76 | |
| 77 class StringCompareStub: public PlatformCodeStub { | |
| 78 public: | |
| 79 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) { } | |
| 80 | |
| 81 // Compares two flat ASCII strings and returns result in eax. | 46 // Compares two flat ASCII strings and returns result in eax. |
| 82 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, | 47 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, |
| 83 Register left, | 48 Register left, Register right, |
| 84 Register right, | |
| 85 Register scratch1, | 49 Register scratch1, |
| 86 Register scratch2, | 50 Register scratch2, |
| 87 Register scratch3); | 51 Register scratch3); |
| 88 | 52 |
| 89 // Compares two flat ASCII strings for equality and returns result | 53 // Compares two flat ASCII strings for equality and returns result in eax. |
| 90 // in eax. | |
| 91 static void GenerateFlatAsciiStringEquals(MacroAssembler* masm, | 54 static void GenerateFlatAsciiStringEquals(MacroAssembler* masm, |
| 92 Register left, | 55 Register left, |
| 93 Register right, | 56 Register right, |
| 94 Register scratch1, | 57 Register scratch1, |
| 95 Register scratch2); | 58 Register scratch2); |
| 96 | 59 |
| 97 private: | 60 private: |
| 98 virtual Major MajorKey() const { return StringCompare; } | |
| 99 virtual uint32_t MinorKey() const { return 0; } | |
| 100 virtual void Generate(MacroAssembler* masm); | |
| 101 | |
| 102 static void GenerateAsciiCharsCompareLoop( | 61 static void GenerateAsciiCharsCompareLoop( |
| 103 MacroAssembler* masm, | 62 MacroAssembler* masm, |
| 104 Register left, | 63 Register left, |
| 105 Register right, | 64 Register right, |
| 106 Register length, | 65 Register length, |
| 107 Register scratch, | 66 Register scratch, |
| 108 Label* chars_not_equal, | 67 Label* chars_not_equal, |
| 109 Label::Distance chars_not_equal_near = Label::kFar); | 68 Label::Distance chars_not_equal_near = Label::kFar); |
| 69 |
| 70 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper); |
| 110 }; | 71 }; |
| 111 | 72 |
| 112 | 73 |
| 113 class NameDictionaryLookupStub: public PlatformCodeStub { | 74 class NameDictionaryLookupStub: public PlatformCodeStub { |
| 114 public: | 75 public: |
| 115 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; | 76 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; |
| 116 | 77 |
| 117 NameDictionaryLookupStub(Isolate* isolate, | 78 NameDictionaryLookupStub(Isolate* isolate, |
| 118 Register dictionary, | 79 Register dictionary, |
| 119 Register result, | 80 Register result, |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 Register value_; | 364 Register value_; |
| 404 Register address_; | 365 Register address_; |
| 405 RememberedSetAction remembered_set_action_; | 366 RememberedSetAction remembered_set_action_; |
| 406 RegisterAllocation regs_; | 367 RegisterAllocation regs_; |
| 407 }; | 368 }; |
| 408 | 369 |
| 409 | 370 |
| 410 } } // namespace v8::internal | 371 } } // namespace v8::internal |
| 411 | 372 |
| 412 #endif // V8_X87_CODE_STUBS_X87_H_ | 373 #endif // V8_X87_CODE_STUBS_X87_H_ |
| OLD | NEW |