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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 V(SubI) \ | 166 V(SubI) \ |
167 V(TaggedToI) \ | 167 V(TaggedToI) \ |
168 V(ThisFunction) \ | 168 V(ThisFunction) \ |
169 V(Throw) \ | 169 V(Throw) \ |
170 V(ToFastProperties) \ | 170 V(ToFastProperties) \ |
171 V(TransitionElementsKind) \ | 171 V(TransitionElementsKind) \ |
172 V(Typeof) \ | 172 V(Typeof) \ |
173 V(TypeofIsAndBranch) \ | 173 V(TypeofIsAndBranch) \ |
174 V(UnaryMathOperation) \ | 174 V(UnaryMathOperation) \ |
175 V(UnknownOSRValue) \ | 175 V(UnknownOSRValue) \ |
176 V(ValueOf) | 176 V(ValueOf) \ |
| 177 V(ForInPrepareMap) \ |
| 178 V(ForInCacheArray) \ |
| 179 V(CheckMapValue) \ |
| 180 V(LoadFieldByIndex) |
177 | 181 |
178 | 182 |
179 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ | 183 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ |
180 virtual Opcode opcode() const { return LInstruction::k##type; } \ | 184 virtual Opcode opcode() const { return LInstruction::k##type; } \ |
181 virtual void CompileToNative(LCodeGen* generator); \ | 185 virtual void CompileToNative(LCodeGen* generator); \ |
182 virtual const char* Mnemonic() const { return mnemonic; } \ | 186 virtual const char* Mnemonic() const { return mnemonic; } \ |
183 static L##type* cast(LInstruction* instr) { \ | 187 static L##type* cast(LInstruction* instr) { \ |
184 ASSERT(instr->Is##type()); \ | 188 ASSERT(instr->Is##type()); \ |
185 return reinterpret_cast<L##type*>(instr); \ | 189 return reinterpret_cast<L##type*>(instr); \ |
186 } | 190 } |
(...skipping 1878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2065 inputs_[1] = object; | 2069 inputs_[1] = object; |
2066 } | 2070 } |
2067 | 2071 |
2068 LOperand* key() { return inputs_[0]; } | 2072 LOperand* key() { return inputs_[0]; } |
2069 LOperand* object() { return inputs_[1]; } | 2073 LOperand* object() { return inputs_[1]; } |
2070 | 2074 |
2071 DECLARE_CONCRETE_INSTRUCTION(In, "in") | 2075 DECLARE_CONCRETE_INSTRUCTION(In, "in") |
2072 }; | 2076 }; |
2073 | 2077 |
2074 | 2078 |
| 2079 class LForInPrepareMap: public LTemplateInstruction<1, 1, 0> { |
| 2080 public: |
| 2081 explicit LForInPrepareMap(LOperand* object) { |
| 2082 inputs_[0] = object; |
| 2083 } |
| 2084 |
| 2085 LOperand* object() { return inputs_[0]; } |
| 2086 |
| 2087 DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap, "for-in-prepare-map") |
| 2088 }; |
| 2089 |
| 2090 |
| 2091 class LForInCacheArray: public LTemplateInstruction<1, 1, 0> { |
| 2092 public: |
| 2093 explicit LForInCacheArray(LOperand* map) { |
| 2094 inputs_[0] = map; |
| 2095 } |
| 2096 |
| 2097 LOperand* map() { return inputs_[0]; } |
| 2098 |
| 2099 DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array") |
| 2100 |
| 2101 int idx() { |
| 2102 return HForInCacheArray::cast(this->hydrogen_value())->idx(); |
| 2103 } |
| 2104 }; |
| 2105 |
| 2106 |
| 2107 class LCheckMapValue: public LTemplateInstruction<0, 2, 0> { |
| 2108 public: |
| 2109 LCheckMapValue(LOperand* value, LOperand* map) { |
| 2110 inputs_[0] = value; |
| 2111 inputs_[1] = map; |
| 2112 } |
| 2113 |
| 2114 LOperand* value() { return inputs_[0]; } |
| 2115 LOperand* map() { return inputs_[1]; } |
| 2116 |
| 2117 DECLARE_CONCRETE_INSTRUCTION(CheckMapValue, "check-map-value") |
| 2118 }; |
| 2119 |
| 2120 |
| 2121 class LLoadFieldByIndex: public LTemplateInstruction<1, 2, 0> { |
| 2122 public: |
| 2123 LLoadFieldByIndex(LOperand* object, LOperand* index) { |
| 2124 inputs_[0] = object; |
| 2125 inputs_[1] = index; |
| 2126 } |
| 2127 |
| 2128 LOperand* object() { return inputs_[0]; } |
| 2129 LOperand* index() { return inputs_[1]; } |
| 2130 |
| 2131 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index") |
| 2132 }; |
| 2133 |
| 2134 |
2075 class LChunkBuilder; | 2135 class LChunkBuilder; |
2076 class LChunk: public ZoneObject { | 2136 class LChunk: public ZoneObject { |
2077 public: | 2137 public: |
2078 explicit LChunk(CompilationInfo* info, HGraph* graph); | 2138 explicit LChunk(CompilationInfo* info, HGraph* graph); |
2079 | 2139 |
2080 void AddInstruction(LInstruction* instruction, HBasicBlock* block); | 2140 void AddInstruction(LInstruction* instruction, HBasicBlock* block); |
2081 LConstantOperand* DefineConstantOperand(HConstant* constant); | 2141 LConstantOperand* DefineConstantOperand(HConstant* constant); |
2082 Handle<Object> LookupLiteral(LConstantOperand* operand) const; | 2142 Handle<Object> LookupLiteral(LConstantOperand* operand) const; |
2083 Representation LookupLiteralRepresentation(LConstantOperand* operand) const; | 2143 Representation LookupLiteralRepresentation(LConstantOperand* operand) const; |
2084 | 2144 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2285 | 2345 |
2286 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2346 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2287 }; | 2347 }; |
2288 | 2348 |
2289 #undef DECLARE_HYDROGEN_ACCESSOR | 2349 #undef DECLARE_HYDROGEN_ACCESSOR |
2290 #undef DECLARE_CONCRETE_INSTRUCTION | 2350 #undef DECLARE_CONCRETE_INSTRUCTION |
2291 | 2351 |
2292 } } // namespace v8::internal | 2352 } } // namespace v8::internal |
2293 | 2353 |
2294 #endif // V8_MIPS_LITHIUM_MIPS_H_ | 2354 #endif // V8_MIPS_LITHIUM_MIPS_H_ |
OLD | NEW |