| 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 10090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10101 Handle<JSObject> original_boilerplate_object, | 10101 Handle<JSObject> original_boilerplate_object, |
| 10102 int data_size, | 10102 int data_size, |
| 10103 int pointer_size, | 10103 int pointer_size, |
| 10104 AllocationSiteMode mode, | 10104 AllocationSiteMode mode, |
| 10105 BailoutId id) { | 10105 BailoutId id) { |
| 10106 Zone* zone = this->zone(); | 10106 Zone* zone = this->zone(); |
| 10107 int total_size = data_size + pointer_size; | 10107 int total_size = data_size + pointer_size; |
| 10108 | 10108 |
| 10109 NoObservableSideEffectsScope no_effects(this); | 10109 NoObservableSideEffectsScope no_effects(this); |
| 10110 | 10110 |
| 10111 HAllocate::Flags flags = HAllocate::CAN_ALLOCATE_IN_NEW_SPACE; |
| 10112 // TODO(hpayer): add support for old data space |
| 10113 if (FLAG_pretenure_literals && |
| 10114 isolate()->heap()->ShouldGloballyPretenure() && |
| 10115 data_size == 0) { |
| 10116 flags = static_cast<HAllocate::Flags>( |
| 10117 flags | HAllocate::CAN_ALLOCATE_IN_OLD_POINTER_SPACE); |
| 10118 } |
| 10119 |
| 10111 HValue* size_in_bytes = | 10120 HValue* size_in_bytes = |
| 10112 AddInstruction(new(zone) HConstant(total_size, | 10121 AddInstruction(new(zone) HConstant(total_size, |
| 10113 Representation::Integer32())); | 10122 Representation::Integer32())); |
| 10114 HInstruction* result = | 10123 HInstruction* result = |
| 10115 AddInstruction(new(zone) HAllocate(context, | 10124 AddInstruction(new(zone) HAllocate(context, |
| 10116 size_in_bytes, | 10125 size_in_bytes, |
| 10117 HType::JSObject(), | 10126 HType::JSObject(), |
| 10118 HAllocate::CAN_ALLOCATE_IN_NEW_SPACE)); | 10127 flags)); |
| 10119 int offset = 0; | 10128 int offset = 0; |
| 10120 BuildEmitDeepCopy(boilerplate_object, original_boilerplate_object, result, | 10129 BuildEmitDeepCopy(boilerplate_object, original_boilerplate_object, result, |
| 10121 &offset, mode, id); | 10130 &offset, mode, id); |
| 10122 ASSERT_EQ(total_size, offset); | 10131 ASSERT_EQ(total_size, offset); |
| 10123 return result; | 10132 return result; |
| 10124 } | 10133 } |
| 10125 | 10134 |
| 10126 | 10135 |
| 10127 void HOptimizedGraphBuilder::BuildEmitDeepCopy( | 10136 void HOptimizedGraphBuilder::BuildEmitDeepCopy( |
| 10128 Handle<JSObject> boilerplate_object, | 10137 Handle<JSObject> boilerplate_object, |
| (...skipping 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11667 } | 11676 } |
| 11668 } | 11677 } |
| 11669 | 11678 |
| 11670 #ifdef DEBUG | 11679 #ifdef DEBUG |
| 11671 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 11680 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
| 11672 if (allocator_ != NULL) allocator_->Verify(); | 11681 if (allocator_ != NULL) allocator_->Verify(); |
| 11673 #endif | 11682 #endif |
| 11674 } | 11683 } |
| 11675 | 11684 |
| 11676 } } // namespace v8::internal | 11685 } } // namespace v8::internal |
| OLD | NEW |