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

Side by Side Diff: src/arm/code-stubs-arm.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
« no previous file with comments | « no previous file | src/arm/code-stubs-arm.cc » ('j') | src/arm/code-stubs-arm.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_ARM_CODE_STUBS_ARM_H_ 5 #ifndef V8_ARM_CODE_STUBS_ARM_H_
6 #define V8_ARM_CODE_STUBS_ARM_H_ 6 #define V8_ARM_CODE_STUBS_ARM_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 // Generate code for copying a large number of characters. This function 19 // Generate code for copying a large number of characters. This function
38 // is allowed to spend extra time setting up conditions to make copying 20 // is allowed to spend extra time setting up conditions to make copying
39 // faster. Copying of overlapping regions is not supported. 21 // faster. Copying of overlapping regions is not supported.
40 // Dest register ends at the position after the last character written. 22 // Dest register ends at the position after the last character written.
41 static void GenerateCopyCharacters(MacroAssembler* masm, 23 static void GenerateCopyCharacters(MacroAssembler* masm,
42 Register dest, 24 Register dest,
43 Register src, 25 Register src,
44 Register count, 26 Register count,
45 Register scratch, 27 Register scratch,
46 String::Encoding encoding); 28 String::Encoding encoding);
47 29
48 30
49 // Generate string hash. 31 // Generate string hash.
50 static void GenerateHashInit(MacroAssembler* masm, 32 static void GenerateHashInit(MacroAssembler* masm,
51 Register hash, 33 Register hash,
52 Register character); 34 Register character);
53 35
54 static void GenerateHashAddCharacter(MacroAssembler* masm, 36 static void GenerateHashAddCharacter(MacroAssembler* masm,
55 Register hash, 37 Register hash,
56 Register character); 38 Register character);
57 39
58 static void GenerateHashGetHash(MacroAssembler* masm, 40 static void GenerateHashGetHash(MacroAssembler* masm,
59 Register hash); 41 Register hash);
60 42
61 private:
62 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper);
63 };
64
65
66 class SubStringStub: public PlatformCodeStub {
67 public:
68 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {}
69
70 private:
71 Major MajorKey() const { return SubString; }
72 uint32_t MinorKey() const { return 0; }
73
74 void Generate(MacroAssembler* masm);
75 };
76
77
78
79 class StringCompareStub: public PlatformCodeStub {
80 public:
81 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) { }
82
83 // Compares two flat ASCII strings and returns result in r0. 43 // Compares two flat ASCII strings and returns result in r0.
84 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, 44 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm,
85 Register left, 45 Register left,
86 Register right, 46 Register right,
87 Register scratch1, 47 Register scratch1,
88 Register scratch2, 48 Register scratch2,
89 Register scratch3, 49 Register scratch3,
90 Register scratch4); 50 Register scratch4);
91 51
92 // Compares two flat ASCII strings for equality and returns result 52 // Compares two flat ASCII strings for equality and returns result in r0.
93 // in r0.
94 static void GenerateFlatAsciiStringEquals(MacroAssembler* masm, 53 static void GenerateFlatAsciiStringEquals(MacroAssembler* masm,
95 Register left, 54 Register left,
96 Register right, 55 Register right,
97 Register scratch1, 56 Register scratch1,
98 Register scratch2, 57 Register scratch2,
99 Register scratch3); 58 Register scratch3);
100 59
101 private: 60 private:
102 virtual Major MajorKey() const { return StringCompare; }
103 virtual uint32_t MinorKey() const { return 0; }
104 virtual void Generate(MacroAssembler* masm);
105
106 static void GenerateAsciiCharsCompareLoop(MacroAssembler* masm, 61 static void GenerateAsciiCharsCompareLoop(MacroAssembler* masm,
107 Register left, 62 Register left,
108 Register right, 63 Register right,
109 Register length, 64 Register length,
110 Register scratch1, 65 Register scratch1,
111 Register scratch2, 66 Register scratch2,
112 Label* chars_not_equal); 67 Label* chars_not_equal);
68
69 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper);
113 }; 70 };
114 71
115 72
116 // This stub can convert a signed int32 to a heap number (double). It does 73 // This stub can convert a signed int32 to a heap number (double). It does
117 // not work for int32s that are in Smi range! No GC occurs during this stub 74 // not work for int32s that are in Smi range! No GC occurs during this stub
118 // so you don't have to set up the frame. 75 // so you don't have to set up the frame.
119 class WriteInt32ToHeapNumberStub : public PlatformCodeStub { 76 class WriteInt32ToHeapNumberStub : public PlatformCodeStub {
120 public: 77 public:
121 WriteInt32ToHeapNumberStub(Isolate* isolate, 78 WriteInt32ToHeapNumberStub(Isolate* isolate,
122 Register the_int, 79 Register the_int,
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 uint32_t MinorKey() const { return LookupModeBits::encode(mode_); } 355 uint32_t MinorKey() const { return LookupModeBits::encode(mode_); }
399 356
400 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; 357 class LookupModeBits: public BitField<LookupMode, 0, 1> {};
401 358
402 LookupMode mode_; 359 LookupMode mode_;
403 }; 360 };
404 361
405 } } // namespace v8::internal 362 } } // namespace v8::internal
406 363
407 #endif // V8_ARM_CODE_STUBS_ARM_H_ 364 #endif // V8_ARM_CODE_STUBS_ARM_H_
OLDNEW
« no previous file with comments | « no previous file | src/arm/code-stubs-arm.cc » ('j') | src/arm/code-stubs-arm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698