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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 virtual bool SometimesSetsUpAFrame() { return false; } | 74 virtual bool SometimesSetsUpAFrame() { return false; } |
75 | 75 |
76 private: | 76 private: |
77 SaveFPRegsMode save_doubles_; | 77 SaveFPRegsMode save_doubles_; |
78 | 78 |
79 Major MajorKey() { return StoreBufferOverflow; } | 79 Major MajorKey() { return StoreBufferOverflow; } |
80 int MinorKey() { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } | 80 int MinorKey() { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } |
81 }; | 81 }; |
82 | 82 |
83 | 83 |
84 class UnaryOpStub: public PlatformCodeStub { | |
85 public: | |
86 UnaryOpStub(Token::Value op, | |
87 UnaryOverwriteMode mode, | |
88 UnaryOpIC::TypeInfo operand_type = UnaryOpIC::UNINITIALIZED) | |
89 : op_(op), | |
90 mode_(mode), | |
91 operand_type_(operand_type) { | |
92 } | |
93 | |
94 private: | |
95 Token::Value op_; | |
96 UnaryOverwriteMode mode_; | |
97 | |
98 // Operand type information determined at runtime. | |
99 UnaryOpIC::TypeInfo operand_type_; | |
100 | |
101 virtual void PrintName(StringStream* stream); | |
102 | |
103 class ModeBits: public BitField<UnaryOverwriteMode, 0, 1> {}; | |
104 class OpBits: public BitField<Token::Value, 1, 7> {}; | |
105 class OperandTypeInfoBits: public BitField<UnaryOpIC::TypeInfo, 8, 3> {}; | |
106 | |
107 Major MajorKey() { return UnaryOp; } | |
108 int MinorKey() { | |
109 return ModeBits::encode(mode_) | |
110 | OpBits::encode(op_) | |
111 | OperandTypeInfoBits::encode(operand_type_); | |
112 } | |
113 | |
114 // Note: A lot of the helper functions below will vanish when we use virtual | |
115 // function instead of switch more often. | |
116 void Generate(MacroAssembler* masm); | |
117 | |
118 void GenerateTypeTransition(MacroAssembler* masm); | |
119 | |
120 void GenerateSmiStub(MacroAssembler* masm); | |
121 void GenerateSmiStubSub(MacroAssembler* masm); | |
122 void GenerateSmiStubBitNot(MacroAssembler* masm); | |
123 void GenerateSmiCodeSub(MacroAssembler* masm, Label* non_smi, Label* slow); | |
124 void GenerateSmiCodeBitNot(MacroAssembler* masm, Label* slow); | |
125 | |
126 void GenerateNumberStub(MacroAssembler* masm); | |
127 void GenerateNumberStubSub(MacroAssembler* masm); | |
128 void GenerateNumberStubBitNot(MacroAssembler* masm); | |
129 void GenerateHeapNumberCodeSub(MacroAssembler* masm, Label* slow); | |
130 void GenerateHeapNumberCodeBitNot(MacroAssembler* masm, Label* slow); | |
131 | |
132 void GenerateGenericStub(MacroAssembler* masm); | |
133 void GenerateGenericStubSub(MacroAssembler* masm); | |
134 void GenerateGenericStubBitNot(MacroAssembler* masm); | |
135 void GenerateGenericCodeFallback(MacroAssembler* masm); | |
136 | |
137 virtual Code::Kind GetCodeKind() const { return Code::UNARY_OP_IC; } | |
138 | |
139 virtual InlineCacheState GetICState() { | |
140 return UnaryOpIC::ToState(operand_type_); | |
141 } | |
142 | |
143 virtual void FinishCode(Handle<Code> code) { | |
144 code->set_unary_op_type(operand_type_); | |
145 } | |
146 }; | |
147 | |
148 | |
149 class StringHelper : public AllStatic { | 84 class StringHelper : public AllStatic { |
150 public: | 85 public: |
151 // Generate code for copying characters using a simple loop. This should only | 86 // Generate code for copying characters using a simple loop. This should only |
152 // be used in places where the number of characters is small and the | 87 // be used in places where the number of characters is small and the |
153 // additional setup and checking in GenerateCopyCharactersLong adds too much | 88 // additional setup and checking in GenerateCopyCharactersLong adds too much |
154 // overhead. Copying of overlapping regions is not supported. | 89 // overhead. Copying of overlapping regions is not supported. |
155 // Dest register ends at the position after the last character written. | 90 // Dest register ends at the position after the last character written. |
156 static void GenerateCopyCharacters(MacroAssembler* masm, | 91 static void GenerateCopyCharacters(MacroAssembler* masm, |
157 Register dest, | 92 Register dest, |
158 Register src, | 93 Register src, |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 | 703 |
769 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; | 704 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; |
770 | 705 |
771 LookupMode mode_; | 706 LookupMode mode_; |
772 }; | 707 }; |
773 | 708 |
774 | 709 |
775 } } // namespace v8::internal | 710 } } // namespace v8::internal |
776 | 711 |
777 #endif // V8_MIPS_CODE_STUBS_ARM_H_ | 712 #endif // V8_MIPS_CODE_STUBS_ARM_H_ |
OLD | NEW |