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

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

Issue 545163002: Unify JSEntryStub and JSConstructEntryStub, and some more code stub cleanups. (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') | no next file with comments »
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 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 10
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 Register the_heap_number, Register scratch) 64 Register the_heap_number, Register scratch)
65 : PlatformCodeStub(isolate) { 65 : PlatformCodeStub(isolate) {
66 minor_key_ = IntRegisterBits::encode(the_int.code()) | 66 minor_key_ = IntRegisterBits::encode(the_int.code()) |
67 HeapNumberRegisterBits::encode(the_heap_number.code()) | 67 HeapNumberRegisterBits::encode(the_heap_number.code()) |
68 ScratchRegisterBits::encode(scratch.code()); 68 ScratchRegisterBits::encode(scratch.code());
69 } 69 }
70 70
71 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); 71 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate);
72 72
73 private: 73 private:
74 void Generate(MacroAssembler* masm);
75
76 Register the_int() const { 74 Register the_int() const {
77 return Register::from_code(IntRegisterBits::decode(minor_key_)); 75 return Register::from_code(IntRegisterBits::decode(minor_key_));
78 } 76 }
79 77
80 Register the_heap_number() const { 78 Register the_heap_number() const {
81 return Register::from_code(HeapNumberRegisterBits::decode(minor_key_)); 79 return Register::from_code(HeapNumberRegisterBits::decode(minor_key_));
82 } 80 }
83 81
84 Register scratch() const { 82 Register scratch() const {
85 return Register::from_code(ScratchRegisterBits::decode(minor_key_)); 83 return Register::from_code(ScratchRegisterBits::decode(minor_key_));
86 } 84 }
87 85
88 // Minor key encoding in 16 bits. 86 // Minor key encoding in 16 bits.
89 class IntRegisterBits: public BitField<int, 0, 4> {}; 87 class IntRegisterBits: public BitField<int, 0, 4> {};
90 class HeapNumberRegisterBits: public BitField<int, 4, 4> {}; 88 class HeapNumberRegisterBits: public BitField<int, 4, 4> {};
91 class ScratchRegisterBits: public BitField<int, 8, 4> {}; 89 class ScratchRegisterBits: public BitField<int, 8, 4> {};
92 90
93 DEFINE_CODE_STUB(WriteInt32ToHeapNumber, PlatformCodeStub); 91 DEFINE_PLATFORM_CODE_STUB(WriteInt32ToHeapNumber, PlatformCodeStub);
94 }; 92 };
95 93
96 94
97 class RecordWriteStub: public PlatformCodeStub { 95 class RecordWriteStub: public PlatformCodeStub {
98 public: 96 public:
99 RecordWriteStub(Isolate* isolate, 97 RecordWriteStub(Isolate* isolate,
100 Register object, 98 Register object,
101 Register value, 99 Register value,
102 Register address, 100 Register address,
103 RememberedSetAction remembered_set_action, 101 RememberedSetAction remembered_set_action,
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 friend class RecordWriteStub; 236 friend class RecordWriteStub;
239 }; 237 };
240 238
241 enum OnNoNeedToInformIncrementalMarker { 239 enum OnNoNeedToInformIncrementalMarker {
242 kReturnOnNoNeedToInformIncrementalMarker, 240 kReturnOnNoNeedToInformIncrementalMarker,
243 kUpdateRememberedSetOnNoNeedToInformIncrementalMarker 241 kUpdateRememberedSetOnNoNeedToInformIncrementalMarker
244 }; 242 };
245 243
246 virtual inline Major MajorKey() const FINAL OVERRIDE { return RecordWrite; } 244 virtual inline Major MajorKey() const FINAL OVERRIDE { return RecordWrite; }
247 245
248 void Generate(MacroAssembler* masm); 246 virtual void Generate(MacroAssembler* masm) OVERRIDE;
249 void GenerateIncremental(MacroAssembler* masm, Mode mode); 247 void GenerateIncremental(MacroAssembler* masm, Mode mode);
250 void CheckNeedsToInformIncrementalMarker( 248 void CheckNeedsToInformIncrementalMarker(
251 MacroAssembler* masm, 249 MacroAssembler* masm,
252 OnNoNeedToInformIncrementalMarker on_no_need, 250 OnNoNeedToInformIncrementalMarker on_no_need,
253 Mode mode); 251 Mode mode);
254 void InformIncrementalMarker(MacroAssembler* masm); 252 void InformIncrementalMarker(MacroAssembler* masm);
255 253
256 void Activate(Code* code) { 254 void Activate(Code* code) {
257 code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code); 255 code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code);
258 } 256 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 289
292 290
293 // Trampoline stub to call into native code. To call safely into native code 291 // Trampoline stub to call into native code. To call safely into native code
294 // in the presence of compacting GC (which can move code objects) we need to 292 // in the presence of compacting GC (which can move code objects) we need to
295 // keep the code which called into native pinned in the memory. Currently the 293 // keep the code which called into native pinned in the memory. Currently the
296 // simplest approach is to generate such stub early enough so it can never be 294 // simplest approach is to generate such stub early enough so it can never be
297 // moved by GC 295 // moved by GC
298 class DirectCEntryStub: public PlatformCodeStub { 296 class DirectCEntryStub: public PlatformCodeStub {
299 public: 297 public:
300 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {} 298 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {}
301 void Generate(MacroAssembler* masm);
302 void GenerateCall(MacroAssembler* masm, Register target); 299 void GenerateCall(MacroAssembler* masm, Register target);
303 300
304 private: 301 private:
305 bool NeedsImmovableCode() { return true; } 302 bool NeedsImmovableCode() { return true; }
306 303
307 DEFINE_CODE_STUB(DirectCEntry, PlatformCodeStub); 304 DEFINE_PLATFORM_CODE_STUB(DirectCEntry, PlatformCodeStub);
308 }; 305 };
309 306
310 307
311 class NameDictionaryLookupStub: public PlatformCodeStub { 308 class NameDictionaryLookupStub: public PlatformCodeStub {
312 public: 309 public:
313 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; 310 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP };
314 311
315 NameDictionaryLookupStub(Isolate* isolate, LookupMode mode) 312 NameDictionaryLookupStub(Isolate* isolate, LookupMode mode)
316 : PlatformCodeStub(isolate) { 313 : PlatformCodeStub(isolate) {
317 minor_key_ = LookupModeBits::encode(mode); 314 minor_key_ = LookupModeBits::encode(mode);
318 } 315 }
319 316
320 void Generate(MacroAssembler* masm);
321
322 static void GenerateNegativeLookup(MacroAssembler* masm, 317 static void GenerateNegativeLookup(MacroAssembler* masm,
323 Label* miss, 318 Label* miss,
324 Label* done, 319 Label* done,
325 Register receiver, 320 Register receiver,
326 Register properties, 321 Register properties,
327 Handle<Name> name, 322 Handle<Name> name,
328 Register scratch0); 323 Register scratch0);
329 324
330 static void GeneratePositiveLookup(MacroAssembler* masm, 325 static void GeneratePositiveLookup(MacroAssembler* masm,
331 Label* miss, 326 Label* miss,
(...skipping 14 matching lines...) Expand all
346 NameDictionary::kCapacityIndex * kPointerSize; 341 NameDictionary::kCapacityIndex * kPointerSize;
347 342
348 static const int kElementsStartOffset = 343 static const int kElementsStartOffset =
349 NameDictionary::kHeaderSize + 344 NameDictionary::kHeaderSize +
350 NameDictionary::kElementsStartIndex * kPointerSize; 345 NameDictionary::kElementsStartIndex * kPointerSize;
351 346
352 LookupMode mode() const { return LookupModeBits::decode(minor_key_); } 347 LookupMode mode() const { return LookupModeBits::decode(minor_key_); }
353 348
354 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; 349 class LookupModeBits: public BitField<LookupMode, 0, 1> {};
355 350
356 DEFINE_CODE_STUB(NameDictionaryLookup, PlatformCodeStub); 351 DEFINE_PLATFORM_CODE_STUB(NameDictionaryLookup, PlatformCodeStub);
357 }; 352 };
358 353
359 } } // namespace v8::internal 354 } } // namespace v8::internal
360 355
361 #endif // V8_ARM_CODE_STUBS_ARM_H_ 356 #endif // V8_ARM_CODE_STUBS_ARM_H_
OLDNEW
« no previous file with comments | « no previous file | src/arm/code-stubs-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698