Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
| 9 #include "src/cpu-profiler.h" | 9 #include "src/cpu-profiler.h" |
| 10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 407 DeoptimizationInputData* deopt_data = | 407 DeoptimizationInputData* deopt_data = |
| 408 DeoptimizationInputData::cast(codes[i]->deoptimization_data()); | 408 DeoptimizationInputData::cast(codes[i]->deoptimization_data()); |
| 409 SharedFunctionInfo* shared = | 409 SharedFunctionInfo* shared = |
| 410 SharedFunctionInfo::cast(deopt_data->SharedFunctionInfo()); | 410 SharedFunctionInfo::cast(deopt_data->SharedFunctionInfo()); |
| 411 shared->EvictFromOptimizedCodeMap(codes[i], "deoptimized code"); | 411 shared->EvictFromOptimizedCodeMap(codes[i], "deoptimized code"); |
| 412 | 412 |
| 413 // Do platform-specific patching to force any activations to lazy deopt. | 413 // Do platform-specific patching to force any activations to lazy deopt. |
| 414 PatchCodeForDeoptimization(isolate, codes[i]); | 414 PatchCodeForDeoptimization(isolate, codes[i]); |
| 415 | 415 |
| 416 // We might be in the middle of incremental marking with compaction. | 416 // We might be in the middle of incremental marking with compaction. |
| 417 // Ignore all slots that might have been recorded on the deoptimized code | 417 // Ignore all slots that might have been recorded in the body of the |
| 418 // object. | 418 // deoptimized code object. |
| 419 isolate->heap()->mark_compact_collector()->RemoveObjectSlots(codes[i]); | 419 Code* code = codes[i]; |
| 420 isolate->heap()->mark_compact_collector()->RemoveObjectSlots( | |
| 421 code->address() + Code::kHeaderSize, code->address() + code->Size()); | |
|
Michael Starzinger
2015/07/03 11:24:55
nit: We could use Code::instruction_start() here.
Hannes Payer (out of office)
2015/07/03 11:26:53
Done.
| |
| 420 } | 422 } |
| 421 } | 423 } |
| 422 | 424 |
| 423 | 425 |
| 424 void Deoptimizer::DeoptimizeAll(Isolate* isolate) { | 426 void Deoptimizer::DeoptimizeAll(Isolate* isolate) { |
| 425 if (FLAG_trace_deopt) { | 427 if (FLAG_trace_deopt) { |
| 426 CodeTracer::Scope scope(isolate->GetCodeTracer()); | 428 CodeTracer::Scope scope(isolate->GetCodeTracer()); |
| 427 PrintF(scope.file(), "[deoptimize all code in all contexts]\n"); | 429 PrintF(scope.file(), "[deoptimize all code in all contexts]\n"); |
| 428 } | 430 } |
| 429 DisallowHeapAllocation no_allocation; | 431 DisallowHeapAllocation no_allocation; |
| (...skipping 2941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3371 DCHECK(value_info->IsMaterializedObject()); | 3373 DCHECK(value_info->IsMaterializedObject()); |
| 3372 | 3374 |
| 3373 value_info->value_ = | 3375 value_info->value_ = |
| 3374 Handle<Object>(previously_materialized_objects->get(i), isolate_); | 3376 Handle<Object>(previously_materialized_objects->get(i), isolate_); |
| 3375 } | 3377 } |
| 3376 } | 3378 } |
| 3377 } | 3379 } |
| 3378 | 3380 |
| 3379 } // namespace internal | 3381 } // namespace internal |
| 3380 } // namespace v8 | 3382 } // namespace v8 |
| OLD | NEW |