| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/deopt_instructions.h" | 5 #include "vm/deopt_instructions.h" |
| 6 | 6 |
| 7 #include "vm/assembler_macros.h" | 7 #include "vm/assembler_macros.h" |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 #include "vm/locations.h" | 9 #include "vm/locations.h" |
| 10 #include "vm/parser.h" | 10 #include "vm/parser.h" |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len + 1); | 410 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len + 1); |
| 411 OS::SNPrint(chars, len + 1, format, object_table_index_); | 411 OS::SNPrint(chars, len + 1, format, object_table_index_); |
| 412 return chars; | 412 return chars; |
| 413 } | 413 } |
| 414 | 414 |
| 415 void Execute(DeoptimizationContext* deopt_context, intptr_t to_index) { | 415 void Execute(DeoptimizationContext* deopt_context, intptr_t to_index) { |
| 416 Function& function = Function::Handle(deopt_context->isolate()); | 416 Function& function = Function::Handle(deopt_context->isolate()); |
| 417 function ^= deopt_context->ObjectAt(object_table_index_); | 417 function ^= deopt_context->ObjectAt(object_table_index_); |
| 418 const Code& code = | 418 const Code& code = |
| 419 Code::Handle(deopt_context->isolate(), function.unoptimized_code()); | 419 Code::Handle(deopt_context->isolate(), function.unoptimized_code()); |
| 420 ASSERT(!code.IsNull()); |
| 420 intptr_t pc_marker = code.EntryPoint() + | 421 intptr_t pc_marker = code.EntryPoint() + |
| 421 AssemblerMacros::kOffsetOfSavedPCfromEntrypoint; | 422 AssemblerMacros::kOffsetOfSavedPCfromEntrypoint; |
| 422 intptr_t* to_addr = deopt_context->GetToFrameAddressAt(to_index); | 423 intptr_t* to_addr = deopt_context->GetToFrameAddressAt(to_index); |
| 423 *to_addr = pc_marker; | 424 *to_addr = pc_marker; |
| 424 // Increment the deoptimization counter. This effectively increments each | 425 // Increment the deoptimization counter. This effectively increments each |
| 425 // function occurring in the optimized frame. | 426 // function occurring in the optimized frame. |
| 426 function.set_deoptimization_counter(function.deoptimization_counter() + 1); | 427 function.set_deoptimization_counter(function.deoptimization_counter() + 1); |
| 427 // Clear invocation counter so that hopefully the function gets reoptimized | 428 // Clear invocation counter so that hopefully the function gets reoptimized |
| 428 // only after more feedback has been collected. | 429 // only after more feedback has been collected. |
| 429 function.set_usage_counter(0); | 430 function.set_usage_counter(0); |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 Smi* offset, | 640 Smi* offset, |
| 640 DeoptInfo* info, | 641 DeoptInfo* info, |
| 641 Smi* reason) { | 642 Smi* reason) { |
| 642 intptr_t i = index * kEntrySize; | 643 intptr_t i = index * kEntrySize; |
| 643 *offset ^= table.At(i); | 644 *offset ^= table.At(i); |
| 644 *info ^= table.At(i + 1); | 645 *info ^= table.At(i + 1); |
| 645 *reason ^= table.At(i + 2); | 646 *reason ^= table.At(i + 2); |
| 646 } | 647 } |
| 647 | 648 |
| 648 } // namespace dart | 649 } // namespace dart |
| OLD | NEW |