OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 private: | 72 private: |
73 Token::Value op_; | 73 Token::Value op_; |
74 UnaryOverwriteMode mode_; | 74 UnaryOverwriteMode mode_; |
75 | 75 |
76 // Operand type information determined at runtime. | 76 // Operand type information determined at runtime. |
77 UnaryOpIC::TypeInfo operand_type_; | 77 UnaryOpIC::TypeInfo operand_type_; |
78 | 78 |
79 char* name_; | 79 char* name_; |
80 | 80 |
81 const char* GetName(); | 81 virtual const char* GetName(); |
82 | 82 |
83 #ifdef DEBUG | 83 #ifdef DEBUG |
84 void Print() { | 84 void Print() { |
85 PrintF("UnaryOpStub %d (op %s), (mode %d, runtime_type_info %s)\n", | 85 PrintF("UnaryOpStub %d (op %s), (mode %d, runtime_type_info %s)\n", |
86 MinorKey(), | 86 MinorKey(), |
87 Token::String(op_), | 87 Token::String(op_), |
88 static_cast<int>(mode_), | 88 static_cast<int>(mode_), |
89 UnaryOpIC::GetName(operand_type_)); | 89 UnaryOpIC::GetName(operand_type_)); |
90 } | 90 } |
91 #endif | 91 #endif |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 Token::Value op_; | 168 Token::Value op_; |
169 OverwriteMode mode_; | 169 OverwriteMode mode_; |
170 bool use_vfp3_; | 170 bool use_vfp3_; |
171 | 171 |
172 // Operand type information determined at runtime. | 172 // Operand type information determined at runtime. |
173 BinaryOpIC::TypeInfo operands_type_; | 173 BinaryOpIC::TypeInfo operands_type_; |
174 BinaryOpIC::TypeInfo result_type_; | 174 BinaryOpIC::TypeInfo result_type_; |
175 | 175 |
176 char* name_; | 176 char* name_; |
177 | 177 |
178 const char* GetName(); | 178 virtual const char* GetName(); |
179 | 179 |
180 #ifdef DEBUG | 180 #ifdef DEBUG |
181 void Print() { | 181 void Print() { |
182 PrintF("BinaryOpStub %d (op %s), " | 182 PrintF("BinaryOpStub %d (op %s), " |
183 "(mode %d, runtime_type_info %s)\n", | 183 "(mode %d, runtime_type_info %s)\n", |
184 MinorKey(), | 184 MinorKey(), |
185 Token::String(op_), | 185 Token::String(op_), |
186 static_cast<int>(mode_), | 186 static_cast<int>(mode_), |
187 BinaryOpIC::GetName(operands_type_)); | 187 BinaryOpIC::GetName(operands_type_)); |
188 } | 188 } |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 | 363 |
364 Major MajorKey() { return WriteInt32ToHeapNumber; } | 364 Major MajorKey() { return WriteInt32ToHeapNumber; } |
365 int MinorKey() { | 365 int MinorKey() { |
366 // Encode the parameters in a unique 16 bit value. | 366 // Encode the parameters in a unique 16 bit value. |
367 return IntRegisterBits::encode(the_int_.code()) | 367 return IntRegisterBits::encode(the_int_.code()) |
368 | HeapNumberRegisterBits::encode(the_heap_number_.code()) | 368 | HeapNumberRegisterBits::encode(the_heap_number_.code()) |
369 | ScratchRegisterBits::encode(scratch_.code()); | 369 | ScratchRegisterBits::encode(scratch_.code()); |
370 } | 370 } |
371 | 371 |
372 void Generate(MacroAssembler* masm); | 372 void Generate(MacroAssembler* masm); |
373 | |
374 const char* GetName() { return "WriteInt32ToHeapNumberStub"; } | |
375 | |
376 #ifdef DEBUG | |
377 void Print() { PrintF("WriteInt32ToHeapNumberStub\n"); } | |
378 #endif | |
379 }; | 373 }; |
380 | 374 |
381 | 375 |
382 class NumberToStringStub: public CodeStub { | 376 class NumberToStringStub: public CodeStub { |
383 public: | 377 public: |
384 NumberToStringStub() { } | 378 NumberToStringStub() { } |
385 | 379 |
386 // Generate code to do a lookup in the number string cache. If the number in | 380 // Generate code to do a lookup in the number string cache. If the number in |
387 // the register object is found in the cache the generated code falls through | 381 // the register object is found in the cache the generated code falls through |
388 // with the result in the result register. The object and the result register | 382 // with the result in the result register. The object and the result register |
389 // can be the same. If the number is not found in the cache the code jumps to | 383 // can be the same. If the number is not found in the cache the code jumps to |
390 // the label not_found with only the content of register object unchanged. | 384 // the label not_found with only the content of register object unchanged. |
391 static void GenerateLookupNumberStringCache(MacroAssembler* masm, | 385 static void GenerateLookupNumberStringCache(MacroAssembler* masm, |
392 Register object, | 386 Register object, |
393 Register result, | 387 Register result, |
394 Register scratch1, | 388 Register scratch1, |
395 Register scratch2, | 389 Register scratch2, |
396 Register scratch3, | 390 Register scratch3, |
397 bool object_is_smi, | 391 bool object_is_smi, |
398 Label* not_found); | 392 Label* not_found); |
399 | 393 |
400 private: | 394 private: |
401 Major MajorKey() { return NumberToString; } | 395 Major MajorKey() { return NumberToString; } |
402 int MinorKey() { return 0; } | 396 int MinorKey() { return 0; } |
403 | 397 |
404 void Generate(MacroAssembler* masm); | 398 void Generate(MacroAssembler* masm); |
405 | |
406 const char* GetName() { return "NumberToStringStub"; } | |
407 }; | 399 }; |
408 | 400 |
409 | 401 |
410 // Enter C code from generated RegExp code in a way that allows | 402 // Enter C code from generated RegExp code in a way that allows |
411 // the C code to fix the return address in case of a GC. | 403 // the C code to fix the return address in case of a GC. |
412 // Currently only needed on ARM. | 404 // Currently only needed on ARM. |
413 class RegExpCEntryStub: public CodeStub { | 405 class RegExpCEntryStub: public CodeStub { |
414 public: | 406 public: |
415 RegExpCEntryStub() {} | 407 RegExpCEntryStub() {} |
416 virtual ~RegExpCEntryStub() {} | 408 virtual ~RegExpCEntryStub() {} |
417 void Generate(MacroAssembler* masm); | 409 void Generate(MacroAssembler* masm); |
418 | 410 |
419 private: | 411 private: |
420 Major MajorKey() { return RegExpCEntry; } | 412 Major MajorKey() { return RegExpCEntry; } |
421 int MinorKey() { return 0; } | 413 int MinorKey() { return 0; } |
422 | 414 |
423 bool NeedsImmovableCode() { return true; } | 415 bool NeedsImmovableCode() { return true; } |
424 | |
425 const char* GetName() { return "RegExpCEntryStub"; } | |
426 }; | 416 }; |
427 | 417 |
428 | 418 |
429 // Trampoline stub to call into native code. To call safely into native code | 419 // Trampoline stub to call into native code. To call safely into native code |
430 // in the presence of compacting GC (which can move code objects) we need to | 420 // in the presence of compacting GC (which can move code objects) we need to |
431 // keep the code which called into native pinned in the memory. Currently the | 421 // keep the code which called into native pinned in the memory. Currently the |
432 // simplest approach is to generate such stub early enough so it can never be | 422 // simplest approach is to generate such stub early enough so it can never be |
433 // moved by GC | 423 // moved by GC |
434 class DirectCEntryStub: public CodeStub { | 424 class DirectCEntryStub: public CodeStub { |
435 public: | 425 public: |
436 DirectCEntryStub() {} | 426 DirectCEntryStub() {} |
437 void Generate(MacroAssembler* masm); | 427 void Generate(MacroAssembler* masm); |
438 void GenerateCall(MacroAssembler* masm, ExternalReference function); | 428 void GenerateCall(MacroAssembler* masm, ExternalReference function); |
439 void GenerateCall(MacroAssembler* masm, Register target); | 429 void GenerateCall(MacroAssembler* masm, Register target); |
440 | 430 |
441 private: | 431 private: |
442 Major MajorKey() { return DirectCEntry; } | 432 Major MajorKey() { return DirectCEntry; } |
443 int MinorKey() { return 0; } | 433 int MinorKey() { return 0; } |
444 | 434 |
445 bool NeedsImmovableCode() { return true; } | 435 bool NeedsImmovableCode() { return true; } |
446 | |
447 const char* GetName() { return "DirectCEntryStub"; } | |
448 }; | 436 }; |
449 | 437 |
450 | 438 |
451 class FloatingPointHelper : public AllStatic { | 439 class FloatingPointHelper : public AllStatic { |
452 public: | 440 public: |
453 enum Destination { | 441 enum Destination { |
454 kVFPRegisters, | 442 kVFPRegisters, |
455 kCoreRegisters | 443 kCoreRegisters |
456 }; | 444 }; |
457 | 445 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 static const int kTotalProbes = 20; | 608 static const int kTotalProbes = 20; |
621 | 609 |
622 static const int kCapacityOffset = | 610 static const int kCapacityOffset = |
623 StringDictionary::kHeaderSize + | 611 StringDictionary::kHeaderSize + |
624 StringDictionary::kCapacityIndex * kPointerSize; | 612 StringDictionary::kCapacityIndex * kPointerSize; |
625 | 613 |
626 static const int kElementsStartOffset = | 614 static const int kElementsStartOffset = |
627 StringDictionary::kHeaderSize + | 615 StringDictionary::kHeaderSize + |
628 StringDictionary::kElementsStartIndex * kPointerSize; | 616 StringDictionary::kElementsStartIndex * kPointerSize; |
629 | 617 |
630 | |
631 #ifdef DEBUG | |
632 void Print() { | |
633 PrintF("StringDictionaryLookupStub\n"); | |
634 } | |
635 #endif | |
636 | |
637 Major MajorKey() { return StringDictionaryNegativeLookup; } | 618 Major MajorKey() { return StringDictionaryNegativeLookup; } |
638 | 619 |
639 int MinorKey() { | 620 int MinorKey() { |
640 return LookupModeBits::encode(mode_); | 621 return LookupModeBits::encode(mode_); |
641 } | 622 } |
642 | 623 |
643 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; | 624 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; |
644 | 625 |
645 LookupMode mode_; | 626 LookupMode mode_; |
646 }; | 627 }; |
647 | 628 |
648 | 629 |
649 } } // namespace v8::internal | 630 } } // namespace v8::internal |
650 | 631 |
651 #endif // V8_ARM_CODE_STUBS_ARM_H_ | 632 #endif // V8_ARM_CODE_STUBS_ARM_H_ |
OLD | NEW |