OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 V(SubI) \ | 160 V(SubI) \ |
161 V(TaggedToI) \ | 161 V(TaggedToI) \ |
162 V(ThisFunction) \ | 162 V(ThisFunction) \ |
163 V(Throw) \ | 163 V(Throw) \ |
164 V(ToFastProperties) \ | 164 V(ToFastProperties) \ |
165 V(TransitionElementsKind) \ | 165 V(TransitionElementsKind) \ |
166 V(Typeof) \ | 166 V(Typeof) \ |
167 V(TypeofIsAndBranch) \ | 167 V(TypeofIsAndBranch) \ |
168 V(UnaryMathOperation) \ | 168 V(UnaryMathOperation) \ |
169 V(UnknownOSRValue) \ | 169 V(UnknownOSRValue) \ |
170 V(ValueOf) | 170 V(ValueOf) \ |
| 171 V(ForInPrepareMap) \ |
| 172 V(ForInCacheArray) \ |
| 173 V(CheckMapValue) \ |
| 174 V(LoadFieldByIndex) |
171 | 175 |
172 | 176 |
173 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ | 177 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ |
174 virtual Opcode opcode() const { return LInstruction::k##type; } \ | 178 virtual Opcode opcode() const { return LInstruction::k##type; } \ |
175 virtual void CompileToNative(LCodeGen* generator); \ | 179 virtual void CompileToNative(LCodeGen* generator); \ |
176 virtual const char* Mnemonic() const { return mnemonic; } \ | 180 virtual const char* Mnemonic() const { return mnemonic; } \ |
177 static L##type* cast(LInstruction* instr) { \ | 181 static L##type* cast(LInstruction* instr) { \ |
178 ASSERT(instr->Is##type()); \ | 182 ASSERT(instr->Is##type()); \ |
179 return reinterpret_cast<L##type*>(instr); \ | 183 return reinterpret_cast<L##type*>(instr); \ |
180 } | 184 } |
(...skipping 1980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2161 } | 2165 } |
2162 | 2166 |
2163 LOperand* context() { return inputs_[0]; } | 2167 LOperand* context() { return inputs_[0]; } |
2164 LOperand* key() { return inputs_[1]; } | 2168 LOperand* key() { return inputs_[1]; } |
2165 LOperand* object() { return inputs_[2]; } | 2169 LOperand* object() { return inputs_[2]; } |
2166 | 2170 |
2167 DECLARE_CONCRETE_INSTRUCTION(In, "in") | 2171 DECLARE_CONCRETE_INSTRUCTION(In, "in") |
2168 }; | 2172 }; |
2169 | 2173 |
2170 | 2174 |
| 2175 class LForInPrepareMap: public LTemplateInstruction<1, 2, 0> { |
| 2176 public: |
| 2177 LForInPrepareMap(LOperand* context, LOperand* object) { |
| 2178 inputs_[0] = context; |
| 2179 inputs_[1] = object; |
| 2180 } |
| 2181 |
| 2182 LOperand* context() { return inputs_[0]; } |
| 2183 LOperand* object() { return inputs_[1]; } |
| 2184 |
| 2185 DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap, "for-in-prepare-map") |
| 2186 }; |
| 2187 |
| 2188 |
| 2189 class LForInCacheArray: public LTemplateInstruction<1, 2, 0> { |
| 2190 public: |
| 2191 LForInCacheArray(LOperand* object, |
| 2192 LOperand* keys) { |
| 2193 inputs_[0] = object; |
| 2194 inputs_[1] = keys; |
| 2195 } |
| 2196 |
| 2197 LOperand* object() { return inputs_[0]; } |
| 2198 LOperand* keys() { return inputs_[1]; } |
| 2199 |
| 2200 DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array") |
| 2201 |
| 2202 int idx() { |
| 2203 return HForInCacheArray::cast(this->hydrogen_value())->idx(); |
| 2204 } |
| 2205 }; |
| 2206 |
| 2207 |
| 2208 class LCheckMapValue: public LTemplateInstruction<1, 2, 0> { |
| 2209 public: |
| 2210 LCheckMapValue(LOperand* value, LOperand* map) { |
| 2211 inputs_[0] = value; |
| 2212 inputs_[1] = map; |
| 2213 } |
| 2214 |
| 2215 LOperand* value() { return inputs_[0]; } |
| 2216 LOperand* map() { return inputs_[1]; } |
| 2217 |
| 2218 DECLARE_CONCRETE_INSTRUCTION(CheckMapValue, "check-map-value") |
| 2219 }; |
| 2220 |
| 2221 |
| 2222 class LLoadFieldByIndex: public LTemplateInstruction<1, 2, 0> { |
| 2223 public: |
| 2224 LLoadFieldByIndex(LOperand* object, LOperand* index) { |
| 2225 inputs_[0] = object; |
| 2226 inputs_[1] = index; |
| 2227 } |
| 2228 |
| 2229 LOperand* object() { return inputs_[0]; } |
| 2230 LOperand* index() { return inputs_[1]; } |
| 2231 |
| 2232 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index") |
| 2233 }; |
| 2234 |
| 2235 |
2171 class LChunkBuilder; | 2236 class LChunkBuilder; |
2172 class LChunk: public ZoneObject { | 2237 class LChunk: public ZoneObject { |
2173 public: | 2238 public: |
2174 LChunk(CompilationInfo* info, HGraph* graph) | 2239 LChunk(CompilationInfo* info, HGraph* graph) |
2175 : spill_slot_count_(0), | 2240 : spill_slot_count_(0), |
2176 info_(info), | 2241 info_(info), |
2177 graph_(graph), | 2242 graph_(graph), |
2178 instructions_(32), | 2243 instructions_(32), |
2179 pointer_maps_(8), | 2244 pointer_maps_(8), |
2180 num_double_slots_(0), | 2245 num_double_slots_(0), |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2397 | 2462 |
2398 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2463 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2399 }; | 2464 }; |
2400 | 2465 |
2401 #undef DECLARE_HYDROGEN_ACCESSOR | 2466 #undef DECLARE_HYDROGEN_ACCESSOR |
2402 #undef DECLARE_CONCRETE_INSTRUCTION | 2467 #undef DECLARE_CONCRETE_INSTRUCTION |
2403 | 2468 |
2404 } } // namespace v8::internal | 2469 } } // namespace v8::internal |
2405 | 2470 |
2406 #endif // V8_IA32_LITHIUM_IA32_H_ | 2471 #endif // V8_IA32_LITHIUM_IA32_H_ |
OLD | NEW |