| 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 5963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5974 int literal_index_; | 5974 int literal_index_; |
| 5975 int depth_; | 5975 int depth_; |
| 5976 AllocationSiteMode allocation_site_mode_; | 5976 AllocationSiteMode allocation_site_mode_; |
| 5977 }; | 5977 }; |
| 5978 | 5978 |
| 5979 | 5979 |
| 5980 class HFastLiteral: public HMaterializedLiteral<1> { | 5980 class HFastLiteral: public HMaterializedLiteral<1> { |
| 5981 public: | 5981 public: |
| 5982 HFastLiteral(HValue* context, | 5982 HFastLiteral(HValue* context, |
| 5983 Handle<JSObject> boilerplate, | 5983 Handle<JSObject> boilerplate, |
| 5984 Handle<JSObject> original_boilerplate, |
| 5984 int total_size, | 5985 int total_size, |
| 5985 int literal_index, | 5986 int literal_index, |
| 5986 int depth, | 5987 int depth, |
| 5987 AllocationSiteMode mode) | 5988 AllocationSiteMode mode, |
| 5989 int size_without_allocation_sites) |
| 5988 : HMaterializedLiteral<1>(literal_index, depth, mode), | 5990 : HMaterializedLiteral<1>(literal_index, depth, mode), |
| 5989 boilerplate_(boilerplate), | 5991 boilerplate_(boilerplate), |
| 5990 total_size_(total_size) { | 5992 original_boilerplate_(original_boilerplate), |
| 5993 total_size_(total_size), |
| 5994 size_without_allocation_sites_(size_without_allocation_sites) { |
| 5995 ASSERT(!boilerplate.is_identical_to(original_boilerplate)); |
| 5991 SetOperandAt(0, context); | 5996 SetOperandAt(0, context); |
| 5992 SetGVNFlag(kChangesNewSpacePromotion); | 5997 SetGVNFlag(kChangesNewSpacePromotion); |
| 5993 } | 5998 } |
| 5994 | 5999 |
| 5995 // Maximum depth and total number of elements and properties for literal | 6000 // Maximum depth and total number of elements and properties for literal |
| 5996 // graphs to be considered for fast deep-copying. | 6001 // graphs to be considered for fast deep-copying. |
| 5997 static const int kMaxLiteralDepth = 3; | 6002 static const int kMaxLiteralDepth = 3; |
| 5998 static const int kMaxLiteralProperties = 8; | 6003 static const int kMaxLiteralProperties = 8; |
| 5999 | 6004 |
| 6000 HValue* context() { return OperandAt(0); } | 6005 HValue* context() { return OperandAt(0); } |
| 6001 Handle<JSObject> boilerplate() const { return boilerplate_; } | 6006 Handle<JSObject> boilerplate() const { return boilerplate_; } |
| 6007 Handle<JSObject> original_boilerplate() const { |
| 6008 return original_boilerplate_; |
| 6009 } |
| 6002 int total_size() const { return total_size_; } | 6010 int total_size() const { return total_size_; } |
| 6011 int size_without_allocation_sites() const { |
| 6012 return size_without_allocation_sites_; |
| 6013 } |
| 6003 virtual Representation RequiredInputRepresentation(int index) { | 6014 virtual Representation RequiredInputRepresentation(int index) { |
| 6004 return Representation::Tagged(); | 6015 return Representation::Tagged(); |
| 6005 } | 6016 } |
| 6006 virtual Handle<Map> GetMonomorphicJSObjectMap() { | 6017 virtual Handle<Map> GetMonomorphicJSObjectMap() { |
| 6007 return Handle<Map>(boilerplate()->map()); | 6018 return Handle<Map>(boilerplate()->map()); |
| 6008 } | 6019 } |
| 6009 virtual HType CalculateInferredType(); | 6020 virtual HType CalculateInferredType(); |
| 6010 | 6021 |
| 6011 DECLARE_CONCRETE_INSTRUCTION(FastLiteral) | 6022 DECLARE_CONCRETE_INSTRUCTION(FastLiteral) |
| 6012 | 6023 |
| 6013 private: | 6024 private: |
| 6014 Handle<JSObject> boilerplate_; | 6025 Handle<JSObject> boilerplate_; |
| 6026 Handle<JSObject> original_boilerplate_; |
| 6015 int total_size_; | 6027 int total_size_; |
| 6028 int size_without_allocation_sites_; |
| 6016 }; | 6029 }; |
| 6017 | 6030 |
| 6018 | 6031 |
| 6019 class HArrayLiteral: public HMaterializedLiteral<1> { | 6032 class HArrayLiteral: public HMaterializedLiteral<1> { |
| 6020 public: | 6033 public: |
| 6021 HArrayLiteral(HValue* context, | 6034 HArrayLiteral(HValue* context, |
| 6022 Handle<HeapObject> boilerplate_object, | 6035 Handle<HeapObject> boilerplate_object, |
| 6023 int length, | 6036 int length, |
| 6024 int literal_index, | 6037 int literal_index, |
| 6025 int depth, | 6038 int depth, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 6055 }; | 6068 }; |
| 6056 | 6069 |
| 6057 | 6070 |
| 6058 class HObjectLiteral: public HMaterializedLiteral<1> { | 6071 class HObjectLiteral: public HMaterializedLiteral<1> { |
| 6059 public: | 6072 public: |
| 6060 HObjectLiteral(HValue* context, | 6073 HObjectLiteral(HValue* context, |
| 6061 Handle<FixedArray> constant_properties, | 6074 Handle<FixedArray> constant_properties, |
| 6062 bool fast_elements, | 6075 bool fast_elements, |
| 6063 int literal_index, | 6076 int literal_index, |
| 6064 int depth, | 6077 int depth, |
| 6065 bool has_function) | 6078 bool has_function, |
| 6066 : HMaterializedLiteral<1>(literal_index, depth), | 6079 AllocationSiteMode mode) |
| 6080 : HMaterializedLiteral<1>(literal_index, depth, mode), |
| 6067 constant_properties_(constant_properties), | 6081 constant_properties_(constant_properties), |
| 6068 fast_elements_(fast_elements), | 6082 fast_elements_(fast_elements), |
| 6069 has_function_(has_function) { | 6083 has_function_(has_function) { |
| 6070 SetOperandAt(0, context); | 6084 SetOperandAt(0, context); |
| 6071 SetGVNFlag(kChangesNewSpacePromotion); | 6085 SetGVNFlag(kChangesNewSpacePromotion); |
| 6072 } | 6086 } |
| 6073 | 6087 |
| 6074 HValue* context() { return OperandAt(0); } | 6088 HValue* context() { return OperandAt(0); } |
| 6075 Handle<FixedArray> constant_properties() const { | 6089 Handle<FixedArray> constant_properties() const { |
| 6076 return constant_properties_; | 6090 return constant_properties_; |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6460 virtual bool IsDeletable() const { return true; } | 6474 virtual bool IsDeletable() const { return true; } |
| 6461 }; | 6475 }; |
| 6462 | 6476 |
| 6463 | 6477 |
| 6464 #undef DECLARE_INSTRUCTION | 6478 #undef DECLARE_INSTRUCTION |
| 6465 #undef DECLARE_CONCRETE_INSTRUCTION | 6479 #undef DECLARE_CONCRETE_INSTRUCTION |
| 6466 | 6480 |
| 6467 } } // namespace v8::internal | 6481 } } // namespace v8::internal |
| 6468 | 6482 |
| 6469 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6483 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |