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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 V(LoadKeyedGeneric) \ | 143 V(LoadKeyedGeneric) \ |
144 V(LoadNamedField) \ | 144 V(LoadNamedField) \ |
145 V(LoadNamedFieldPolymorphic) \ | 145 V(LoadNamedFieldPolymorphic) \ |
146 V(LoadNamedGeneric) \ | 146 V(LoadNamedGeneric) \ |
147 V(MapEnumLength) \ | 147 V(MapEnumLength) \ |
148 V(MathFloorOfDiv) \ | 148 V(MathFloorOfDiv) \ |
149 V(MathMinMax) \ | 149 V(MathMinMax) \ |
150 V(Mod) \ | 150 V(Mod) \ |
151 V(Mul) \ | 151 V(Mul) \ |
152 V(NumericConstraint) \ | 152 V(NumericConstraint) \ |
153 V(ObjectLiteral) \ | |
154 V(OsrEntry) \ | 153 V(OsrEntry) \ |
155 V(OuterContext) \ | 154 V(OuterContext) \ |
156 V(Parameter) \ | 155 V(Parameter) \ |
157 V(Power) \ | 156 V(Power) \ |
158 V(PushArgument) \ | 157 V(PushArgument) \ |
159 V(Random) \ | 158 V(Random) \ |
160 V(RegExpLiteral) \ | 159 V(RegExpLiteral) \ |
161 V(Return) \ | 160 V(Return) \ |
162 V(Ror) \ | 161 V(Ror) \ |
163 V(Sar) \ | 162 V(Sar) \ |
(...skipping 5960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6124 | 6123 |
6125 private: | 6124 private: |
6126 int length_; | 6125 int length_; |
6127 Handle<HeapObject> boilerplate_object_; | 6126 Handle<HeapObject> boilerplate_object_; |
6128 Handle<FixedArray> literals_; | 6127 Handle<FixedArray> literals_; |
6129 ElementsKind boilerplate_elements_kind_; | 6128 ElementsKind boilerplate_elements_kind_; |
6130 bool is_copy_on_write_; | 6129 bool is_copy_on_write_; |
6131 }; | 6130 }; |
6132 | 6131 |
6133 | 6132 |
6134 class HObjectLiteral: public HMaterializedLiteral<1> { | |
6135 public: | |
6136 HObjectLiteral(HValue* context, | |
6137 Handle<FixedArray> constant_properties, | |
6138 Handle<FixedArray> literals, | |
6139 bool fast_elements, | |
6140 int literal_index, | |
6141 int depth, | |
6142 bool may_store_doubles, | |
6143 bool has_function) | |
6144 : HMaterializedLiteral<1>(literal_index, depth), | |
6145 constant_properties_(constant_properties), | |
6146 constant_properties_length_(constant_properties->length()), | |
6147 literals_(literals), | |
6148 fast_elements_(fast_elements), | |
6149 may_store_doubles_(may_store_doubles), | |
6150 has_function_(has_function) { | |
6151 SetOperandAt(0, context); | |
6152 SetGVNFlag(kChangesNewSpacePromotion); | |
6153 } | |
6154 | |
6155 HValue* context() { return OperandAt(0); } | |
6156 Handle<FixedArray> constant_properties() const { | |
6157 return constant_properties_; | |
6158 } | |
6159 int constant_properties_length() const { | |
6160 return constant_properties_length_; | |
6161 } | |
6162 Handle<FixedArray> literals() const { return literals_; } | |
6163 bool fast_elements() const { return fast_elements_; } | |
6164 bool may_store_doubles() const { return may_store_doubles_; } | |
6165 bool has_function() const { return has_function_; } | |
6166 | |
6167 virtual Representation RequiredInputRepresentation(int index) { | |
6168 return Representation::Tagged(); | |
6169 } | |
6170 virtual HType CalculateInferredType(); | |
6171 | |
6172 DECLARE_CONCRETE_INSTRUCTION(ObjectLiteral) | |
6173 | |
6174 private: | |
6175 Handle<FixedArray> constant_properties_; | |
6176 int constant_properties_length_; | |
6177 Handle<FixedArray> literals_; | |
6178 bool fast_elements_ : 1; | |
6179 bool may_store_doubles_ : 1; | |
6180 bool has_function_ : 1; | |
6181 }; | |
6182 | |
6183 | |
6184 class HRegExpLiteral: public HMaterializedLiteral<1> { | 6133 class HRegExpLiteral: public HMaterializedLiteral<1> { |
6185 public: | 6134 public: |
6186 HRegExpLiteral(HValue* context, | 6135 HRegExpLiteral(HValue* context, |
6187 Handle<FixedArray> literals, | 6136 Handle<FixedArray> literals, |
6188 Handle<String> pattern, | 6137 Handle<String> pattern, |
6189 Handle<String> flags, | 6138 Handle<String> flags, |
6190 int literal_index) | 6139 int literal_index) |
6191 : HMaterializedLiteral<1>(literal_index, 0), | 6140 : HMaterializedLiteral<1>(literal_index, 0), |
6192 literals_(literals), | 6141 literals_(literals), |
6193 pattern_(pattern), | 6142 pattern_(pattern), |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6294 | 6243 |
6295 DECLARE_CONCRETE_INSTRUCTION(TrapAllocationMemento) | 6244 DECLARE_CONCRETE_INSTRUCTION(TrapAllocationMemento) |
6296 }; | 6245 }; |
6297 | 6246 |
6298 | 6247 |
6299 class HToFastProperties: public HUnaryOperation { | 6248 class HToFastProperties: public HUnaryOperation { |
6300 public: | 6249 public: |
6301 explicit HToFastProperties(HValue* value) : HUnaryOperation(value) { | 6250 explicit HToFastProperties(HValue* value) : HUnaryOperation(value) { |
6302 // This instruction is not marked as having side effects, but | 6251 // This instruction is not marked as having side effects, but |
6303 // changes the map of the input operand. Use it only when creating | 6252 // changes the map of the input operand. Use it only when creating |
6304 // object literals. | 6253 // object literals via a runtime call. |
6305 ASSERT(value->IsObjectLiteral()); | 6254 ASSERT(value->IsCallRuntime()); |
| 6255 #ifdef DEBUG |
| 6256 const Runtime::Function* function = HCallRuntime::cast(value)->function(); |
| 6257 ASSERT(function->function_id == Runtime::kCreateObjectLiteral || |
| 6258 function->function_id == Runtime::kCreateObjectLiteralShallow); |
| 6259 #endif |
6306 set_representation(Representation::Tagged()); | 6260 set_representation(Representation::Tagged()); |
6307 } | 6261 } |
6308 | 6262 |
6309 virtual Representation RequiredInputRepresentation(int index) { | 6263 virtual Representation RequiredInputRepresentation(int index) { |
6310 return Representation::Tagged(); | 6264 return Representation::Tagged(); |
6311 } | 6265 } |
6312 | 6266 |
6313 DECLARE_CONCRETE_INSTRUCTION(ToFastProperties) | 6267 DECLARE_CONCRETE_INSTRUCTION(ToFastProperties) |
6314 | 6268 |
6315 private: | 6269 private: |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6559 virtual bool IsDeletable() const { return true; } | 6513 virtual bool IsDeletable() const { return true; } |
6560 }; | 6514 }; |
6561 | 6515 |
6562 | 6516 |
6563 #undef DECLARE_INSTRUCTION | 6517 #undef DECLARE_INSTRUCTION |
6564 #undef DECLARE_CONCRETE_INSTRUCTION | 6518 #undef DECLARE_CONCRETE_INSTRUCTION |
6565 | 6519 |
6566 } } // namespace v8::internal | 6520 } } // namespace v8::internal |
6567 | 6521 |
6568 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6522 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |