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

Side by Side Diff: src/compiler.cc

Issue 6685052: Version 3.2.2. Fixed a number of crash and correctness bugs. Improved Cranksh... (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 9 years, 9 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/ast.cc ('k') | src/cpu-profiler.h » ('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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 // non-optimizable information for the code. When the code is 165 // non-optimizable information for the code. When the code is
166 // regenerated and set on the shared function info it is marked as 166 // regenerated and set on the shared function info it is marked as
167 // non-optimizable if optimization is disabled for the shared 167 // non-optimizable if optimization is disabled for the shared
168 // function info. 168 // function info.
169 Handle<SharedFunctionInfo> shared = info->shared_info(); 169 Handle<SharedFunctionInfo> shared = info->shared_info();
170 shared->set_optimization_disabled(true); 170 shared->set_optimization_disabled(true);
171 Handle<Code> code = Handle<Code>(shared->code()); 171 Handle<Code> code = Handle<Code>(shared->code());
172 ASSERT(code->kind() == Code::FUNCTION); 172 ASSERT(code->kind() == Code::FUNCTION);
173 code->set_optimizable(false); 173 code->set_optimizable(false);
174 info->SetCode(code); 174 info->SetCode(code);
175 CompilationCache::MarkForLazyOptimizing(info->closure());
175 if (FLAG_trace_opt) { 176 if (FLAG_trace_opt) {
176 PrintF("[disabled optimization for: "); 177 PrintF("[disabled optimization for: ");
177 info->closure()->PrintName(); 178 info->closure()->PrintName();
178 PrintF(" / %" V8PRIxPTR "]\n", 179 PrintF(" / %" V8PRIxPTR "]\n",
179 reinterpret_cast<intptr_t>(*info->closure())); 180 reinterpret_cast<intptr_t>(*info->closure()));
180 } 181 }
181 } 182 }
182 183
183 184
184 static bool MakeCrankshaftCode(CompilationInfo* info) { 185 static bool MakeCrankshaftCode(CompilationInfo* info) {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 info->SetCode(code); 242 info->SetCode(code);
242 return true; 243 return true;
243 } 244 }
244 245
245 // Recompile the unoptimized version of the code if the current version 246 // Recompile the unoptimized version of the code if the current version
246 // doesn't have deoptimization support. Alternatively, we may decide to 247 // doesn't have deoptimization support. Alternatively, we may decide to
247 // run the full code generator to get a baseline for the compile-time 248 // run the full code generator to get a baseline for the compile-time
248 // performance of the hydrogen-based compiler. 249 // performance of the hydrogen-based compiler.
249 int64_t start = OS::Ticks(); 250 int64_t start = OS::Ticks();
250 bool should_recompile = !info->shared_info()->has_deoptimization_support(); 251 bool should_recompile = !info->shared_info()->has_deoptimization_support();
251 if (should_recompile || FLAG_time_hydrogen) { 252 if (should_recompile || FLAG_hydrogen_stats) {
252 HPhase phase(HPhase::kFullCodeGen); 253 HPhase phase(HPhase::kFullCodeGen);
253 CompilationInfo unoptimized(info->shared_info()); 254 CompilationInfo unoptimized(info->shared_info());
254 // Note that we use the same AST that we will use for generating the 255 // Note that we use the same AST that we will use for generating the
255 // optimized code. 256 // optimized code.
256 unoptimized.SetFunction(info->function()); 257 unoptimized.SetFunction(info->function());
257 unoptimized.SetScope(info->scope()); 258 unoptimized.SetScope(info->scope());
258 if (should_recompile) unoptimized.EnableDeoptimizationSupport(); 259 if (should_recompile) unoptimized.EnableDeoptimizationSupport();
259 bool succeeded = FullCodeGenerator::MakeCode(&unoptimized); 260 bool succeeded = FullCodeGenerator::MakeCode(&unoptimized);
260 if (should_recompile) { 261 if (should_recompile) {
261 if (!succeeded) return false; 262 if (!succeeded) return false;
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 shared->DebugName())); 798 shared->DebugName()));
798 } 799 }
799 } 800 }
800 801
801 GDBJIT(AddCode(name, 802 GDBJIT(AddCode(name,
802 Handle<Script>(info->script()), 803 Handle<Script>(info->script()),
803 Handle<Code>(info->code()))); 804 Handle<Code>(info->code())));
804 } 805 }
805 806
806 } } // namespace v8::internal 807 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.cc ('k') | src/cpu-profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698