Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: runtime/vm/deopt_instructions.cc

Issue 11186007: In optimized code always deoptimize if we encounter an instance call without type feedback (ICData … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/code_generator.h ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/code_generator.h ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698