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 in the body of the | 417 // Tell collector to treat this code object in a special way and |
418 // deoptimized code object. | 418 // ignore all slots that might have been recorded on it. |
419 Code* code = codes[i]; | 419 isolate->heap()->mark_compact_collector()->InvalidateCode(codes[i]); |
420 isolate->heap()->mark_compact_collector()->RemoveObjectSlots( | |
421 code->instruction_start(), code->address() + code->Size()); | |
422 } | 420 } |
423 } | 421 } |
424 | 422 |
425 | 423 |
426 void Deoptimizer::DeoptimizeAll(Isolate* isolate) { | 424 void Deoptimizer::DeoptimizeAll(Isolate* isolate) { |
427 if (FLAG_trace_deopt) { | 425 if (FLAG_trace_deopt) { |
428 CodeTracer::Scope scope(isolate->GetCodeTracer()); | 426 CodeTracer::Scope scope(isolate->GetCodeTracer()); |
429 PrintF(scope.file(), "[deoptimize all code in all contexts]\n"); | 427 PrintF(scope.file(), "[deoptimize all code in all contexts]\n"); |
430 } | 428 } |
431 DisallowHeapAllocation no_allocation; | 429 DisallowHeapAllocation no_allocation; |
(...skipping 2958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3390 DCHECK(value_info->IsMaterializedObject()); | 3388 DCHECK(value_info->IsMaterializedObject()); |
3391 | 3389 |
3392 value_info->value_ = | 3390 value_info->value_ = |
3393 Handle<Object>(previously_materialized_objects->get(i), isolate_); | 3391 Handle<Object>(previously_materialized_objects->get(i), isolate_); |
3394 } | 3392 } |
3395 } | 3393 } |
3396 } | 3394 } |
3397 | 3395 |
3398 } // namespace internal | 3396 } // namespace internal |
3399 } // namespace v8 | 3397 } // namespace v8 |
OLD | NEW |