| 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 5246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5257 int literal_index_; | 5257 int literal_index_; |
| 5258 int depth_; | 5258 int depth_; |
| 5259 AllocationSiteMode allocation_site_mode_; | 5259 AllocationSiteMode allocation_site_mode_; |
| 5260 }; | 5260 }; |
| 5261 | 5261 |
| 5262 | 5262 |
| 5263 class HFastLiteral: public HMaterializedLiteral<1> { | 5263 class HFastLiteral: public HMaterializedLiteral<1> { |
| 5264 public: | 5264 public: |
| 5265 HFastLiteral(HValue* context, | 5265 HFastLiteral(HValue* context, |
| 5266 Handle<JSObject> boilerplate, | 5266 Handle<JSObject> boilerplate, |
| 5267 Handle<JSObject> original_boilerplate, |
| 5267 int total_size, | 5268 int total_size, |
| 5268 int literal_index, | 5269 int literal_index, |
| 5269 int depth, | 5270 int depth, |
| 5270 AllocationSiteMode mode) | 5271 AllocationSiteMode mode) |
| 5271 : HMaterializedLiteral<1>(literal_index, depth, mode), | 5272 : HMaterializedLiteral<1>(literal_index, depth, mode), |
| 5272 boilerplate_(boilerplate), | 5273 boilerplate_(boilerplate), |
| 5274 original_boilerplate_(original_boilerplate), |
| 5273 total_size_(total_size) { | 5275 total_size_(total_size) { |
| 5276 ASSERT(!boilerplate.is_identical_to(original_boilerplate)); |
| 5274 SetOperandAt(0, context); | 5277 SetOperandAt(0, context); |
| 5275 SetGVNFlag(kChangesNewSpacePromotion); | 5278 SetGVNFlag(kChangesNewSpacePromotion); |
| 5276 } | 5279 } |
| 5277 | 5280 |
| 5278 // Maximum depth and total number of elements and properties for literal | 5281 // Maximum depth and total number of elements and properties for literal |
| 5279 // graphs to be considered for fast deep-copying. | 5282 // graphs to be considered for fast deep-copying. |
| 5280 static const int kMaxLiteralDepth = 3; | 5283 static const int kMaxLiteralDepth = 3; |
| 5281 static const int kMaxLiteralProperties = 8; | 5284 static const int kMaxLiteralProperties = 8; |
| 5282 | 5285 |
| 5283 HValue* context() { return OperandAt(0); } | 5286 HValue* context() { return OperandAt(0); } |
| 5284 Handle<JSObject> boilerplate() const { return boilerplate_; } | 5287 Handle<JSObject> boilerplate() const { return boilerplate_; } |
| 5288 Handle<JSObject> original_boilerplate() const { |
| 5289 return original_boilerplate_; |
| 5290 } |
| 5285 int total_size() const { return total_size_; } | 5291 int total_size() const { return total_size_; } |
| 5286 virtual Representation RequiredInputRepresentation(int index) { | 5292 virtual Representation RequiredInputRepresentation(int index) { |
| 5287 return Representation::Tagged(); | 5293 return Representation::Tagged(); |
| 5288 } | 5294 } |
| 5289 virtual Handle<Map> GetMonomorphicJSObjectMap() { | 5295 virtual Handle<Map> GetMonomorphicJSObjectMap() { |
| 5290 return Handle<Map>(boilerplate()->map()); | 5296 return Handle<Map>(boilerplate()->map()); |
| 5291 } | 5297 } |
| 5292 virtual HType CalculateInferredType(); | 5298 virtual HType CalculateInferredType(); |
| 5293 | 5299 |
| 5294 DECLARE_CONCRETE_INSTRUCTION(FastLiteral) | 5300 DECLARE_CONCRETE_INSTRUCTION(FastLiteral) |
| 5295 | 5301 |
| 5296 private: | 5302 private: |
| 5297 Handle<JSObject> boilerplate_; | 5303 Handle<JSObject> boilerplate_; |
| 5304 Handle<JSObject> original_boilerplate_; |
| 5298 int total_size_; | 5305 int total_size_; |
| 5299 }; | 5306 }; |
| 5300 | 5307 |
| 5301 | 5308 |
| 5302 class HArrayLiteral: public HMaterializedLiteral<1> { | 5309 class HArrayLiteral: public HMaterializedLiteral<1> { |
| 5303 public: | 5310 public: |
| 5304 HArrayLiteral(HValue* context, | 5311 HArrayLiteral(HValue* context, |
| 5305 Handle<HeapObject> boilerplate_object, | 5312 Handle<HeapObject> boilerplate_object, |
| 5306 int length, | 5313 int length, |
| 5307 int literal_index, | 5314 int literal_index, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 5338 }; | 5345 }; |
| 5339 | 5346 |
| 5340 | 5347 |
| 5341 class HObjectLiteral: public HMaterializedLiteral<1> { | 5348 class HObjectLiteral: public HMaterializedLiteral<1> { |
| 5342 public: | 5349 public: |
| 5343 HObjectLiteral(HValue* context, | 5350 HObjectLiteral(HValue* context, |
| 5344 Handle<FixedArray> constant_properties, | 5351 Handle<FixedArray> constant_properties, |
| 5345 bool fast_elements, | 5352 bool fast_elements, |
| 5346 int literal_index, | 5353 int literal_index, |
| 5347 int depth, | 5354 int depth, |
| 5348 bool has_function) | 5355 bool has_function, |
| 5349 : HMaterializedLiteral<1>(literal_index, depth), | 5356 AllocationSiteMode mode) |
| 5357 : HMaterializedLiteral<1>(literal_index, depth, mode), |
| 5350 constant_properties_(constant_properties), | 5358 constant_properties_(constant_properties), |
| 5351 fast_elements_(fast_elements), | 5359 fast_elements_(fast_elements), |
| 5352 has_function_(has_function) { | 5360 has_function_(has_function) { |
| 5353 SetOperandAt(0, context); | 5361 SetOperandAt(0, context); |
| 5354 SetGVNFlag(kChangesNewSpacePromotion); | 5362 SetGVNFlag(kChangesNewSpacePromotion); |
| 5355 } | 5363 } |
| 5356 | 5364 |
| 5357 HValue* context() { return OperandAt(0); } | 5365 HValue* context() { return OperandAt(0); } |
| 5358 Handle<FixedArray> constant_properties() const { | 5366 Handle<FixedArray> constant_properties() const { |
| 5359 return constant_properties_; | 5367 return constant_properties_; |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5743 virtual bool IsDeletable() const { return true; } | 5751 virtual bool IsDeletable() const { return true; } |
| 5744 }; | 5752 }; |
| 5745 | 5753 |
| 5746 | 5754 |
| 5747 #undef DECLARE_INSTRUCTION | 5755 #undef DECLARE_INSTRUCTION |
| 5748 #undef DECLARE_CONCRETE_INSTRUCTION | 5756 #undef DECLARE_CONCRETE_INSTRUCTION |
| 5749 | 5757 |
| 5750 } } // namespace v8::internal | 5758 } } // namespace v8::internal |
| 5751 | 5759 |
| 5752 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 5760 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |