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

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

Issue 542613003: Introduce code stub constructors for stub keys. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: define MajorKey inline 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 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_X64_CODE_STUBS_X64_H_ 5 #ifndef V8_X64_CODE_STUBS_X64_H_
6 #define V8_X64_CODE_STUBS_X64_H_ 6 #define V8_X64_CODE_STUBS_X64_H_
7 7
8 #include "src/code-stubs.h"
9
10 namespace v8 { 8 namespace v8 {
11 namespace internal { 9 namespace internal {
12 10
13 11
14 void ArrayNativeCode(MacroAssembler* masm, Label* call_generic_code); 12 void ArrayNativeCode(MacroAssembler* masm, Label* call_generic_code);
15 13
16 14
17 class StringHelper : public AllStatic { 15 class StringHelper : public AllStatic {
18 public: 16 public:
19 // Generate code for copying characters using the rep movs instruction. 17 // Generate code for copying characters using the rep movs instruction.
20 // Copies rcx characters from rsi to rdi. Copying of overlapping regions is 18 // Copies rcx characters from rsi to rdi. Copying of overlapping regions is
21 // not supported. 19 // not supported.
22 static void GenerateCopyCharacters(MacroAssembler* masm, 20 static void GenerateCopyCharacters(MacroAssembler* masm,
23 Register dest, 21 Register dest,
24 Register src, 22 Register src,
25 Register count, 23 Register count,
26 String::Encoding encoding); 24 String::Encoding encoding);
27 25
28
29 // Generate string hash. 26 // Generate string hash.
30 static void GenerateHashInit(MacroAssembler* masm, 27 static void GenerateHashInit(MacroAssembler* masm,
31 Register hash, 28 Register hash,
32 Register character, 29 Register character,
33 Register scratch); 30 Register scratch);
34 31
35 static void GenerateHashAddCharacter(MacroAssembler* masm, 32 static void GenerateHashAddCharacter(MacroAssembler* masm,
36 Register hash, 33 Register hash,
37 Register character, 34 Register character,
38 Register scratch); 35 Register scratch);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 static const int kTotalProbes = 20; 100 static const int kTotalProbes = 20;
104 101
105 static const int kCapacityOffset = 102 static const int kCapacityOffset =
106 NameDictionary::kHeaderSize + 103 NameDictionary::kHeaderSize +
107 NameDictionary::kCapacityIndex * kPointerSize; 104 NameDictionary::kCapacityIndex * kPointerSize;
108 105
109 static const int kElementsStartOffset = 106 static const int kElementsStartOffset =
110 NameDictionary::kHeaderSize + 107 NameDictionary::kHeaderSize +
111 NameDictionary::kElementsStartIndex * kPointerSize; 108 NameDictionary::kElementsStartIndex * kPointerSize;
112 109
113 virtual inline Major MajorKey() const FINAL OVERRIDE;
114
115 Register dictionary() const { 110 Register dictionary() const {
116 return Register::from_code(DictionaryBits::decode(minor_key_)); 111 return Register::from_code(DictionaryBits::decode(minor_key_));
117 } 112 }
118 113
119 Register result() const { 114 Register result() const {
120 return Register::from_code(ResultBits::decode(minor_key_)); 115 return Register::from_code(ResultBits::decode(minor_key_));
121 } 116 }
122 117
123 Register index() const { 118 Register index() const {
124 return Register::from_code(IndexBits::decode(minor_key_)); 119 return Register::from_code(IndexBits::decode(minor_key_));
125 } 120 }
126 121
127 LookupMode mode() const { return LookupModeBits::decode(minor_key_); } 122 LookupMode mode() const { return LookupModeBits::decode(minor_key_); }
128 123
129 class DictionaryBits: public BitField<int, 0, 4> {}; 124 class DictionaryBits: public BitField<int, 0, 4> {};
130 class ResultBits: public BitField<int, 4, 4> {}; 125 class ResultBits: public BitField<int, 4, 4> {};
131 class IndexBits: public BitField<int, 8, 4> {}; 126 class IndexBits: public BitField<int, 8, 4> {};
132 class LookupModeBits: public BitField<LookupMode, 12, 1> {}; 127 class LookupModeBits: public BitField<LookupMode, 12, 1> {};
133 128
134 DISALLOW_COPY_AND_ASSIGN(NameDictionaryLookupStub); 129 DEFINE_CODE_STUB(NameDictionaryLookup, PlatformCodeStub);
135 }; 130 };
136 131
137 132
138 class RecordWriteStub: public PlatformCodeStub { 133 class RecordWriteStub: public PlatformCodeStub {
139 public: 134 public:
140 RecordWriteStub(Isolate* isolate, Register object, Register value, 135 RecordWriteStub(Isolate* isolate, Register object, Register value,
141 Register address, RememberedSetAction remembered_set_action, 136 Register address, RememberedSetAction remembered_set_action,
142 SaveFPRegsMode fp_mode) 137 SaveFPRegsMode fp_mode)
143 : PlatformCodeStub(isolate), 138 : PlatformCodeStub(isolate),
144 regs_(object, // An input reg. 139 regs_(object, // An input reg.
145 address, // An input reg. 140 address, // An input reg.
146 value) { // One scratch reg. 141 value) { // One scratch reg.
147 minor_key_ = ObjectBits::encode(object.code()) | 142 minor_key_ = ObjectBits::encode(object.code()) |
148 ValueBits::encode(value.code()) | 143 ValueBits::encode(value.code()) |
149 AddressBits::encode(address.code()) | 144 AddressBits::encode(address.code()) |
150 RememberedSetActionBits::encode(remembered_set_action) | 145 RememberedSetActionBits::encode(remembered_set_action) |
151 SaveFPRegsModeBits::encode(fp_mode); 146 SaveFPRegsModeBits::encode(fp_mode);
152 } 147 }
153 148
149 RecordWriteStub(uint32_t key, Isolate* isolate)
150 : PlatformCodeStub(key, isolate), regs_(object(), address(), value()) {}
151
154 enum Mode { 152 enum Mode {
155 STORE_BUFFER_ONLY, 153 STORE_BUFFER_ONLY,
156 INCREMENTAL, 154 INCREMENTAL,
157 INCREMENTAL_COMPACTION 155 INCREMENTAL_COMPACTION
158 }; 156 };
159 157
160 virtual bool SometimesSetsUpAFrame() { return false; } 158 virtual bool SometimesSetsUpAFrame() { return false; }
161 159
162 static const byte kTwoByteNopInstruction = 0x3c; // Cmpb al, #imm8. 160 static const byte kTwoByteNopInstruction = 0x3c; // Cmpb al, #imm8.
163 static const byte kTwoByteJumpInstruction = 0xeb; // Jmp #imm8. 161 static const byte kTwoByteJumpInstruction = 0xeb; // Jmp #imm8.
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 return no_reg; 325 return no_reg;
328 } 326 }
329 friend class RecordWriteStub; 327 friend class RecordWriteStub;
330 }; 328 };
331 329
332 enum OnNoNeedToInformIncrementalMarker { 330 enum OnNoNeedToInformIncrementalMarker {
333 kReturnOnNoNeedToInformIncrementalMarker, 331 kReturnOnNoNeedToInformIncrementalMarker,
334 kUpdateRememberedSetOnNoNeedToInformIncrementalMarker 332 kUpdateRememberedSetOnNoNeedToInformIncrementalMarker
335 }; 333 };
336 334
337 virtual inline Major MajorKey() const FINAL OVERRIDE; 335 virtual Major MajorKey() const FINAL OVERRIDE { return RecordWrite; }
338 336
339 void Generate(MacroAssembler* masm); 337 void Generate(MacroAssembler* masm);
340 void GenerateIncremental(MacroAssembler* masm, Mode mode); 338 void GenerateIncremental(MacroAssembler* masm, Mode mode);
341 void CheckNeedsToInformIncrementalMarker( 339 void CheckNeedsToInformIncrementalMarker(
342 MacroAssembler* masm, 340 MacroAssembler* masm,
343 OnNoNeedToInformIncrementalMarker on_no_need, 341 OnNoNeedToInformIncrementalMarker on_no_need,
344 Mode mode); 342 Mode mode);
345 void InformIncrementalMarker(MacroAssembler* masm); 343 void InformIncrementalMarker(MacroAssembler* masm);
346 344
347 void Activate(Code* code) { 345 void Activate(Code* code) {
(...skipping 29 matching lines...) Expand all
377 Label slow_; 375 Label slow_;
378 RegisterAllocation regs_; 376 RegisterAllocation regs_;
379 377
380 DISALLOW_COPY_AND_ASSIGN(RecordWriteStub); 378 DISALLOW_COPY_AND_ASSIGN(RecordWriteStub);
381 }; 379 };
382 380
383 381
384 } } // namespace v8::internal 382 } } // namespace v8::internal
385 383
386 #endif // V8_X64_CODE_STUBS_X64_H_ 384 #endif // V8_X64_CODE_STUBS_X64_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | test/cctest/test-code-stubs.cc » ('j') | test/cctest/test-code-stubs.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698