| 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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 ZoneList<Code*> codes(10, &zone); | 372 ZoneList<Code*> codes(10, &zone); |
| 373 | 373 |
| 374 // Walk over all optimized code objects in this native context. | 374 // Walk over all optimized code objects in this native context. |
| 375 Code* prev = NULL; | 375 Code* prev = NULL; |
| 376 Object* element = context->OptimizedCodeListHead(); | 376 Object* element = context->OptimizedCodeListHead(); |
| 377 while (!element->IsUndefined()) { | 377 while (!element->IsUndefined()) { |
| 378 Code* code = Code::cast(element); | 378 Code* code = Code::cast(element); |
| 379 CHECK_EQ(code->kind(), Code::OPTIMIZED_FUNCTION); | 379 CHECK_EQ(code->kind(), Code::OPTIMIZED_FUNCTION); |
| 380 Object* next = code->next_code_link(); | 380 Object* next = code->next_code_link(); |
| 381 | 381 |
| 382 if (code->marked_for_deoptimization() && | 382 if (code->marked_for_deoptimization()) { |
| 383 (!code->is_turbofanned() || FLAG_turbo_deoptimization)) { | 383 DCHECK(!code->is_turbofanned() || FLAG_turbo_deoptimization); |
| 384 // Put the code into the list for later patching. | 384 // Put the code into the list for later patching. |
| 385 codes.Add(code, &zone); | 385 codes.Add(code, &zone); |
| 386 | 386 |
| 387 if (prev != NULL) { | 387 if (prev != NULL) { |
| 388 // Skip this code in the optimized code list. | 388 // Skip this code in the optimized code list. |
| 389 prev->set_next_code_link(next); | 389 prev->set_next_code_link(next); |
| 390 } else { | 390 } else { |
| 391 // There was no previous node, the next node is the new head. | 391 // There was no previous node, the next node is the new head. |
| 392 context->SetOptimizedCodeListHead(next); | 392 context->SetOptimizedCodeListHead(next); |
| 393 } | 393 } |
| (...skipping 3406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3800 int raw_position = static_cast<int>(info->data()); | 3800 int raw_position = static_cast<int>(info->data()); |
| 3801 last_position = raw_position ? SourcePosition::FromRaw(raw_position) | 3801 last_position = raw_position ? SourcePosition::FromRaw(raw_position) |
| 3802 : SourcePosition::Unknown(); | 3802 : SourcePosition::Unknown(); |
| 3803 } else if (info->rmode() == RelocInfo::DEOPT_REASON) { | 3803 } else if (info->rmode() == RelocInfo::DEOPT_REASON) { |
| 3804 last_reason = static_cast<Deoptimizer::DeoptReason>(info->data()); | 3804 last_reason = static_cast<Deoptimizer::DeoptReason>(info->data()); |
| 3805 } | 3805 } |
| 3806 } | 3806 } |
| 3807 return DeoptInfo(SourcePosition::Unknown(), NULL, Deoptimizer::kNoReason); | 3807 return DeoptInfo(SourcePosition::Unknown(), NULL, Deoptimizer::kNoReason); |
| 3808 } | 3808 } |
| 3809 } } // namespace v8::internal | 3809 } } // namespace v8::internal |
| OLD | NEW |