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

Side by Side Diff: src/hydrogen-osr.cc

Issue 21340002: Generate a custom OSR entrypoint for OSR compiles on all platforms, and transition to optimized cod… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remerge with recent changes. Created 7 years, 3 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 builder_->set_current_block(osr_entry_); 73 builder_->set_current_block(osr_entry_);
74 osr_entry_->set_osr_entry(); 74 osr_entry_->set_osr_entry();
75 BailoutId osr_entry_id = statement->OsrEntryId(); 75 BailoutId osr_entry_id = statement->OsrEntryId();
76 76
77 HEnvironment *environment = builder_->environment(); 77 HEnvironment *environment = builder_->environment();
78 int first_expression_index = environment->first_expression_index(); 78 int first_expression_index = environment->first_expression_index();
79 int length = environment->length(); 79 int length = environment->length();
80 osr_values_ = new(zone) ZoneList<HUnknownOSRValue*>(length, zone); 80 osr_values_ = new(zone) ZoneList<HUnknownOSRValue*>(length, zone);
81 81
82 for (int i = 0; i < first_expression_index; ++i) { 82 for (int i = 0; i < first_expression_index; ++i) {
83 HUnknownOSRValue* osr_value = builder_->Add<HUnknownOSRValue>(); 83 HUnknownOSRValue* osr_value
84 = builder_->Add<HUnknownOSRValue>(environment, i);
84 environment->Bind(i, osr_value); 85 environment->Bind(i, osr_value);
85 osr_values_->Add(osr_value, zone); 86 osr_values_->Add(osr_value, zone);
86 } 87 }
87 88
88 if (first_expression_index != length) { 89 if (first_expression_index != length) {
89 environment->Drop(length - first_expression_index); 90 environment->Drop(length - first_expression_index);
90 for (int i = first_expression_index; i < length; ++i) { 91 for (int i = first_expression_index; i < length; ++i) {
91 HUnknownOSRValue* osr_value = builder_->Add<HUnknownOSRValue>(); 92 HUnknownOSRValue* osr_value
93 = builder_->Add<HUnknownOSRValue>(environment, i);
92 environment->Push(osr_value); 94 environment->Push(osr_value);
93 osr_values_->Add(osr_value, zone); 95 osr_values_->Add(osr_value, zone);
94 } 96 }
95 } 97 }
96 98
99 unoptimized_frame_slots_ =
100 environment->local_count() + environment->push_count();
101
102 // Keep a copy of the old environment, since the OSR values need it
103 // to figure out where exactly they are located in the unoptimized frame.
104 environment = environment->Copy();
105 builder_->current_block()->UpdateEnvironment(environment);
106
97 builder_->Add<HSimulate>(osr_entry_id); 107 builder_->Add<HSimulate>(osr_entry_id);
98 builder_->Add<HOsrEntry>(osr_entry_id); 108 builder_->Add<HOsrEntry>(osr_entry_id);
99 HContext* context = builder_->Add<HContext>(); 109 HContext* context = builder_->Add<HContext>();
100 environment->BindContext(context); 110 environment->BindContext(context);
101 builder_->current_block()->Goto(loop_predecessor); 111 builder_->current_block()->Goto(loop_predecessor);
102 loop_predecessor->SetJoinId(statement->EntryId()); 112 loop_predecessor->SetJoinId(statement->EntryId());
103 builder_->set_current_block(loop_predecessor); 113 builder_->set_current_block(loop_predecessor);
104 114
105 // Create the final loop entry 115 // Create the final loop entry
106 osr_loop_entry_ = BuildLoopEntry(); 116 osr_loop_entry_ = BuildLoopEntry();
(...skipping 10 matching lines...) Expand all
117 const ZoneList<HPhi*>* phis = osr_loop_entry_->phis(); 127 const ZoneList<HPhi*>* phis = osr_loop_entry_->phis();
118 for (int j = 0; j < phis->length(); j++) { 128 for (int j = 0; j < phis->length(); j++) {
119 HPhi* phi = phis->at(j); 129 HPhi* phi = phis->at(j);
120 if (phi->HasMergedIndex()) { 130 if (phi->HasMergedIndex()) {
121 osr_values_->at(phi->merged_index())->set_incoming_value(phi); 131 osr_values_->at(phi->merged_index())->set_incoming_value(phi);
122 } 132 }
123 } 133 }
124 } 134 }
125 135
126 } } // namespace v8::internal 136 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698