OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 virtual bool SometimesSetsUpAFrame() { return false; } | 73 virtual bool SometimesSetsUpAFrame() { return false; } |
74 | 74 |
75 private: | 75 private: |
76 SaveFPRegsMode save_doubles_; | 76 SaveFPRegsMode save_doubles_; |
77 | 77 |
78 Major MajorKey() { return StoreBufferOverflow; } | 78 Major MajorKey() { return StoreBufferOverflow; } |
79 int MinorKey() { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } | 79 int MinorKey() { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } |
80 }; | 80 }; |
81 | 81 |
82 | 82 |
83 class UnaryOpStub: public PlatformCodeStub { | |
84 public: | |
85 UnaryOpStub(Token::Value op, | |
86 UnaryOverwriteMode mode, | |
87 UnaryOpIC::TypeInfo operand_type = UnaryOpIC::UNINITIALIZED) | |
88 : op_(op), | |
89 mode_(mode), | |
90 operand_type_(operand_type) { | |
91 } | |
92 | |
93 private: | |
94 Token::Value op_; | |
95 UnaryOverwriteMode mode_; | |
96 | |
97 // Operand type information determined at runtime. | |
98 UnaryOpIC::TypeInfo operand_type_; | |
99 | |
100 virtual void PrintName(StringStream* stream); | |
101 | |
102 class ModeBits: public BitField<UnaryOverwriteMode, 0, 1> {}; | |
103 class OpBits: public BitField<Token::Value, 1, 7> {}; | |
104 class OperandTypeInfoBits: public BitField<UnaryOpIC::TypeInfo, 8, 3> {}; | |
105 | |
106 Major MajorKey() { return UnaryOp; } | |
107 int MinorKey() { | |
108 return ModeBits::encode(mode_) | |
109 | OpBits::encode(op_) | |
110 | OperandTypeInfoBits::encode(operand_type_); | |
111 } | |
112 | |
113 void Generate(MacroAssembler* masm); | |
114 | |
115 void GenerateTypeTransition(MacroAssembler* masm); | |
116 | |
117 void GenerateSmiStub(MacroAssembler* masm); | |
118 void GenerateSmiStubSub(MacroAssembler* masm); | |
119 void GenerateSmiStubBitNot(MacroAssembler* masm); | |
120 void GenerateSmiCodeSub(MacroAssembler* masm, Label* non_smi, Label* slow); | |
121 void GenerateSmiCodeBitNot(MacroAssembler* masm, Label* slow); | |
122 | |
123 void GenerateNumberStub(MacroAssembler* masm); | |
124 void GenerateNumberStubSub(MacroAssembler* masm); | |
125 void GenerateNumberStubBitNot(MacroAssembler* masm); | |
126 void GenerateHeapNumberCodeSub(MacroAssembler* masm, Label* slow); | |
127 void GenerateHeapNumberCodeBitNot(MacroAssembler* masm, Label* slow); | |
128 | |
129 void GenerateGenericStub(MacroAssembler* masm); | |
130 | |
131 virtual Code::Kind GetCodeKind() const { return Code::UNARY_OP_IC; } | |
132 | |
133 virtual InlineCacheState GetICState() { | |
134 return UnaryOpIC::ToState(operand_type_); | |
135 } | |
136 | |
137 virtual void FinishCode(Handle<Code> code) { | |
138 code->set_unary_op_type(operand_type_); | |
139 } | |
140 }; | |
141 | |
142 | |
143 class StringHelper : public AllStatic { | 83 class StringHelper : public AllStatic { |
144 public: | 84 public: |
145 // Probe the string table for a two character string. If the string is | 85 // Probe the string table for a two character string. If the string is |
146 // not found by probing a jump to the label not_found is performed. This jump | 86 // not found by probing a jump to the label not_found is performed. This jump |
147 // does not guarantee that the string is not in the string table. If the | 87 // does not guarantee that the string is not in the string table. If the |
148 // string is found the code falls through with the string in register x0. | 88 // string is found the code falls through with the string in register x0. |
149 // Contents of both c1 and c2 registers are modified. At the exit c1 is | 89 // Contents of both c1 and c2 registers are modified. At the exit c1 is |
150 // guaranteed to contain halfword with low and high bytes equal to | 90 // guaranteed to contain halfword with low and high bytes equal to |
151 // initial contents of c1 and c2 respectively. | 91 // initial contents of c1 and c2 respectively. |
152 static void GenerateTwoCharacterStringTableProbe(MacroAssembler* masm, | 92 static void GenerateTwoCharacterStringTableProbe(MacroAssembler* masm, |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 Register length, | 573 Register length, |
634 Register scratch1, | 574 Register scratch1, |
635 Register scratch2, | 575 Register scratch2, |
636 Label* chars_not_equal); | 576 Label* chars_not_equal); |
637 }; | 577 }; |
638 | 578 |
639 | 579 |
640 } } // namespace v8::internal | 580 } } // namespace v8::internal |
641 | 581 |
642 #endif // V8_A64_CODE_STUBS_A64_H_ | 582 #endif // V8_A64_CODE_STUBS_A64_H_ |
OLD | NEW |