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 8764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8775 // Calculate instance size from initial map of constructor. | 8775 // Calculate instance size from initial map of constructor. |
8776 ASSERT(constructor->has_initial_map()); | 8776 ASSERT(constructor->has_initial_map()); |
8777 Handle<Map> initial_map(constructor->initial_map()); | 8777 Handle<Map> initial_map(constructor->initial_map()); |
8778 int instance_size = initial_map->instance_size(); | 8778 int instance_size = initial_map->instance_size(); |
8779 ASSERT(initial_map->InitialPropertiesLength() == 0); | 8779 ASSERT(initial_map->InitialPropertiesLength() == 0); |
8780 | 8780 |
8781 // Allocate an instance of the implicit receiver object. | 8781 // Allocate an instance of the implicit receiver object. |
8782 HValue* size_in_bytes = | 8782 HValue* size_in_bytes = |
8783 AddInstruction(new(zone()) HConstant(instance_size, | 8783 AddInstruction(new(zone()) HConstant(instance_size, |
8784 Representation::Integer32())); | 8784 Representation::Integer32())); |
| 8785 |
| 8786 HAllocate::Flags flags = HAllocate::DefaultFlags(); |
| 8787 if (FLAG_pretenuring_call_new && |
| 8788 isolate()->heap()->ShouldGloballyPretenure()) { |
| 8789 flags = static_cast<HAllocate::Flags>( |
| 8790 flags | HAllocate::CAN_ALLOCATE_IN_OLD_POINTER_SPACE); |
| 8791 } |
| 8792 |
8785 HInstruction* receiver = | 8793 HInstruction* receiver = |
8786 AddInstruction(new(zone()) HAllocate(context, | 8794 AddInstruction(new(zone()) HAllocate(context, |
8787 size_in_bytes, | 8795 size_in_bytes, |
8788 HType::JSObject(), | 8796 HType::JSObject(), |
8789 HAllocate::DefaultFlags())); | 8797 flags)); |
8790 HAllocate::cast(receiver)->set_known_initial_map(initial_map); | 8798 HAllocate::cast(receiver)->set_known_initial_map(initial_map); |
8791 | 8799 |
8792 // Load the initial map from the constructor. | 8800 // Load the initial map from the constructor. |
8793 HValue* constructor_value = | 8801 HValue* constructor_value = |
8794 AddInstruction(new(zone()) HConstant(constructor, | 8802 AddInstruction(new(zone()) HConstant(constructor, |
8795 Representation::Tagged())); | 8803 Representation::Tagged())); |
8796 HValue* initial_map_value = | 8804 HValue* initial_map_value = |
8797 AddLoad(constructor_value, HObjectAccess::ForJSObjectOffset( | 8805 AddLoad(constructor_value, HObjectAccess::ForJSObjectOffset( |
8798 JSFunction::kPrototypeOrInitialMapOffset)); | 8806 JSFunction::kPrototypeOrInitialMapOffset)); |
8799 | 8807 |
(...skipping 2745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11545 } | 11553 } |
11546 } | 11554 } |
11547 | 11555 |
11548 #ifdef DEBUG | 11556 #ifdef DEBUG |
11549 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 11557 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
11550 if (allocator_ != NULL) allocator_->Verify(); | 11558 if (allocator_ != NULL) allocator_->Verify(); |
11551 #endif | 11559 #endif |
11552 } | 11560 } |
11553 | 11561 |
11554 } } // namespace v8::internal | 11562 } } // namespace v8::internal |
OLD | NEW |