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

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

Issue 7348008: Merge up to 8597 to experimental/gc from the bleeding edge. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: '' Created 9 years, 5 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 | « src/x64/builtins-x64.cc ('k') | src/x64/code-stubs-x64.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 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 TranscendentalCache::Type type_; 52 TranscendentalCache::Type type_;
53 ArgumentType argument_type_; 53 ArgumentType argument_type_;
54 54
55 Major MajorKey() { return TranscendentalCache; } 55 Major MajorKey() { return TranscendentalCache; }
56 int MinorKey() { return type_ | argument_type_; } 56 int MinorKey() { return type_ | argument_type_; }
57 Runtime::FunctionId RuntimeFunction(); 57 Runtime::FunctionId RuntimeFunction();
58 void GenerateOperation(MacroAssembler* masm); 58 void GenerateOperation(MacroAssembler* masm);
59 }; 59 };
60 60
61 61
62 class ToBooleanStub: public CodeStub {
63 public:
64 ToBooleanStub() { }
65
66 void Generate(MacroAssembler* masm);
67
68 private:
69 Major MajorKey() { return ToBoolean; }
70 int MinorKey() { return 0; }
71 };
72
73
74 class StoreBufferOverflowStub: public CodeStub { 62 class StoreBufferOverflowStub: public CodeStub {
75 public: 63 public:
76 explicit StoreBufferOverflowStub(SaveFPRegsMode save_fp) 64 explicit StoreBufferOverflowStub(SaveFPRegsMode save_fp)
77 : save_doubles_(save_fp) { } 65 : save_doubles_(save_fp) { }
78 66
79 void Generate(MacroAssembler* masm); 67 void Generate(MacroAssembler* masm);
80 68
81 private: 69 private:
82 SaveFPRegsMode save_doubles_; 70 SaveFPRegsMode save_doubles_;
83 71
84 Major MajorKey() { return StoreBufferOverflow; } 72 Major MajorKey() { return StoreBufferOverflow; }
85 int MinorKey() { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } 73 int MinorKey() { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; }
86 }; 74 };
87 75
88 76
89 // Flag that indicates how to generate code for the stub GenericBinaryOpStub. 77 // Flag that indicates how to generate code for the stub GenericBinaryOpStub.
90 enum GenericBinaryFlags { 78 enum GenericBinaryFlags {
91 NO_GENERIC_BINARY_FLAGS = 0, 79 NO_GENERIC_BINARY_FLAGS = 0,
92 NO_SMI_CODE_IN_STUB = 1 << 0 // Omit smi code in stub. 80 NO_SMI_CODE_IN_STUB = 1 << 0 // Omit smi code in stub.
93 }; 81 };
94 82
95 83
96 class UnaryOpStub: public CodeStub { 84 class UnaryOpStub: public CodeStub {
97 public: 85 public:
98 UnaryOpStub(Token::Value op, UnaryOverwriteMode mode) 86 UnaryOpStub(Token::Value op,
87 UnaryOverwriteMode mode,
88 UnaryOpIC::TypeInfo operand_type = UnaryOpIC::UNINITIALIZED)
99 : op_(op), 89 : op_(op),
100 mode_(mode), 90 mode_(mode),
101 operand_type_(UnaryOpIC::UNINITIALIZED),
102 name_(NULL) {
103 }
104
105 UnaryOpStub(
106 int key,
107 UnaryOpIC::TypeInfo operand_type)
108 : op_(OpBits::decode(key)),
109 mode_(ModeBits::decode(key)),
110 operand_type_(operand_type), 91 operand_type_(operand_type),
111 name_(NULL) { 92 name_(NULL) {
112 } 93 }
113 94
114 private: 95 private:
115 Token::Value op_; 96 Token::Value op_;
116 UnaryOverwriteMode mode_; 97 UnaryOverwriteMode mode_;
117 98
118 // Operand type information determined at runtime. 99 // Operand type information determined at runtime.
119 UnaryOpIC::TypeInfo operand_type_; 100 UnaryOpIC::TypeInfo operand_type_;
120 101
121 char* name_; 102 char* name_;
122 103
123 const char* GetName(); 104 virtual const char* GetName();
124 105
125 #ifdef DEBUG 106 #ifdef DEBUG
126 void Print() { 107 void Print() {
127 PrintF("UnaryOpStub %d (op %s), " 108 PrintF("UnaryOpStub %d (op %s), (mode %d, runtime_type_info %s)\n",
128 "(mode %d, runtime_type_info %s)\n",
129 MinorKey(), 109 MinorKey(),
130 Token::String(op_), 110 Token::String(op_),
131 static_cast<int>(mode_), 111 static_cast<int>(mode_),
132 UnaryOpIC::GetName(operand_type_)); 112 UnaryOpIC::GetName(operand_type_));
133 } 113 }
134 #endif 114 #endif
135 115
136 class ModeBits: public BitField<UnaryOverwriteMode, 0, 1> {}; 116 class ModeBits: public BitField<UnaryOverwriteMode, 0, 1> {};
137 class OpBits: public BitField<Token::Value, 1, 7> {}; 117 class OpBits: public BitField<Token::Value, 1, 7> {};
138 class OperandTypeInfoBits: public BitField<UnaryOpIC::TypeInfo, 8, 3> {}; 118 class OperandTypeInfoBits: public BitField<UnaryOpIC::TypeInfo, 8, 3> {};
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 194
215 Token::Value op_; 195 Token::Value op_;
216 OverwriteMode mode_; 196 OverwriteMode mode_;
217 197
218 // Operand type information determined at runtime. 198 // Operand type information determined at runtime.
219 BinaryOpIC::TypeInfo operands_type_; 199 BinaryOpIC::TypeInfo operands_type_;
220 BinaryOpIC::TypeInfo result_type_; 200 BinaryOpIC::TypeInfo result_type_;
221 201
222 char* name_; 202 char* name_;
223 203
224 const char* GetName(); 204 virtual const char* GetName();
225 205
226 #ifdef DEBUG 206 #ifdef DEBUG
227 void Print() { 207 void Print() {
228 PrintF("BinaryOpStub %d (op %s), " 208 PrintF("BinaryOpStub %d (op %s), "
229 "(mode %d, runtime_type_info %s)\n", 209 "(mode %d, runtime_type_info %s)\n",
230 MinorKey(), 210 MinorKey(),
231 Token::String(op_), 211 Token::String(op_),
232 static_cast<int>(mode_), 212 static_cast<int>(mode_),
233 BinaryOpIC::GetName(operands_type_)); 213 BinaryOpIC::GetName(operands_type_));
234 } 214 }
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 425
446 private: 426 private:
447 static void GenerateConvertHashCodeToIndex(MacroAssembler* masm, 427 static void GenerateConvertHashCodeToIndex(MacroAssembler* masm,
448 Register hash, 428 Register hash,
449 Register mask); 429 Register mask);
450 430
451 Major MajorKey() { return NumberToString; } 431 Major MajorKey() { return NumberToString; }
452 int MinorKey() { return 0; } 432 int MinorKey() { return 0; }
453 433
454 void Generate(MacroAssembler* masm); 434 void Generate(MacroAssembler* masm);
455
456 const char* GetName() { return "NumberToStringStub"; }
457
458 #ifdef DEBUG
459 void Print() {
460 PrintF("NumberToStringStub\n");
461 }
462 #endif
463 }; 435 };
464 436
465 437
466 class StringDictionaryLookupStub: public CodeStub { 438 class StringDictionaryLookupStub: public CodeStub {
467 public: 439 public:
468 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; 440 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP };
469 441
470 StringDictionaryLookupStub(Register dictionary, 442 StringDictionaryLookupStub(Register dictionary,
471 Register result, 443 Register result,
472 Register index, 444 Register index,
(...skipping 23 matching lines...) Expand all
496 static const int kTotalProbes = 20; 468 static const int kTotalProbes = 20;
497 469
498 static const int kCapacityOffset = 470 static const int kCapacityOffset =
499 StringDictionary::kHeaderSize + 471 StringDictionary::kHeaderSize +
500 StringDictionary::kCapacityIndex * kPointerSize; 472 StringDictionary::kCapacityIndex * kPointerSize;
501 473
502 static const int kElementsStartOffset = 474 static const int kElementsStartOffset =
503 StringDictionary::kHeaderSize + 475 StringDictionary::kHeaderSize +
504 StringDictionary::kElementsStartIndex * kPointerSize; 476 StringDictionary::kElementsStartIndex * kPointerSize;
505 477
506
507 #ifdef DEBUG
508 void Print() {
509 PrintF("StringDictionaryLookupStub\n");
510 }
511 #endif
512
513 Major MajorKey() { return StringDictionaryNegativeLookup; } 478 Major MajorKey() { return StringDictionaryNegativeLookup; }
514 479
515 int MinorKey() { 480 int MinorKey() {
516 return DictionaryBits::encode(dictionary_.code()) | 481 return DictionaryBits::encode(dictionary_.code()) |
517 ResultBits::encode(result_.code()) | 482 ResultBits::encode(result_.code()) |
518 IndexBits::encode(index_.code()) | 483 IndexBits::encode(index_.code()) |
519 LookupModeBits::encode(mode_); 484 LookupModeBits::encode(mode_);
520 } 485 }
521 486
522 class DictionaryBits: public BitField<int, 0, 4> {}; 487 class DictionaryBits: public BitField<int, 0, 4> {};
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 RememberedSetAction remembered_set_action_; 735 RememberedSetAction remembered_set_action_;
771 SaveFPRegsMode save_fp_regs_mode_; 736 SaveFPRegsMode save_fp_regs_mode_;
772 Label slow_; 737 Label slow_;
773 RegisterAllocation regs_; 738 RegisterAllocation regs_;
774 }; 739 };
775 740
776 741
777 } } // namespace v8::internal 742 } } // namespace v8::internal
778 743
779 #endif // V8_X64_CODE_STUBS_X64_H_ 744 #endif // V8_X64_CODE_STUBS_X64_H_
OLDNEW
« no previous file with comments | « src/x64/builtins-x64.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698