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

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

Issue 61463005: Supported folding of constant size allocation followed by dynamic size allocation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Some refactoring and code cleanup. Created 7 years 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 | Annotate | Revision Log
OLDNEW
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 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1230 virtual int operand_position(int index) const V8_OVERRIDE { 1230 virtual int operand_position(int index) const V8_OVERRIDE {
1231 const int pos = position_.operand_position(index); 1231 const int pos = position_.operand_position(index);
1232 return (pos != RelocInfo::kNoPosition) ? pos : position(); 1232 return (pos != RelocInfo::kNoPosition) ? pos : position();
1233 } 1233 }
1234 void set_operand_position(Zone* zone, int index, int pos) { 1234 void set_operand_position(Zone* zone, int index, int pos) {
1235 ASSERT(0 <= index && index < OperandCount()); 1235 ASSERT(0 <= index && index < OperandCount());
1236 position_.ensure_storage_for_operand_positions(zone, OperandCount()); 1236 position_.ensure_storage_for_operand_positions(zone, OperandCount());
1237 position_.set_operand_position(index, pos); 1237 position_.set_operand_position(index, pos);
1238 } 1238 }
1239 1239
1240 bool Dominates(HInstruction* other);
1241
1240 bool CanTruncateToInt32() const { return CheckFlag(kTruncatingToInt32); } 1242 bool CanTruncateToInt32() const { return CheckFlag(kTruncatingToInt32); }
1241 1243
1242 virtual LInstruction* CompileToLithium(LChunkBuilder* builder) = 0; 1244 virtual LInstruction* CompileToLithium(LChunkBuilder* builder) = 0;
1243 1245
1244 #ifdef DEBUG 1246 #ifdef DEBUG
1245 virtual void Verify() V8_OVERRIDE; 1247 virtual void Verify() V8_OVERRIDE;
1246 #endif 1248 #endif
1247 1249
1248 virtual bool IsCall() { return false; } 1250 virtual bool IsCall() { return false; }
1249 1251
(...skipping 4193 matching lines...) Expand 10 before | Expand all | Expand 10 after
5443 return new(zone) HAllocate(context, size, type, pretenure_flag, 5445 return new(zone) HAllocate(context, size, type, pretenure_flag,
5444 instance_type); 5446 instance_type);
5445 } 5447 }
5446 5448
5447 // Maximum instance size for which allocations will be inlined. 5449 // Maximum instance size for which allocations will be inlined.
5448 static const int kMaxInlineSize = 64 * kPointerSize; 5450 static const int kMaxInlineSize = 64 * kPointerSize;
5449 5451
5450 HValue* context() { return OperandAt(0); } 5452 HValue* context() { return OperandAt(0); }
5451 HValue* size() { return OperandAt(1); } 5453 HValue* size() { return OperandAt(1); }
5452 5454
5455 HAllocate* wired_allocate() { return wired_allocate_; }
5456 void set_wired_allocate(HAllocate* alloc) { wired_allocate_ = alloc; }
5457
5453 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { 5458 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
5454 if (index == 0) { 5459 if (index == 0) {
5455 return Representation::Tagged(); 5460 return Representation::Tagged();
5456 } else { 5461 } else {
5457 return Representation::Integer32(); 5462 return Representation::Integer32();
5458 } 5463 }
5459 } 5464 }
5460 5465
5461 virtual Handle<Map> GetMonomorphicJSObjectMap() { 5466 virtual Handle<Map> GetMonomorphicJSObjectMap() {
5462 return known_initial_map_; 5467 return known_initial_map_;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
5510 PREFILL_WITH_FILLER = 1 << 4 5515 PREFILL_WITH_FILLER = 1 << 4
5511 }; 5516 };
5512 5517
5513 HAllocate(HValue* context, 5518 HAllocate(HValue* context,
5514 HValue* size, 5519 HValue* size,
5515 HType type, 5520 HType type,
5516 PretenureFlag pretenure_flag, 5521 PretenureFlag pretenure_flag,
5517 InstanceType instance_type) 5522 InstanceType instance_type)
5518 : HTemplateInstruction<2>(type), 5523 : HTemplateInstruction<2>(type),
5519 dominating_allocate_(NULL), 5524 dominating_allocate_(NULL),
5525 wired_allocate_(NULL),
5520 filler_free_space_size_(NULL), 5526 filler_free_space_size_(NULL),
5521 clear_next_map_word_(false) { 5527 clear_next_map_word_(false) {
5522 SetOperandAt(0, context); 5528 SetOperandAt(0, context);
5523 SetOperandAt(1, size); 5529 SetOperandAt(1, size);
5524 set_representation(Representation::Tagged()); 5530 set_representation(Representation::Tagged());
5525 SetFlag(kTrackSideEffectDominators); 5531 SetFlag(kTrackSideEffectDominators);
5526 SetGVNFlag(kChangesNewSpacePromotion); 5532 SetGVNFlag(kChangesNewSpacePromotion);
5527 SetGVNFlag(kDependsOnNewSpacePromotion); 5533 SetGVNFlag(kDependsOnNewSpacePromotion);
5528 flags_ = pretenure_flag == TENURED 5534 flags_ = pretenure_flag == TENURED
5529 ? (Heap::TargetSpaceId(instance_type) == OLD_POINTER_SPACE 5535 ? (Heap::TargetSpaceId(instance_type) == OLD_POINTER_SPACE
(...skipping 29 matching lines...) Expand all
5559 (IsOldDataSpaceAllocation() && allocate->IsOldDataSpaceAllocation()) || 5565 (IsOldDataSpaceAllocation() && allocate->IsOldDataSpaceAllocation()) ||
5560 (IsOldPointerSpaceAllocation() && 5566 (IsOldPointerSpaceAllocation() &&
5561 allocate->IsOldPointerSpaceAllocation()); 5567 allocate->IsOldPointerSpaceAllocation());
5562 } 5568 }
5563 5569
5564 void ClearNextMapWord(int offset); 5570 void ClearNextMapWord(int offset);
5565 5571
5566 Flags flags_; 5572 Flags flags_;
5567 Handle<Map> known_initial_map_; 5573 Handle<Map> known_initial_map_;
5568 HAllocate* dominating_allocate_; 5574 HAllocate* dominating_allocate_;
5575 // JSArray allocation will contain pointer to FixedArray allocation here.
5576 // Allocation folding will treat wired allocations differently.
5577 HAllocate* wired_allocate_;
5569 HStoreNamedField* filler_free_space_size_; 5578 HStoreNamedField* filler_free_space_size_;
5570 bool clear_next_map_word_; 5579 bool clear_next_map_word_;
5571 }; 5580 };
5572 5581
5573 5582
5574 class HStoreCodeEntry V8_FINAL: public HTemplateInstruction<2> { 5583 class HStoreCodeEntry V8_FINAL: public HTemplateInstruction<2> {
5575 public: 5584 public:
5576 static HStoreCodeEntry* New(Zone* zone, 5585 static HStoreCodeEntry* New(Zone* zone,
5577 HValue* context, 5586 HValue* context,
5578 HValue* function, 5587 HValue* function,
(...skipping 1894 matching lines...) Expand 10 before | Expand all | Expand 10 after
7473 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 7482 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
7474 }; 7483 };
7475 7484
7476 7485
7477 #undef DECLARE_INSTRUCTION 7486 #undef DECLARE_INSTRUCTION
7478 #undef DECLARE_CONCRETE_INSTRUCTION 7487 #undef DECLARE_CONCRETE_INSTRUCTION
7479 7488
7480 } } // namespace v8::internal 7489 } } // namespace v8::internal
7481 7490
7482 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7491 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | src/hydrogen-instructions.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698