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

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

Issue 19017007: Implements OSR for arm and mips. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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/assembler_mips.cc ('k') | runtime/vm/flow_graph_compiler_arm.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/code_generator.h" 5 #include "vm/code_generator.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 #include "vm/ast.h" 8 #include "vm/ast.h"
9 #include "vm/bigint_operations.h" 9 #include "vm/bigint_operations.h"
10 #include "vm/code_patcher.h" 10 #include "vm/code_patcher.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 DEFINE_FLAG(bool, trace_optimized_ic_calls, false, 50 DEFINE_FLAG(bool, trace_optimized_ic_calls, false,
51 "Trace IC calls in optimized code."); 51 "Trace IC calls in optimized code.");
52 DEFINE_FLAG(bool, trace_patching, false, "Trace patching of code."); 52 DEFINE_FLAG(bool, trace_patching, false, "Trace patching of code.");
53 DEFINE_FLAG(bool, trace_runtime_calls, false, "Trace runtime calls"); 53 DEFINE_FLAG(bool, trace_runtime_calls, false, "Trace runtime calls");
54 54
55 DECLARE_FLAG(int, deoptimization_counter_threshold); 55 DECLARE_FLAG(int, deoptimization_counter_threshold);
56 DECLARE_FLAG(bool, enable_type_checks); 56 DECLARE_FLAG(bool, enable_type_checks);
57 DECLARE_FLAG(bool, report_usage_count); 57 DECLARE_FLAG(bool, report_usage_count);
58 DECLARE_FLAG(bool, trace_type_checks); 58 DECLARE_FLAG(bool, trace_type_checks);
59 59
60 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
61 DEFINE_FLAG(bool, use_osr, true, "Use on-stack replacement."); 60 DEFINE_FLAG(bool, use_osr, true, "Use on-stack replacement.");
62 #else
63 DEFINE_FLAG(bool, use_osr, false, "Use on-stack replacement.");
64 #endif
65 DEFINE_FLAG(bool, trace_osr, false, "Trace attempts at on-stack replacement."); 61 DEFINE_FLAG(bool, trace_osr, false, "Trace attempts at on-stack replacement.");
66 62
67 63
68 DEFINE_RUNTIME_ENTRY(TraceFunctionEntry, 1) { 64 DEFINE_RUNTIME_ENTRY(TraceFunctionEntry, 1) {
69 ASSERT(arguments.ArgCount() == 65 ASSERT(arguments.ArgCount() ==
70 kTraceFunctionEntryRuntimeEntry.argument_count()); 66 kTraceFunctionEntryRuntimeEntry.argument_count());
71 const Function& function = Function::CheckedHandle(arguments.ArgAt(0)); 67 const Function& function = Function::CheckedHandle(arguments.ArgAt(0));
72 const String& function_name = String::Handle(function.name()); 68 const String& function_name = String::Handle(function.name());
73 const String& class_name = 69 const String& class_name =
74 String::Handle(Class::Handle(function.Owner()).Name()); 70 String::Handle(Class::Handle(function.Owner()).Name());
(...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after
1320 function.set_usage_counter(kLowInvocationCount); 1316 function.set_usage_counter(kLowInvocationCount);
1321 return false; 1317 return false;
1322 } 1318 }
1323 return true; 1319 return true;
1324 } 1320 }
1325 1321
1326 1322
1327 DEFINE_RUNTIME_ENTRY(StackOverflow, 0) { 1323 DEFINE_RUNTIME_ENTRY(StackOverflow, 0) {
1328 ASSERT(arguments.ArgCount() == 1324 ASSERT(arguments.ArgCount() ==
1329 kStackOverflowRuntimeEntry.argument_count()); 1325 kStackOverflowRuntimeEntry.argument_count());
1326 #if defined(USING_SIMULATOR)
1327 uword stack_pos = Simulator::Current()->get_register(SPREG);
1328 #else
1330 uword stack_pos = reinterpret_cast<uword>(&arguments); 1329 uword stack_pos = reinterpret_cast<uword>(&arguments);
1330 #endif
1331 1331
1332 // If an interrupt happens at the same time as a stack overflow, we 1332 // If an interrupt happens at the same time as a stack overflow, we
1333 // process the stack overflow first. 1333 // process the stack overflow first.
1334 if (stack_pos < isolate->saved_stack_limit()) { 1334 if (stack_pos < isolate->saved_stack_limit()) {
1335 // Use the preallocated stack overflow exception to avoid calling 1335 // Use the preallocated stack overflow exception to avoid calling
1336 // into dart code. 1336 // into dart code.
1337 const Instance& exception = 1337 const Instance& exception =
1338 Instance::Handle(isolate->object_store()->stack_overflow()); 1338 Instance::Handle(isolate->object_store()->stack_overflow());
1339 Exceptions::Throw(exception); 1339 Exceptions::Throw(exception);
1340 UNREACHABLE(); 1340 UNREACHABLE();
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
1869 // Arg1: Value that is being stored. 1869 // Arg1: Value that is being stored.
1870 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) { 1870 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) {
1871 ASSERT(arguments.ArgCount() == kUpdateFieldCidRuntimeEntry.argument_count()); 1871 ASSERT(arguments.ArgCount() == kUpdateFieldCidRuntimeEntry.argument_count());
1872 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); 1872 const Field& field = Field::CheckedHandle(arguments.ArgAt(0));
1873 const Object& value = Object::Handle(arguments.ArgAt(1)); 1873 const Object& value = Object::Handle(arguments.ArgAt(1));
1874 1874
1875 field.UpdateCid(value.GetClassId()); 1875 field.UpdateCid(value.GetClassId());
1876 } 1876 }
1877 1877
1878 } // namespace dart 1878 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/assembler_mips.cc ('k') | runtime/vm/flow_graph_compiler_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698