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 1373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1384 | 1384 |
1385 HConstant* header_size = | 1385 HConstant* header_size = |
1386 new(zone) HConstant(FixedArray::kHeaderSize, Representation::Integer32()); | 1386 new(zone) HConstant(FixedArray::kHeaderSize, Representation::Integer32()); |
1387 AddInstruction(header_size); | 1387 AddInstruction(header_size); |
1388 HValue* total_size = AddInstruction( | 1388 HValue* total_size = AddInstruction( |
1389 HAdd::New(zone, context, mul, header_size)); | 1389 HAdd::New(zone, context, mul, header_size)); |
1390 total_size->AssumeRepresentation(Representation::Integer32()); | 1390 total_size->AssumeRepresentation(Representation::Integer32()); |
1391 total_size->ClearFlag(HValue::kCanOverflow); | 1391 total_size->ClearFlag(HValue::kCanOverflow); |
1392 | 1392 |
1393 HAllocate::Flags flags = HAllocate::DefaultFlags(kind); | 1393 HAllocate::Flags flags = HAllocate::DefaultFlags(kind); |
1394 if (FLAG_pretenure_literals) { | 1394 if (isolate()->heap()->ShouldGloballyPretenure()) { |
1395 // TODO(hpayer): When pretenuring can be internalized, flags can become | 1395 // TODO(hpayer): When pretenuring can be internalized, flags can become |
1396 // private to HAllocate. | 1396 // private to HAllocate. |
1397 if (IsFastDoubleElementsKind(kind)) { | 1397 if (IsFastDoubleElementsKind(kind)) { |
1398 flags = static_cast<HAllocate::Flags>( | 1398 flags = static_cast<HAllocate::Flags>( |
1399 flags | HAllocate::CAN_ALLOCATE_IN_OLD_DATA_SPACE); | 1399 flags | HAllocate::CAN_ALLOCATE_IN_OLD_DATA_SPACE); |
1400 } else { | 1400 } else { |
1401 flags = static_cast<HAllocate::Flags>( | 1401 flags = static_cast<HAllocate::Flags>( |
1402 flags | HAllocate::CAN_ALLOCATE_IN_OLD_POINTER_SPACE); | 1402 flags | HAllocate::CAN_ALLOCATE_IN_OLD_POINTER_SPACE); |
1403 } | 1403 } |
1404 } | 1404 } |
(...skipping 9455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10860 int data_size, | 10860 int data_size, |
10861 int pointer_size, | 10861 int pointer_size, |
10862 AllocationSiteMode mode) { | 10862 AllocationSiteMode mode) { |
10863 Zone* zone = this->zone(); | 10863 Zone* zone = this->zone(); |
10864 int total_size = data_size + pointer_size; | 10864 int total_size = data_size + pointer_size; |
10865 | 10865 |
10866 NoObservableSideEffectsScope no_effects(this); | 10866 NoObservableSideEffectsScope no_effects(this); |
10867 | 10867 |
10868 HAllocate::Flags flags = HAllocate::CAN_ALLOCATE_IN_NEW_SPACE; | 10868 HAllocate::Flags flags = HAllocate::CAN_ALLOCATE_IN_NEW_SPACE; |
10869 // TODO(hpayer): add support for old data space | 10869 // TODO(hpayer): add support for old data space |
10870 if (FLAG_pretenure_literals && | 10870 if (isolate()->heap()->ShouldGloballyPretenure() && |
10871 isolate()->heap()->ShouldGloballyPretenure() && | |
10872 data_size == 0) { | 10871 data_size == 0) { |
10873 flags = static_cast<HAllocate::Flags>( | 10872 flags = static_cast<HAllocate::Flags>( |
10874 flags | HAllocate::CAN_ALLOCATE_IN_OLD_POINTER_SPACE); | 10873 flags | HAllocate::CAN_ALLOCATE_IN_OLD_POINTER_SPACE); |
10875 } | 10874 } |
10876 | 10875 |
10877 HValue* size_in_bytes = | 10876 HValue* size_in_bytes = |
10878 AddInstruction(new(zone) HConstant(total_size, | 10877 AddInstruction(new(zone) HConstant(total_size, |
10879 Representation::Integer32())); | 10878 Representation::Integer32())); |
10880 HInstruction* result = | 10879 HInstruction* result = |
10881 AddInstruction(new(zone) HAllocate(context, | 10880 AddInstruction(new(zone) HAllocate(context, |
(...skipping 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12471 } | 12470 } |
12472 } | 12471 } |
12473 | 12472 |
12474 #ifdef DEBUG | 12473 #ifdef DEBUG |
12475 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 12474 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
12476 if (allocator_ != NULL) allocator_->Verify(); | 12475 if (allocator_ != NULL) allocator_->Verify(); |
12477 #endif | 12476 #endif |
12478 } | 12477 } |
12479 | 12478 |
12480 } } // namespace v8::internal | 12479 } } // namespace v8::internal |
OLD | NEW |