Chromium Code Reviews| 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 5128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5139 int literal_index_; | 5139 int literal_index_; |
| 5140 int depth_; | 5140 int depth_; |
| 5141 AllocationSiteMode allocation_site_mode_; | 5141 AllocationSiteMode allocation_site_mode_; |
| 5142 }; | 5142 }; |
| 5143 | 5143 |
| 5144 | 5144 |
| 5145 class HFastLiteral: public HMaterializedLiteral<1> { | 5145 class HFastLiteral: public HMaterializedLiteral<1> { |
| 5146 public: | 5146 public: |
| 5147 HFastLiteral(HValue* context, | 5147 HFastLiteral(HValue* context, |
| 5148 Handle<JSObject> boilerplate, | 5148 Handle<JSObject> boilerplate, |
| 5149 Handle<JSObject> original_boilerplate, | |
| 5149 int total_size, | 5150 int total_size, |
| 5150 int literal_index, | 5151 int literal_index, |
| 5151 int depth, | 5152 int depth, |
| 5152 AllocationSiteMode mode) | 5153 AllocationSiteMode mode) |
| 5153 : HMaterializedLiteral<1>(literal_index, depth, mode), | 5154 : HMaterializedLiteral<1>(literal_index, depth, mode), |
| 5154 boilerplate_(boilerplate), | 5155 boilerplate_(boilerplate), |
| 5156 original_boilerplate_(original_boilerplate), | |
| 5155 total_size_(total_size) { | 5157 total_size_(total_size) { |
| 5158 ASSERT(!boilerplate.is_identical_to(original_boilerplate)); | |
| 5156 SetOperandAt(0, context); | 5159 SetOperandAt(0, context); |
| 5157 SetGVNFlag(kChangesNewSpacePromotion); | 5160 SetGVNFlag(kChangesNewSpacePromotion); |
| 5158 } | 5161 } |
| 5159 | 5162 |
| 5160 // Maximum depth and total number of elements and properties for literal | 5163 // Maximum depth and total number of elements and properties for literal |
| 5161 // graphs to be considered for fast deep-copying. | 5164 // graphs to be considered for fast deep-copying. |
| 5162 static const int kMaxLiteralDepth = 3; | 5165 static const int kMaxLiteralDepth = 3; |
| 5163 static const int kMaxLiteralProperties = 8; | 5166 static const int kMaxLiteralProperties = 8; |
| 5164 | 5167 |
| 5165 HValue* context() { return OperandAt(0); } | 5168 HValue* context() { return OperandAt(0); } |
| 5166 Handle<JSObject> boilerplate() const { return boilerplate_; } | 5169 Handle<JSObject> boilerplate() const { return boilerplate_; } |
| 5170 Handle<JSObject> original_boilerplate() const { | |
| 5171 return original_boilerplate_; } | |
|
danno
2013/02/08 13:44:38
nit: } should be on next line
mvstanton
2013/02/11 11:11:24
Done.
| |
| 5167 int total_size() const { return total_size_; } | 5172 int total_size() const { return total_size_; } |
| 5168 virtual Representation RequiredInputRepresentation(int index) { | 5173 virtual Representation RequiredInputRepresentation(int index) { |
| 5169 return Representation::Tagged(); | 5174 return Representation::Tagged(); |
| 5170 } | 5175 } |
| 5171 virtual Handle<Map> GetMonomorphicJSObjectMap() { | 5176 virtual Handle<Map> GetMonomorphicJSObjectMap() { |
| 5172 return Handle<Map>(boilerplate()->map()); | 5177 return Handle<Map>(boilerplate()->map()); |
| 5173 } | 5178 } |
| 5174 virtual HType CalculateInferredType(); | 5179 virtual HType CalculateInferredType(); |
| 5175 | 5180 |
| 5176 DECLARE_CONCRETE_INSTRUCTION(FastLiteral) | 5181 DECLARE_CONCRETE_INSTRUCTION(FastLiteral) |
| 5177 | 5182 |
| 5178 private: | 5183 private: |
| 5179 Handle<JSObject> boilerplate_; | 5184 Handle<JSObject> boilerplate_; |
| 5185 Handle<JSObject> original_boilerplate_; | |
| 5180 int total_size_; | 5186 int total_size_; |
| 5181 }; | 5187 }; |
| 5182 | 5188 |
| 5183 | 5189 |
| 5184 class HArrayLiteral: public HMaterializedLiteral<1> { | 5190 class HArrayLiteral: public HMaterializedLiteral<1> { |
| 5185 public: | 5191 public: |
| 5186 HArrayLiteral(HValue* context, | 5192 HArrayLiteral(HValue* context, |
| 5187 Handle<HeapObject> boilerplate_object, | 5193 Handle<HeapObject> boilerplate_object, |
| 5188 int length, | 5194 int length, |
| 5189 int literal_index, | 5195 int literal_index, |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 5220 }; | 5226 }; |
| 5221 | 5227 |
| 5222 | 5228 |
| 5223 class HObjectLiteral: public HMaterializedLiteral<1> { | 5229 class HObjectLiteral: public HMaterializedLiteral<1> { |
| 5224 public: | 5230 public: |
| 5225 HObjectLiteral(HValue* context, | 5231 HObjectLiteral(HValue* context, |
| 5226 Handle<FixedArray> constant_properties, | 5232 Handle<FixedArray> constant_properties, |
| 5227 bool fast_elements, | 5233 bool fast_elements, |
| 5228 int literal_index, | 5234 int literal_index, |
| 5229 int depth, | 5235 int depth, |
| 5230 bool has_function) | 5236 bool has_function, |
| 5231 : HMaterializedLiteral<1>(literal_index, depth), | 5237 AllocationSiteMode mode) |
| 5238 : HMaterializedLiteral<1>(literal_index, depth, mode), | |
| 5232 constant_properties_(constant_properties), | 5239 constant_properties_(constant_properties), |
| 5233 fast_elements_(fast_elements), | 5240 fast_elements_(fast_elements), |
| 5234 has_function_(has_function) { | 5241 has_function_(has_function) { |
| 5235 SetOperandAt(0, context); | 5242 SetOperandAt(0, context); |
| 5236 SetGVNFlag(kChangesNewSpacePromotion); | 5243 SetGVNFlag(kChangesNewSpacePromotion); |
| 5237 } | 5244 } |
| 5238 | 5245 |
| 5239 HValue* context() { return OperandAt(0); } | 5246 HValue* context() { return OperandAt(0); } |
| 5240 Handle<FixedArray> constant_properties() const { | 5247 Handle<FixedArray> constant_properties() const { |
| 5241 return constant_properties_; | 5248 return constant_properties_; |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5609 virtual bool IsDeletable() const { return true; } | 5616 virtual bool IsDeletable() const { return true; } |
| 5610 }; | 5617 }; |
| 5611 | 5618 |
| 5612 | 5619 |
| 5613 #undef DECLARE_INSTRUCTION | 5620 #undef DECLARE_INSTRUCTION |
| 5614 #undef DECLARE_CONCRETE_INSTRUCTION | 5621 #undef DECLARE_CONCRETE_INSTRUCTION |
| 5615 | 5622 |
| 5616 } } // namespace v8::internal | 5623 } } // namespace v8::internal |
| 5617 | 5624 |
| 5618 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 5625 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |