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

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

Issue 218403006: Check that environments assigned via AssignEnvironment are actually used. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Simplified. 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/lithium-codegen.h ('k') | src/x64/lithium-codegen-x64.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 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 instr->CompileToNative(codegen); 115 instr->CompileToNative(codegen);
116 116
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() {
126 #ifdef DEBUG
127 bool live_block = true;
128 for (int i = 0; i < instructions_->length(); i++) {
129 LInstruction* instr = instructions_->at(i);
130 if (instr->IsLabel()) live_block = !LLabel::cast(instr)->HasReplacement();
131 if (live_block &&
132 instr->hydrogen_value()->block()->IsReachable() &&
133 instr->HasEnvironment() &&
134 !instr->environment()->has_been_used()) {
135 FunctionLiteral* lit = info_->function();
136 V8_Fatal(__FILE__, __LINE__, "unused environment in %s <@%d,#%d> %s\n",
137 lit == NULL ? "<UNKNOWN>" : lit->name()->ToCString().get(),
138 i, instr->hydrogen_value()->id(), instr->Mnemonic());
139 }
140 }
141 #endif
142 }
143
144
125 void LCodeGenBase::Comment(const char* format, ...) { 145 void LCodeGenBase::Comment(const char* format, ...) {
126 if (!FLAG_code_comments) return; 146 if (!FLAG_code_comments) return;
127 char buffer[4 * KB]; 147 char buffer[4 * KB];
128 StringBuilder builder(buffer, ARRAY_SIZE(buffer)); 148 StringBuilder builder(buffer, ARRAY_SIZE(buffer));
129 va_list arguments; 149 va_list arguments;
130 va_start(arguments, format); 150 va_start(arguments, format);
131 builder.AddFormattedList(format, arguments); 151 builder.AddFormattedList(format, arguments);
132 va_end(arguments); 152 va_end(arguments);
133 153
134 // Copy the string before recording it in the assembler to avoid 154 // Copy the string before recording it in the assembler to avoid
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 for (int i = 0; i < objects.length(); i++) { 208 for (int i = 0; i < objects.length(); i++) {
189 AddWeakObjectToCodeDependency(isolate()->heap(), objects.at(i), code); 209 AddWeakObjectToCodeDependency(isolate()->heap(), objects.at(i), code);
190 } 210 }
191 for (int i = 0; i < cells.length(); i++) { 211 for (int i = 0; i < cells.length(); i++) {
192 AddWeakObjectToCodeDependency(isolate()->heap(), cells.at(i), code); 212 AddWeakObjectToCodeDependency(isolate()->heap(), cells.at(i), code);
193 } 213 }
194 } 214 }
195 215
196 216
197 } } // namespace v8::internal 217 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/lithium-codegen.h ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698