Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: src/arm64/code-stubs-arm64.h

Issue 527933002: Unify some PlatformCodeStubs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_ARM64_CODE_STUBS_ARM64_H_ 5 #ifndef V8_ARM64_CODE_STUBS_ARM64_H_
6 #define V8_ARM64_CODE_STUBS_ARM64_H_ 6 #define V8_ARM64_CODE_STUBS_ARM64_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, Label* call_generic_code); 14 void ArrayNativeCode(MacroAssembler* masm, Label* call_generic_code);
15 15
16 16
17 class StoreBufferOverflowStub: public PlatformCodeStub {
18 public:
19 StoreBufferOverflowStub(Isolate* isolate, SaveFPRegsMode save_fp)
20 : PlatformCodeStub(isolate), save_doubles_(save_fp) { }
21
22 void Generate(MacroAssembler* masm);
23
24 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate);
25 virtual bool SometimesSetsUpAFrame() { return false; }
26
27 private:
28 SaveFPRegsMode save_doubles_;
29
30 Major MajorKey() const { return StoreBufferOverflow; }
31 uint32_t MinorKey() const { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; }
32 };
33
34
35 class StringHelper : public AllStatic { 17 class StringHelper : public AllStatic {
36 public: 18 public:
37 // TODO(all): These don't seem to be used any more. Delete them. 19 // TODO(all): These don't seem to be used any more. Delete them.
38 20
39 // Generate string hash. 21 // Generate string hash.
40 static void GenerateHashInit(MacroAssembler* masm, 22 static void GenerateHashInit(MacroAssembler* masm,
41 Register hash, 23 Register hash,
42 Register character); 24 Register character);
43 25
44 static void GenerateHashAddCharacter(MacroAssembler* masm, 26 static void GenerateHashAddCharacter(MacroAssembler* masm,
45 Register hash, 27 Register hash,
46 Register character); 28 Register character);
47 29
48 static void GenerateHashGetHash(MacroAssembler* masm, 30 static void GenerateHashGetHash(MacroAssembler* masm,
49 Register hash, 31 Register hash,
50 Register scratch); 32 Register scratch);
51 33
34 // Compares two flat ASCII strings and returns result in x0.
35 static void GenerateCompareFlatAsciiStrings(
36 MacroAssembler* masm, Register left, Register right, Register scratch1,
37 Register scratch2, Register scratch3, Register scratch4);
38
39 // Compare two flat ASCII strings for equality and returns result in x0.
40 static void GenerateFlatAsciiStringEquals(MacroAssembler* masm, Register left,
41 Register right, Register scratch1,
42 Register scratch2,
43 Register scratch3);
44
52 private: 45 private:
46 static void GenerateAsciiCharsCompareLoop(MacroAssembler* masm, Register left,
47 Register right, Register length,
48 Register scratch1,
49 Register scratch2,
50 Label* chars_not_equal);
51
53 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper); 52 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper);
54 }; 53 };
55 54
56 55
57 class StoreRegistersStateStub: public PlatformCodeStub { 56 class StoreRegistersStateStub: public PlatformCodeStub {
58 public: 57 public:
59 explicit StoreRegistersStateStub(Isolate* isolate) 58 explicit StoreRegistersStateStub(Isolate* isolate)
60 : PlatformCodeStub(isolate) {} 59 : PlatformCodeStub(isolate) {}
61 60
62 static Register to_be_pushed_lr() { return ip0; } 61 static Register to_be_pushed_lr() { return ip0; }
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 397
399 Major MajorKey() const { return NameDictionaryLookup; } 398 Major MajorKey() const { return NameDictionaryLookup; }
400 399
401 uint32_t MinorKey() const { return LookupModeBits::encode(mode_); } 400 uint32_t MinorKey() const { return LookupModeBits::encode(mode_); }
402 401
403 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; 402 class LookupModeBits: public BitField<LookupMode, 0, 1> {};
404 403
405 LookupMode mode_; 404 LookupMode mode_;
406 }; 405 };
407 406
408
409 class SubStringStub: public PlatformCodeStub {
410 public:
411 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {}
412
413 private:
414 Major MajorKey() const { return SubString; }
415 uint32_t MinorKey() const { return 0; }
416
417 void Generate(MacroAssembler* masm);
418 };
419
420
421 class StringCompareStub: public PlatformCodeStub {
422 public:
423 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) { }
424
425 // Compares two flat ASCII strings and returns result in x0.
426 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm,
427 Register left,
428 Register right,
429 Register scratch1,
430 Register scratch2,
431 Register scratch3,
432 Register scratch4);
433
434 // Compare two flat ASCII strings for equality and returns result
435 // in x0.
436 static void GenerateFlatAsciiStringEquals(MacroAssembler* masm,
437 Register left,
438 Register right,
439 Register scratch1,
440 Register scratch2,
441 Register scratch3);
442
443 private:
444 virtual Major MajorKey() const { return StringCompare; }
445 virtual uint32_t MinorKey() const { return 0; }
446 virtual void Generate(MacroAssembler* masm);
447
448 static void GenerateAsciiCharsCompareLoop(MacroAssembler* masm,
449 Register left,
450 Register right,
451 Register length,
452 Register scratch1,
453 Register scratch2,
454 Label* chars_not_equal);
455 };
456
457 } } // namespace v8::internal 407 } } // namespace v8::internal
458 408
459 #endif // V8_ARM64_CODE_STUBS_ARM64_H_ 409 #endif // V8_ARM64_CODE_STUBS_ARM64_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698