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

Side by Side Diff: src/compiler.cc

Issue 23064003: Expect and check for dependency change during code generation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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 | « no previous file | 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 return SetLastStatus(BAILED_OUT); 476 return SetLastStatus(BAILED_OUT);
477 } 477 }
478 } 478 }
479 return SetLastStatus(SUCCEEDED); 479 return SetLastStatus(SUCCEEDED);
480 } 480 }
481 481
482 482
483 OptimizingCompiler::Status OptimizingCompiler::GenerateAndInstallCode() { 483 OptimizingCompiler::Status OptimizingCompiler::GenerateAndInstallCode() {
484 ASSERT(last_status() == SUCCEEDED); 484 ASSERT(last_status() == SUCCEEDED);
485 ASSERT(!info()->HasAbortedDueToDependencyChange()); 485 ASSERT(!info()->HasAbortedDueToDependencyChange());
486 DisallowCodeDependencyChange no_dependency_change;
487 { // Scope for timer. 486 { // Scope for timer.
488 Timer timer(this, &time_taken_to_codegen_); 487 Timer timer(this, &time_taken_to_codegen_);
489 ASSERT(chunk_ != NULL); 488 ASSERT(chunk_ != NULL);
490 ASSERT(graph_ != NULL); 489 ASSERT(graph_ != NULL);
491 // Deferred handles reference objects that were accessible during 490 // Deferred handles reference objects that were accessible during
492 // graph creation. To make sure that we don't encounter inconsistencies 491 // graph creation. To make sure that we don't encounter inconsistencies
493 // between graph creation and code generation, we disallow accessing 492 // between graph creation and code generation, we disallow accessing
494 // objects through deferred handles during the latter, with exceptions. 493 // objects through deferred handles during the latter, with exceptions.
495 DisallowDeferredHandleDereference no_deferred_handle_deref; 494 DisallowDeferredHandleDereference no_deferred_handle_deref;
496 Handle<Code> optimized_code = chunk_->Codegen(); 495 Handle<Code> optimized_code = chunk_->Codegen();
497 if (optimized_code.is_null()) { 496 if (optimized_code.is_null()) {
498 if (info()->bailout_reason() == kNoReason) { 497 if (info()->bailout_reason() == kNoReason) {
499 info()->set_bailout_reason(kCodeGenerationFailed); 498 info()->set_bailout_reason(kCodeGenerationFailed);
500 } 499 }
501 return AbortOptimization(); 500 return AbortOptimization();
502 } 501 }
502 if (info()->HasAbortedDueToDependencyChange()) {
503 info_->set_bailout_reason(kBailedOutDueToDependencyChange);
504 info_->AbortOptimization();
505 return SetLastStatus(BAILED_OUT);
506 }
503 info()->SetCode(optimized_code); 507 info()->SetCode(optimized_code);
504 } 508 }
505 RecordOptimizationStats(); 509 RecordOptimizationStats();
506 return SetLastStatus(SUCCEEDED); 510 return SetLastStatus(SUCCEEDED);
507 } 511 }
508 512
509 513
510 static bool GenerateCode(CompilationInfo* info) { 514 static bool GenerateCode(CompilationInfo* info) {
511 bool is_optimizing = V8::UseCrankshaft() && 515 bool is_optimizing = V8::UseCrankshaft() &&
512 !info->IsCompilingForDebugging() && 516 !info->IsCompilingForDebugging() &&
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 // Trace if the appropriate trace flag is set and the phase name's first 1270 // Trace if the appropriate trace flag is set and the phase name's first
1267 // character is in the FLAG_trace_phase command line parameter. 1271 // character is in the FLAG_trace_phase command line parameter.
1268 bool tracing_on = info()->IsStub() ? 1272 bool tracing_on = info()->IsStub() ?
1269 FLAG_trace_hydrogen_stubs : 1273 FLAG_trace_hydrogen_stubs :
1270 FLAG_trace_hydrogen; 1274 FLAG_trace_hydrogen;
1271 return (tracing_on && 1275 return (tracing_on &&
1272 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); 1276 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL);
1273 } 1277 }
1274 1278
1275 } } // namespace v8::internal 1279 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698