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 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1236 void BuildNewSpaceArrayCheck(HValue* length, | 1236 void BuildNewSpaceArrayCheck(HValue* length, |
1237 ElementsKind kind); | 1237 ElementsKind kind); |
1238 | 1238 |
1239 class JSArrayBuilder { | 1239 class JSArrayBuilder { |
1240 public: | 1240 public: |
1241 JSArrayBuilder(HGraphBuilder* builder, | 1241 JSArrayBuilder(HGraphBuilder* builder, |
1242 ElementsKind kind, | 1242 ElementsKind kind, |
1243 HValue* allocation_site_payload, | 1243 HValue* allocation_site_payload, |
1244 AllocationSiteMode mode); | 1244 AllocationSiteMode mode); |
1245 | 1245 |
1246 JSArrayBuilder(HGraphBuilder* builder, | |
1247 ElementsKind kind, | |
1248 HValue* constructor_function); | |
1249 | |
1246 HValue* AllocateEmptyArray(); | 1250 HValue* AllocateEmptyArray(); |
1247 HValue* AllocateArray(HValue* capacity, HValue* length_field, | 1251 HValue* AllocateArray(HValue* capacity, HValue* length_field, |
1248 bool fill_with_hole); | 1252 bool fill_with_hole); |
1249 HValue* GetElementsLocation() { return elements_location_; } | 1253 HValue* GetElementsLocation() { return elements_location_; } |
1250 | 1254 |
1251 private: | 1255 private: |
1252 Zone* zone() const { return builder_->zone(); } | 1256 Zone* zone() const { return builder_->zone(); } |
1253 int elements_size() const { | 1257 int elements_size() const { |
1254 return IsFastDoubleElementsKind(kind_) ? kDoubleSize : kPointerSize; | 1258 return IsFastDoubleElementsKind(kind_) ? kDoubleSize : kPointerSize; |
1255 } | 1259 } |
1256 HInstruction* AddInstruction(HInstruction* instr) { | 1260 HInstruction* AddInstruction(HInstruction* instr) { |
1257 return builder_->AddInstruction(instr); | 1261 return builder_->AddInstruction(instr); |
1258 } | 1262 } |
1259 HGraphBuilder* builder() { return builder_; } | 1263 HGraphBuilder* builder() { return builder_; } |
1260 HGraph* graph() { return builder_->graph(); } | 1264 HGraph* graph() { return builder_->graph(); } |
1261 int initial_capacity() { | 1265 int initial_capacity() { |
1262 STATIC_ASSERT(JSArray::kPreallocatedArrayElements > 0); | 1266 STATIC_ASSERT(JSArray::kPreallocatedArrayElements > 0); |
1263 return JSArray::kPreallocatedArrayElements; | 1267 return JSArray::kPreallocatedArrayElements; |
1264 } | 1268 } |
1265 | 1269 |
1266 HValue* EmitMapCode(HValue* context); | 1270 HValue* EmitMapCode(HValue* context); |
1271 HValue* InternalEmitMapCode(); | |
Michael Starzinger
2013/05/23 09:16:49
nit: Can we call this "EmitInternalMapCode()", tha
mvstanton
2013/05/23 14:46:05
Done.
| |
1267 HValue* EstablishEmptyArrayAllocationSize(); | 1272 HValue* EstablishEmptyArrayAllocationSize(); |
1268 HValue* EstablishAllocationSize(HValue* length_node); | 1273 HValue* EstablishAllocationSize(HValue* length_node); |
1269 HValue* AllocateArray(HValue* size_in_bytes, HValue* capacity, | 1274 HValue* AllocateArray(HValue* size_in_bytes, HValue* capacity, |
1270 HValue* length_field, bool fill_with_hole); | 1275 HValue* length_field, bool fill_with_hole); |
1271 | 1276 |
1272 HGraphBuilder* builder_; | 1277 HGraphBuilder* builder_; |
1273 ElementsKind kind_; | 1278 ElementsKind kind_; |
1274 AllocationSiteMode mode_; | 1279 AllocationSiteMode mode_; |
1275 HValue* allocation_site_payload_; | 1280 HValue* allocation_site_payload_; |
1281 HValue* constructor_function_; | |
1276 HInnerAllocatedObject* elements_location_; | 1282 HInnerAllocatedObject* elements_location_; |
1277 }; | 1283 }; |
1278 | 1284 |
1279 HValue* BuildAllocateElements(HValue* context, | 1285 HValue* BuildAllocateElements(HValue* context, |
1280 ElementsKind kind, | 1286 ElementsKind kind, |
1281 HValue* capacity); | 1287 HValue* capacity); |
1282 | 1288 |
1283 void BuildInitializeElements(HValue* elements, | 1289 void BuildInitializeElements(HValue* elements, |
1284 ElementsKind kind, | 1290 ElementsKind kind, |
1285 HValue* capacity); | 1291 HValue* capacity); |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2025 EmbeddedVector<char, 64> filename_; | 2031 EmbeddedVector<char, 64> filename_; |
2026 HeapStringAllocator string_allocator_; | 2032 HeapStringAllocator string_allocator_; |
2027 StringStream trace_; | 2033 StringStream trace_; |
2028 int indent_; | 2034 int indent_; |
2029 }; | 2035 }; |
2030 | 2036 |
2031 | 2037 |
2032 } } // namespace v8::internal | 2038 } } // namespace v8::internal |
2033 | 2039 |
2034 #endif // V8_HYDROGEN_H_ | 2040 #endif // V8_HYDROGEN_H_ |
OLD | NEW |