OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 4184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4195 | 4195 |
4196 private: | 4196 private: |
4197 int literal_index_; | 4197 int literal_index_; |
4198 int depth_; | 4198 int depth_; |
4199 }; | 4199 }; |
4200 | 4200 |
4201 | 4201 |
4202 class HArrayLiteral: public HMaterializedLiteral<1> { | 4202 class HArrayLiteral: public HMaterializedLiteral<1> { |
4203 public: | 4203 public: |
4204 HArrayLiteral(HValue* context, | 4204 HArrayLiteral(HValue* context, |
4205 Handle<JSObject> boilerplate_object, | 4205 Handle<HeapObject> boilerplate_object, |
4206 int length, | 4206 int length, |
4207 int literal_index, | 4207 int literal_index, |
4208 int depth) | 4208 int depth) |
4209 : HMaterializedLiteral<1>(literal_index, depth), | 4209 : HMaterializedLiteral<1>(literal_index, depth), |
4210 length_(length), | 4210 length_(length), |
4211 boilerplate_object_(boilerplate_object) { | 4211 boilerplate_object_(boilerplate_object) { |
4212 SetOperandAt(0, context); | 4212 SetOperandAt(0, context); |
4213 } | 4213 } |
4214 | 4214 |
4215 HValue* context() { return OperandAt(0); } | 4215 HValue* context() { return OperandAt(0); } |
4216 ElementsKind boilerplate_elements_kind() const { | 4216 ElementsKind boilerplate_elements_kind() const { |
4217 return boilerplate_object_->GetElementsKind(); | 4217 if (!boilerplate_object_->IsJSObject()) { |
| 4218 return FAST_ELEMENTS; |
| 4219 } |
| 4220 return Handle<JSObject>::cast(boilerplate_object_)->GetElementsKind(); |
4218 } | 4221 } |
4219 Handle<JSObject> boilerplate_object() const { return boilerplate_object_; } | 4222 Handle<HeapObject> boilerplate_object() const { return boilerplate_object_; } |
4220 int length() const { return length_; } | 4223 int length() const { return length_; } |
4221 | 4224 |
4222 bool IsCopyOnWrite() const; | 4225 bool IsCopyOnWrite() const; |
4223 | 4226 |
4224 virtual Representation RequiredInputRepresentation(int index) { | 4227 virtual Representation RequiredInputRepresentation(int index) { |
4225 return Representation::Tagged(); | 4228 return Representation::Tagged(); |
4226 } | 4229 } |
4227 virtual HType CalculateInferredType(); | 4230 virtual HType CalculateInferredType(); |
4228 | 4231 |
4229 DECLARE_CONCRETE_INSTRUCTION(ArrayLiteral) | 4232 DECLARE_CONCRETE_INSTRUCTION(ArrayLiteral) |
4230 | 4233 |
4231 private: | 4234 private: |
4232 int length_; | 4235 int length_; |
4233 Handle<JSObject> boilerplate_object_; | 4236 Handle<HeapObject> boilerplate_object_; |
4234 }; | 4237 }; |
4235 | 4238 |
4236 | 4239 |
4237 class HObjectLiteralFast: public HMaterializedLiteral<1> { | 4240 class HObjectLiteralFast: public HMaterializedLiteral<1> { |
4238 public: | 4241 public: |
4239 HObjectLiteralFast(HValue* context, | 4242 HObjectLiteralFast(HValue* context, |
4240 Handle<JSObject> boilerplate, | 4243 Handle<JSObject> boilerplate, |
4241 int total_size, | 4244 int total_size, |
4242 int literal_index, | 4245 int literal_index, |
4243 int depth) | 4246 int depth) |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4464 | 4467 |
4465 DECLARE_CONCRETE_INSTRUCTION(In) | 4468 DECLARE_CONCRETE_INSTRUCTION(In) |
4466 }; | 4469 }; |
4467 | 4470 |
4468 #undef DECLARE_INSTRUCTION | 4471 #undef DECLARE_INSTRUCTION |
4469 #undef DECLARE_CONCRETE_INSTRUCTION | 4472 #undef DECLARE_CONCRETE_INSTRUCTION |
4470 | 4473 |
4471 } } // namespace v8::internal | 4474 } } // namespace v8::internal |
4472 | 4475 |
4473 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 4476 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |