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

Side by Side Diff: src/hydrogen.cc

Issue 18596005: Allocation folding integrated into the GVN phase. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 } \ 656 } \
657 return constant_##name##_.get(); \ 657 return constant_##name##_.get(); \
658 } 658 }
659 659
660 660
661 DEFINE_GET_CONSTANT(True, true, HType::Boolean(), true) 661 DEFINE_GET_CONSTANT(True, true, HType::Boolean(), true)
662 DEFINE_GET_CONSTANT(False, false, HType::Boolean(), false) 662 DEFINE_GET_CONSTANT(False, false, HType::Boolean(), false)
663 DEFINE_GET_CONSTANT(Hole, the_hole, HType::Tagged(), false) 663 DEFINE_GET_CONSTANT(Hole, the_hole, HType::Tagged(), false)
664 DEFINE_GET_CONSTANT(Null, null, HType::Tagged(), false) 664 DEFINE_GET_CONSTANT(Null, null, HType::Tagged(), false)
665 665
666 HConstant* HGraph::GetConstantFreeSpaceMap() {
667 if (!constant_free_space_map_.is_set()) {
668 HConstant* constant = new(zone()) HConstant(
669 isolate()->factory()->free_space_map(),
670 UniqueValueId(isolate()->heap()->free_space_map()),
671 Representation::None(),
672 HType::Tagged(),
673 false,
674 true,
675 false,
676 false);
677 constant->InsertAfter(GetConstantUndefined());
678 constant_free_space_map_.set(constant);
679 }
680 return constant_free_space_map_.get();
681 }
682
666 683
667 #undef DEFINE_GET_CONSTANT 684 #undef DEFINE_GET_CONSTANT
668 685
669 686
670 HConstant* HGraph::GetInvalidContext() { 687 HConstant* HGraph::GetInvalidContext() {
671 return GetConstant(&constant_invalid_context_, 0xFFFFC0C7); 688 return GetConstant(&constant_invalid_context_, 0xFFFFC0C7);
672 } 689 }
673 690
674 691
675 bool HGraph::IsStandardConstant(HConstant* constant) { 692 bool HGraph::IsStandardConstant(HConstant* constant) {
(...skipping 2757 matching lines...) Expand 10 before | Expand all | Expand 10 after
3433 bool HGraph::Optimize(SmartArrayPointer<char>* bailout_reason) { 3450 bool HGraph::Optimize(SmartArrayPointer<char>* bailout_reason) {
3434 *bailout_reason = SmartArrayPointer<char>(); 3451 *bailout_reason = SmartArrayPointer<char>();
3435 OrderBlocks(); 3452 OrderBlocks();
3436 AssignDominators(); 3453 AssignDominators();
3437 3454
3438 // We need to create a HConstant "zero" now so that GVN will fold every 3455 // We need to create a HConstant "zero" now so that GVN will fold every
3439 // zero-valued constant in the graph together. 3456 // zero-valued constant in the graph together.
3440 // The constant is needed to make idef-based bounds check work: the pass 3457 // The constant is needed to make idef-based bounds check work: the pass
3441 // evaluates relations with "zero" and that zero cannot be created after GVN. 3458 // evaluates relations with "zero" and that zero cannot be created after GVN.
3442 GetConstant0(); 3459 GetConstant0();
3460 GetConstantFreeSpaceMap();
3443 3461
3444 #ifdef DEBUG 3462 #ifdef DEBUG
3445 // Do a full verify after building the graph and computing dominators. 3463 // Do a full verify after building the graph and computing dominators.
3446 Verify(true); 3464 Verify(true);
3447 #endif 3465 #endif
3448 3466
3449 if (FLAG_analyze_environment_liveness && maximum_environment_size() != 0) { 3467 if (FLAG_analyze_environment_liveness && maximum_environment_size() != 0) {
3450 Run<HEnvironmentLivenessAnalysisPhase>(); 3468 Run<HEnvironmentLivenessAnalysisPhase>();
3451 } 3469 }
3452 3470
(...skipping 7384 matching lines...) Expand 10 before | Expand all | Expand 10 after
10837 if (ShouldProduceTraceOutput()) { 10855 if (ShouldProduceTraceOutput()) {
10838 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 10856 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
10839 } 10857 }
10840 10858
10841 #ifdef DEBUG 10859 #ifdef DEBUG
10842 graph_->Verify(false); // No full verify. 10860 graph_->Verify(false); // No full verify.
10843 #endif 10861 #endif
10844 } 10862 }
10845 10863
10846 } } // namespace v8::internal 10864 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-gvn.cc » ('j') | src/hydrogen-gvn.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698