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

Side by Side Diff: src/lithium-codegen.cc

Issue 222263002: Fix approximation of CanDeoptimize() and other small store elimination fixes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased Created 6 years, 8 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
« no previous file with comments | « src/hydrogen-store-elimination.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 GenerateBodyInstructionPost(instr); 117 GenerateBodyInstructionPost(instr);
118 } 118 }
119 EnsureSpaceForLazyDeopt(Deoptimizer::patch_size()); 119 EnsureSpaceForLazyDeopt(Deoptimizer::patch_size());
120 last_lazy_deopt_pc_ = masm()->pc_offset(); 120 last_lazy_deopt_pc_ = masm()->pc_offset();
121 return !is_aborted(); 121 return !is_aborted();
122 } 122 }
123 123
124 124
125 void LCodeGenBase::CheckEnvironmentUsage() { 125 void LCodeGenBase::CheckEnvironmentUsage() {
126 #ifdef DEBUG 126 #ifdef DEBUG
127 bool live_block = true; 127 bool dead_block = false;
128 for (int i = 0; i < instructions_->length(); i++) { 128 for (int i = 0; i < instructions_->length(); i++) {
129 LInstruction* instr = instructions_->at(i); 129 LInstruction* instr = instructions_->at(i);
130 if (instr->IsLabel()) live_block = !LLabel::cast(instr)->HasReplacement(); 130 HValue* hval = instr->hydrogen_value();
131 if (live_block && 131 if (instr->IsLabel()) dead_block = LLabel::cast(instr)->HasReplacement();
132 instr->hydrogen_value()->block()->IsReachable() && 132 if (dead_block || !hval->block()->IsReachable()) continue;
133 instr->HasEnvironment() && 133
134 !instr->environment()->has_been_used()) { 134 HInstruction* hinstr = HInstruction::cast(hval);
135 FunctionLiteral* lit = info_->function(); 135 if (!hinstr->CanDeoptimize() && instr->HasEnvironment()) {
136 V8_Fatal(__FILE__, __LINE__, "unused environment in %s <@%d,#%d> %s\n", 136 V8_Fatal(__FILE__, __LINE__, "CanDeoptimize is wrong for %s (%s)\n",
137 lit == NULL ? "<UNKNOWN>" : lit->name()->ToCString().get(), 137 hinstr->Mnemonic(), instr->Mnemonic());
138 i, instr->hydrogen_value()->id(), instr->Mnemonic()); 138 }
139
140 if (instr->HasEnvironment() && !instr->environment()->has_been_used()) {
141 V8_Fatal(__FILE__, __LINE__, "unused environment for %s (%s)\n",
142 hinstr->Mnemonic(), instr->Mnemonic());
139 } 143 }
140 } 144 }
141 #endif 145 #endif
142 } 146 }
143 147
144 148
145 void LCodeGenBase::Comment(const char* format, ...) { 149 void LCodeGenBase::Comment(const char* format, ...) {
146 if (!FLAG_code_comments) return; 150 if (!FLAG_code_comments) return;
147 char buffer[4 * KB]; 151 char buffer[4 * KB];
148 StringBuilder builder(buffer, ARRAY_SIZE(buffer)); 152 StringBuilder builder(buffer, ARRAY_SIZE(buffer));
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 for (int i = 0; i < objects.length(); i++) { 212 for (int i = 0; i < objects.length(); i++) {
209 AddWeakObjectToCodeDependency(isolate()->heap(), objects.at(i), code); 213 AddWeakObjectToCodeDependency(isolate()->heap(), objects.at(i), code);
210 } 214 }
211 for (int i = 0; i < cells.length(); i++) { 215 for (int i = 0; i < cells.length(); i++) {
212 AddWeakObjectToCodeDependency(isolate()->heap(), cells.at(i), code); 216 AddWeakObjectToCodeDependency(isolate()->heap(), cells.at(i), code);
213 } 217 }
214 } 218 }
215 219
216 220
217 } } // namespace v8::internal 221 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen-store-elimination.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698