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

Side by Side Diff: src/ia32/lithium-ia32.h

Issue 9425045: Support fast case for-in in Crankshaft. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: port to x64&arm, cleanup Created 8 years, 10 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
OLDNEW
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
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
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, 1, 0> {
2190 public:
2191 LForInCacheArray(LOperand* map) {
2192 inputs_[0] = map;
2193 }
2194
2195 LOperand* map() { return inputs_[0]; }
2196
2197 DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array")
2198
2199 int idx() {
2200 return HForInCacheArray::cast(this->hydrogen_value())->idx();
2201 }
2202 };
2203
2204
2205 class LCheckMapValue: public LTemplateInstruction<1, 2, 0> {
fschneider 2012/02/22 10:16:45 No output: <0, 2, 0>
2206 public:
2207 LCheckMapValue(LOperand* value, LOperand* map) {
2208 inputs_[0] = value;
2209 inputs_[1] = map;
2210 }
2211
2212 LOperand* value() { return inputs_[0]; }
2213 LOperand* map() { return inputs_[1]; }
2214
2215 DECLARE_CONCRETE_INSTRUCTION(CheckMapValue, "check-map-value")
2216 };
2217
2218
2219 class LLoadFieldByIndex: public LTemplateInstruction<1, 2, 0> {
2220 public:
2221 LLoadFieldByIndex(LOperand* object, LOperand* index) {
2222 inputs_[0] = object;
2223 inputs_[1] = index;
2224 }
2225
2226 LOperand* object() { return inputs_[0]; }
2227 LOperand* index() { return inputs_[1]; }
2228
2229 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index")
2230 };
2231
2232
2171 class LChunkBuilder; 2233 class LChunkBuilder;
2172 class LChunk: public ZoneObject { 2234 class LChunk: public ZoneObject {
2173 public: 2235 public:
2174 LChunk(CompilationInfo* info, HGraph* graph) 2236 LChunk(CompilationInfo* info, HGraph* graph)
2175 : spill_slot_count_(0), 2237 : spill_slot_count_(0),
2176 info_(info), 2238 info_(info),
2177 graph_(graph), 2239 graph_(graph),
2178 instructions_(32), 2240 instructions_(32),
2179 pointer_maps_(8), 2241 pointer_maps_(8),
2180 num_double_slots_(0), 2242 num_double_slots_(0),
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
2397 2459
2398 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2460 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2399 }; 2461 };
2400 2462
2401 #undef DECLARE_HYDROGEN_ACCESSOR 2463 #undef DECLARE_HYDROGEN_ACCESSOR
2402 #undef DECLARE_CONCRETE_INSTRUCTION 2464 #undef DECLARE_CONCRETE_INSTRUCTION
2403 2465
2404 } } // namespace v8::internal 2466 } } // namespace v8::internal
2405 2467
2406 #endif // V8_IA32_LITHIUM_IA32_H_ 2468 #endif // V8_IA32_LITHIUM_IA32_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698