Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: src/hydrogen-instructions.h

Issue 1023443004: Version 4.3.48.1 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.3.48
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/store-buffer-inl.h ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ 5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_
6 #define V8_HYDROGEN_INSTRUCTIONS_H_ 6 #define V8_HYDROGEN_INSTRUCTIONS_H_
7 7
8 #include <cstring> 8 #include <cstring>
9 #include <iosfwd> 9 #include <iosfwd>
10 10
(...skipping 5491 matching lines...) Expand 10 before | Expand all | Expand 10 after
5502 } 5502 }
5503 5503
5504 void set_known_initial_map(Handle<Map> known_initial_map) { 5504 void set_known_initial_map(Handle<Map> known_initial_map) {
5505 known_initial_map_ = known_initial_map; 5505 known_initial_map_ = known_initial_map;
5506 } 5506 }
5507 5507
5508 bool IsNewSpaceAllocation() const { 5508 bool IsNewSpaceAllocation() const {
5509 return (flags_ & ALLOCATE_IN_NEW_SPACE) != 0; 5509 return (flags_ & ALLOCATE_IN_NEW_SPACE) != 0;
5510 } 5510 }
5511 5511
5512 bool IsOldSpaceAllocation() const { 5512 bool IsOldDataSpaceAllocation() const {
5513 return (flags_ & ALLOCATE_IN_OLD_SPACE) != 0; 5513 return (flags_ & ALLOCATE_IN_OLD_DATA_SPACE) != 0;
5514 }
5515
5516 bool IsOldPointerSpaceAllocation() const {
5517 return (flags_ & ALLOCATE_IN_OLD_POINTER_SPACE) != 0;
5514 } 5518 }
5515 5519
5516 bool MustAllocateDoubleAligned() const { 5520 bool MustAllocateDoubleAligned() const {
5517 return (flags_ & ALLOCATE_DOUBLE_ALIGNED) != 0; 5521 return (flags_ & ALLOCATE_DOUBLE_ALIGNED) != 0;
5518 } 5522 }
5519 5523
5520 bool MustPrefillWithFiller() const { 5524 bool MustPrefillWithFiller() const {
5521 return (flags_ & PREFILL_WITH_FILLER) != 0; 5525 return (flags_ & PREFILL_WITH_FILLER) != 0;
5522 } 5526 }
5523 5527
(...skipping 12 matching lines...) Expand all
5536 virtual bool HandleSideEffectDominator(GVNFlag side_effect, 5540 virtual bool HandleSideEffectDominator(GVNFlag side_effect,
5537 HValue* dominator) OVERRIDE; 5541 HValue* dominator) OVERRIDE;
5538 5542
5539 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT 5543 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
5540 5544
5541 DECLARE_CONCRETE_INSTRUCTION(Allocate) 5545 DECLARE_CONCRETE_INSTRUCTION(Allocate)
5542 5546
5543 private: 5547 private:
5544 enum Flags { 5548 enum Flags {
5545 ALLOCATE_IN_NEW_SPACE = 1 << 0, 5549 ALLOCATE_IN_NEW_SPACE = 1 << 0,
5546 ALLOCATE_IN_OLD_SPACE = 1 << 2, 5550 ALLOCATE_IN_OLD_DATA_SPACE = 1 << 1,
5551 ALLOCATE_IN_OLD_POINTER_SPACE = 1 << 2,
5547 ALLOCATE_DOUBLE_ALIGNED = 1 << 3, 5552 ALLOCATE_DOUBLE_ALIGNED = 1 << 3,
5548 PREFILL_WITH_FILLER = 1 << 4, 5553 PREFILL_WITH_FILLER = 1 << 4,
5549 CLEAR_NEXT_MAP_WORD = 1 << 5 5554 CLEAR_NEXT_MAP_WORD = 1 << 5
5550 }; 5555 };
5551 5556
5552 HAllocate(HValue* context, 5557 HAllocate(HValue* context,
5553 HValue* size, 5558 HValue* size,
5554 HType type, 5559 HType type,
5555 PretenureFlag pretenure_flag, 5560 PretenureFlag pretenure_flag,
5556 InstanceType instance_type, 5561 InstanceType instance_type,
(...skipping 15 matching lines...) Expand all
5572 PrintF("HAllocate with AllocationSite %p %s\n", 5577 PrintF("HAllocate with AllocationSite %p %s\n",
5573 allocation_site.is_null() 5578 allocation_site.is_null()
5574 ? static_cast<void*>(NULL) 5579 ? static_cast<void*>(NULL)
5575 : static_cast<void*>(*allocation_site), 5580 : static_cast<void*>(*allocation_site),
5576 pretenure_flag == TENURED ? "tenured" : "not tenured"); 5581 pretenure_flag == TENURED ? "tenured" : "not tenured");
5577 } 5582 }
5578 } 5583 }
5579 5584
5580 static Flags ComputeFlags(PretenureFlag pretenure_flag, 5585 static Flags ComputeFlags(PretenureFlag pretenure_flag,
5581 InstanceType instance_type) { 5586 InstanceType instance_type) {
5582 Flags flags = pretenure_flag == TENURED ? ALLOCATE_IN_OLD_SPACE 5587 Flags flags = pretenure_flag == TENURED
5583 : ALLOCATE_IN_NEW_SPACE; 5588 ? (Heap::TargetSpaceId(instance_type) == OLD_POINTER_SPACE
5589 ? ALLOCATE_IN_OLD_POINTER_SPACE
5590 : ALLOCATE_IN_OLD_DATA_SPACE)
5591 : ALLOCATE_IN_NEW_SPACE;
5584 if (instance_type == FIXED_DOUBLE_ARRAY_TYPE) { 5592 if (instance_type == FIXED_DOUBLE_ARRAY_TYPE) {
5585 flags = static_cast<Flags>(flags | ALLOCATE_DOUBLE_ALIGNED); 5593 flags = static_cast<Flags>(flags | ALLOCATE_DOUBLE_ALIGNED);
5586 } 5594 }
5587 // We have to fill the allocated object with one word fillers if we do 5595 // We have to fill the allocated object with one word fillers if we do
5588 // not use allocation folding since some allocations may depend on each 5596 // not use allocation folding since some allocations may depend on each
5589 // other, i.e., have a pointer to each other. A GC in between these 5597 // other, i.e., have a pointer to each other. A GC in between these
5590 // allocations may leave such objects behind in a not completely initialized 5598 // allocations may leave such objects behind in a not completely initialized
5591 // state. 5599 // state.
5592 if (!FLAG_use_gvn || !FLAG_use_allocation_folding) { 5600 if (!FLAG_use_gvn || !FLAG_use_allocation_folding) {
5593 flags = static_cast<Flags>(flags | PREFILL_WITH_FILLER); 5601 flags = static_cast<Flags>(flags | PREFILL_WITH_FILLER);
(...skipping 21 matching lines...) Expand all
5615 } 5623 }
5616 5624
5617 HAllocate* GetFoldableDominator(HAllocate* dominator); 5625 HAllocate* GetFoldableDominator(HAllocate* dominator);
5618 5626
5619 void UpdateFreeSpaceFiller(int32_t filler_size); 5627 void UpdateFreeSpaceFiller(int32_t filler_size);
5620 5628
5621 void CreateFreeSpaceFiller(int32_t filler_size); 5629 void CreateFreeSpaceFiller(int32_t filler_size);
5622 5630
5623 bool IsFoldable(HAllocate* allocate) { 5631 bool IsFoldable(HAllocate* allocate) {
5624 return (IsNewSpaceAllocation() && allocate->IsNewSpaceAllocation()) || 5632 return (IsNewSpaceAllocation() && allocate->IsNewSpaceAllocation()) ||
5625 (IsOldSpaceAllocation() && allocate->IsOldSpaceAllocation()); 5633 (IsOldDataSpaceAllocation() &&
5634 allocate->IsOldDataSpaceAllocation()) ||
5635 (IsOldPointerSpaceAllocation() &&
5636 allocate->IsOldPointerSpaceAllocation());
5626 } 5637 }
5627 5638
5628 void ClearNextMapWord(int offset); 5639 void ClearNextMapWord(int offset);
5629 5640
5630 Flags flags_; 5641 Flags flags_;
5631 Handle<Map> known_initial_map_; 5642 Handle<Map> known_initial_map_;
5632 HAllocate* dominating_allocate_; 5643 HAllocate* dominating_allocate_;
5633 HStoreNamedField* filler_free_space_size_; 5644 HStoreNamedField* filler_free_space_size_;
5634 HConstant* size_upper_bound_; 5645 HConstant* size_upper_bound_;
5635 }; 5646 };
(...skipping 2240 matching lines...) Expand 10 before | Expand all | Expand 10 after
7876 }; 7887 };
7877 7888
7878 7889
7879 7890
7880 #undef DECLARE_INSTRUCTION 7891 #undef DECLARE_INSTRUCTION
7881 #undef DECLARE_CONCRETE_INSTRUCTION 7892 #undef DECLARE_CONCRETE_INSTRUCTION
7882 7893
7883 } } // namespace v8::internal 7894 } } // namespace v8::internal
7884 7895
7885 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7896 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/heap/store-buffer-inl.h ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698