| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "v8.h" | 5 #include "v8.h" |
| 6 | 6 |
| 7 #include "compiler.h" | 7 #include "compiler.h" |
| 8 | 8 |
| 9 #include "bootstrapper.h" | 9 #include "bootstrapper.h" |
| 10 #include "codegen.h" | 10 #include "codegen.h" |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 ASSERT(graph_ != NULL); | 449 ASSERT(graph_ != NULL); |
| 450 // Deferred handles reference objects that were accessible during | 450 // Deferred handles reference objects that were accessible during |
| 451 // graph creation. To make sure that we don't encounter inconsistencies | 451 // graph creation. To make sure that we don't encounter inconsistencies |
| 452 // between graph creation and code generation, we disallow accessing | 452 // between graph creation and code generation, we disallow accessing |
| 453 // objects through deferred handles during the latter, with exceptions. | 453 // objects through deferred handles during the latter, with exceptions. |
| 454 DisallowDeferredHandleDereference no_deferred_handle_deref; | 454 DisallowDeferredHandleDereference no_deferred_handle_deref; |
| 455 Handle<Code> optimized_code = chunk_->Codegen(); | 455 Handle<Code> optimized_code = chunk_->Codegen(); |
| 456 if (optimized_code.is_null()) { | 456 if (optimized_code.is_null()) { |
| 457 if (info()->bailout_reason() == kNoReason) { | 457 if (info()->bailout_reason() == kNoReason) { |
| 458 info_->set_bailout_reason(kCodeGenerationFailed); | 458 info_->set_bailout_reason(kCodeGenerationFailed); |
| 459 } else if (info()->bailout_reason() == kMapBecameUnstable) { |
| 460 return AbortOptimization(); |
| 459 } | 461 } |
| 460 return AbortAndDisableOptimization(); | 462 return AbortAndDisableOptimization(); |
| 461 } | 463 } |
| 462 info()->SetCode(optimized_code); | 464 info()->SetCode(optimized_code); |
| 463 } | 465 } |
| 464 RecordOptimizationStats(); | 466 RecordOptimizationStats(); |
| 465 // Add to the weak list of optimized code objects. | 467 // Add to the weak list of optimized code objects. |
| 466 info()->context()->native_context()->AddOptimizedCode(*info()->code()); | 468 info()->context()->native_context()->AddOptimizedCode(*info()->code()); |
| 467 return SetLastStatus(SUCCEEDED); | 469 return SetLastStatus(SUCCEEDED); |
| 468 } | 470 } |
| (...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1285 AllowHandleDereference allow_deref; | 1287 AllowHandleDereference allow_deref; |
| 1286 bool tracing_on = info()->IsStub() | 1288 bool tracing_on = info()->IsStub() |
| 1287 ? FLAG_trace_hydrogen_stubs | 1289 ? FLAG_trace_hydrogen_stubs |
| 1288 : (FLAG_trace_hydrogen && | 1290 : (FLAG_trace_hydrogen && |
| 1289 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1291 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
| 1290 return (tracing_on && | 1292 return (tracing_on && |
| 1291 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1293 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
| 1292 } | 1294 } |
| 1293 | 1295 |
| 1294 } } // namespace v8::internal | 1296 } } // namespace v8::internal |
| OLD | NEW |