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 4970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4981 int depth_; | 4981 int depth_; |
4982 }; | 4982 }; |
4983 | 4983 |
4984 | 4984 |
4985 class HFastLiteral: public HMaterializedLiteral<1> { | 4985 class HFastLiteral: public HMaterializedLiteral<1> { |
4986 public: | 4986 public: |
4987 HFastLiteral(HValue* context, | 4987 HFastLiteral(HValue* context, |
4988 Handle<JSObject> boilerplate, | 4988 Handle<JSObject> boilerplate, |
4989 int total_size, | 4989 int total_size, |
4990 int literal_index, | 4990 int literal_index, |
4991 int depth) | 4991 int depth, |
4992 bool create_allocation_site_info = false) | |
danno
2013/01/10 22:58:59
Use AllocationSiteInfoMode.
mvstanton
2013/01/11 13:43:01
Done.
| |
4992 : HMaterializedLiteral<1>(literal_index, depth), | 4993 : HMaterializedLiteral<1>(literal_index, depth), |
4993 boilerplate_(boilerplate), | 4994 boilerplate_(boilerplate), |
4994 total_size_(total_size) { | 4995 total_size_(total_size), |
4996 create_allocation_site_info_(create_allocation_site_info) { | |
4995 SetOperandAt(0, context); | 4997 SetOperandAt(0, context); |
4996 SetGVNFlag(kChangesNewSpacePromotion); | 4998 SetGVNFlag(kChangesNewSpacePromotion); |
4997 } | 4999 } |
4998 | 5000 |
4999 // Maximum depth and total number of elements and properties for literal | 5001 // Maximum depth and total number of elements and properties for literal |
5000 // graphs to be considered for fast deep-copying. | 5002 // graphs to be considered for fast deep-copying. |
5001 static const int kMaxLiteralDepth = 3; | 5003 static const int kMaxLiteralDepth = 3; |
5002 static const int kMaxLiteralProperties = 8; | 5004 static const int kMaxLiteralProperties = 8; |
5003 | 5005 |
5004 HValue* context() { return OperandAt(0); } | 5006 HValue* context() { return OperandAt(0); } |
5005 Handle<JSObject> boilerplate() const { return boilerplate_; } | 5007 Handle<JSObject> boilerplate() const { return boilerplate_; } |
5006 int total_size() const { return total_size_; } | 5008 int total_size() const { return total_size_; } |
5007 | 5009 bool create_allocation_site_info() const { |
5010 return create_allocation_site_info_; | |
5011 } | |
5008 virtual Representation RequiredInputRepresentation(int index) { | 5012 virtual Representation RequiredInputRepresentation(int index) { |
5009 return Representation::Tagged(); | 5013 return Representation::Tagged(); |
5010 } | 5014 } |
5011 virtual HType CalculateInferredType(); | 5015 virtual HType CalculateInferredType(); |
5012 | 5016 |
5013 DECLARE_CONCRETE_INSTRUCTION(FastLiteral) | 5017 DECLARE_CONCRETE_INSTRUCTION(FastLiteral) |
5014 | 5018 |
5015 private: | 5019 private: |
5016 Handle<JSObject> boilerplate_; | 5020 Handle<JSObject> boilerplate_; |
5017 int total_size_; | 5021 int total_size_; |
5022 bool create_allocation_site_info_; | |
5018 }; | 5023 }; |
5019 | 5024 |
5020 | 5025 |
5021 class HArrayLiteral: public HMaterializedLiteral<1> { | 5026 class HArrayLiteral: public HMaterializedLiteral<1> { |
5022 public: | 5027 public: |
5023 HArrayLiteral(HValue* context, | 5028 HArrayLiteral(HValue* context, |
5024 Handle<HeapObject> boilerplate_object, | 5029 Handle<HeapObject> boilerplate_object, |
5025 int length, | 5030 int length, |
5026 int literal_index, | 5031 int literal_index, |
5027 int depth) | 5032 int depth) |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5446 virtual bool IsDeletable() const { return true; } | 5451 virtual bool IsDeletable() const { return true; } |
5447 }; | 5452 }; |
5448 | 5453 |
5449 | 5454 |
5450 #undef DECLARE_INSTRUCTION | 5455 #undef DECLARE_INSTRUCTION |
5451 #undef DECLARE_CONCRETE_INSTRUCTION | 5456 #undef DECLARE_CONCRETE_INSTRUCTION |
5452 | 5457 |
5453 } } // namespace v8::internal | 5458 } } // namespace v8::internal |
5454 | 5459 |
5455 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 5460 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |