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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
165 V(SubI) \ | 165 V(SubI) \ |
166 V(TaggedToI) \ | 166 V(TaggedToI) \ |
167 V(ThisFunction) \ | 167 V(ThisFunction) \ |
168 V(Throw) \ | 168 V(Throw) \ |
169 V(ToFastProperties) \ | 169 V(ToFastProperties) \ |
170 V(TransitionElementsKind) \ | 170 V(TransitionElementsKind) \ |
171 V(Typeof) \ | 171 V(Typeof) \ |
172 V(TypeofIsAndBranch) \ | 172 V(TypeofIsAndBranch) \ |
173 V(UnaryMathOperation) \ | 173 V(UnaryMathOperation) \ |
174 V(UnknownOSRValue) \ | 174 V(UnknownOSRValue) \ |
175 V(ValueOf) | 175 V(ValueOf) \ |
176 V(ForInPrepareMap) \ | |
177 V(ForInCacheArray) \ | |
178 V(CheckMapValue) \ | |
179 V(LoadFieldByIndex) | |
180 | |
176 | 181 |
177 | 182 |
178 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ | 183 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ |
179 virtual Opcode opcode() const { return LInstruction::k##type; } \ | 184 virtual Opcode opcode() const { return LInstruction::k##type; } \ |
180 virtual void CompileToNative(LCodeGen* generator); \ | 185 virtual void CompileToNative(LCodeGen* generator); \ |
181 virtual const char* Mnemonic() const { return mnemonic; } \ | 186 virtual const char* Mnemonic() const { return mnemonic; } \ |
182 static L##type* cast(LInstruction* instr) { \ | 187 static L##type* cast(LInstruction* instr) { \ |
183 ASSERT(instr->Is##type()); \ | 188 ASSERT(instr->Is##type()); \ |
184 return reinterpret_cast<L##type*>(instr); \ | 189 return reinterpret_cast<L##type*>(instr); \ |
185 } | 190 } |
(...skipping 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2057 inputs_[1] = object; | 2062 inputs_[1] = object; |
2058 } | 2063 } |
2059 | 2064 |
2060 LOperand* key() { return inputs_[0]; } | 2065 LOperand* key() { return inputs_[0]; } |
2061 LOperand* object() { return inputs_[1]; } | 2066 LOperand* object() { return inputs_[1]; } |
2062 | 2067 |
2063 DECLARE_CONCRETE_INSTRUCTION(In, "in") | 2068 DECLARE_CONCRETE_INSTRUCTION(In, "in") |
2064 }; | 2069 }; |
2065 | 2070 |
2066 | 2071 |
2072 class LForInPrepareMap: public LTemplateInstruction<1, 1, 0> { | |
2073 public: | |
2074 LForInPrepareMap(LOperand* object) { | |
2075 inputs_[0] = object; | |
2076 } | |
2077 | |
2078 LOperand* object() { return inputs_[0]; } | |
2079 | |
2080 DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap, "for-in-prepare-map") | |
2081 }; | |
2082 | |
2083 | |
2084 class LForInCacheArray: public LTemplateInstruction<1, 1, 0> { | |
2085 public: | |
2086 LForInCacheArray(LOperand* map) { | |
2087 inputs_[0] = map; | |
2088 } | |
2089 | |
2090 LOperand* map() { return inputs_[0]; } | |
2091 | |
2092 DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array") | |
2093 | |
2094 int idx() { | |
2095 return HForInCacheArray::cast(this->hydrogen_value())->idx(); | |
2096 } | |
2097 }; | |
2098 | |
2099 | |
2100 class LCheckMapValue: public LTemplateInstruction<1, 2, 0> { | |
fschneider
2012/02/22 10:16:45
Since there is no output operand: <0, 2, 0>
| |
2101 public: | |
2102 LCheckMapValue(LOperand* value, LOperand* map) { | |
2103 inputs_[0] = value; | |
2104 inputs_[1] = map; | |
2105 } | |
2106 | |
2107 LOperand* value() { return inputs_[0]; } | |
2108 LOperand* map() { return inputs_[1]; } | |
2109 | |
2110 DECLARE_CONCRETE_INSTRUCTION(CheckMapValue, "check-map-value") | |
2111 }; | |
2112 | |
2113 | |
2114 class LLoadFieldByIndex: public LTemplateInstruction<1, 2, 0> { | |
2115 public: | |
2116 LLoadFieldByIndex(LOperand* object, LOperand* index) { | |
2117 inputs_[0] = object; | |
2118 inputs_[1] = index; | |
2119 } | |
2120 | |
2121 LOperand* object() { return inputs_[0]; } | |
2122 LOperand* index() { return inputs_[1]; } | |
2123 | |
2124 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index") | |
2125 }; | |
2126 | |
2127 | |
2067 class LChunkBuilder; | 2128 class LChunkBuilder; |
2068 class LChunk: public ZoneObject { | 2129 class LChunk: public ZoneObject { |
2069 public: | 2130 public: |
2070 explicit LChunk(CompilationInfo* info, HGraph* graph); | 2131 explicit LChunk(CompilationInfo* info, HGraph* graph); |
2071 | 2132 |
2072 void AddInstruction(LInstruction* instruction, HBasicBlock* block); | 2133 void AddInstruction(LInstruction* instruction, HBasicBlock* block); |
2073 LConstantOperand* DefineConstantOperand(HConstant* constant); | 2134 LConstantOperand* DefineConstantOperand(HConstant* constant); |
2074 Handle<Object> LookupLiteral(LConstantOperand* operand) const; | 2135 Handle<Object> LookupLiteral(LConstantOperand* operand) const; |
2075 Representation LookupLiteralRepresentation(LConstantOperand* operand) const; | 2136 Representation LookupLiteralRepresentation(LConstantOperand* operand) const; |
2076 | 2137 |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2276 | 2337 |
2277 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2338 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2278 }; | 2339 }; |
2279 | 2340 |
2280 #undef DECLARE_HYDROGEN_ACCESSOR | 2341 #undef DECLARE_HYDROGEN_ACCESSOR |
2281 #undef DECLARE_CONCRETE_INSTRUCTION | 2342 #undef DECLARE_CONCRETE_INSTRUCTION |
2282 | 2343 |
2283 } } // namespace v8::internal | 2344 } } // namespace v8::internal |
2284 | 2345 |
2285 #endif // V8_ARM_LITHIUM_ARM_H_ | 2346 #endif // V8_ARM_LITHIUM_ARM_H_ |
OLD | NEW |