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

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

Issue 8826007: First bits of external debugger API (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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/include/dart_debugger_api.h ('k') | runtime/vm/dart_api_impl.h » ('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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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/globals.h" // Needed here to get TARGET_ARCH_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/code_generator.h" 8 #include "vm/code_generator.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
11 #include "vm/ast_printer.h" 11 #include "vm/ast_printer.h"
12 #include "vm/class_finalizer.h" 12 #include "vm/class_finalizer.h"
13 #include "vm/dart_entry.h" 13 #include "vm/dart_entry.h"
14 #include "vm/debugger.h"
14 #include "vm/ic_data.h" 15 #include "vm/ic_data.h"
15 #include "vm/longjump.h" 16 #include "vm/longjump.h"
16 #include "vm/object.h" 17 #include "vm/object.h"
17 #include "vm/object_store.h" 18 #include "vm/object_store.h"
18 #include "vm/parser.h" 19 #include "vm/parser.h"
19 #include "vm/resolver.h" 20 #include "vm/resolver.h"
20 #include "vm/stub_code.h" 21 #include "vm/stub_code.h"
21 22
22 namespace dart { 23 namespace dart {
23 24
24 DEFINE_FLAG(bool, print_ast, false, "Print abstract syntax tree."); 25 DEFINE_FLAG(bool, print_ast, false, "Print abstract syntax tree.");
25 DEFINE_FLAG(bool, print_scopes, false, "Print scopes of local variables."); 26 DEFINE_FLAG(bool, print_scopes, false, "Print scopes of local variables.");
26 DEFINE_FLAG(bool, trace_functions, false, "Trace entry of each function."); 27 DEFINE_FLAG(bool, trace_functions, false, "Trace entry of each function.");
27 DEFINE_FLAG(int, optimization_invocation_threshold, 1000, 28 DEFINE_FLAG(int, optimization_invocation_threshold, 1000,
28 "number of invocations before a function is optimized, -1 means never."); 29 "number of invocations before a function is optimized, -1 means never.");
29 DECLARE_FLAG(bool, enable_type_checks); 30 DECLARE_FLAG(bool, enable_type_checks);
30 DECLARE_FLAG(bool, report_invocation_count); 31 DECLARE_FLAG(bool, report_invocation_count);
31 DECLARE_FLAG(bool, trace_compiler); 32 DECLARE_FLAG(bool, trace_compiler);
32 DECLARE_FLAG(bool, debugger);
33 33
34 #define __ assembler_-> 34 #define __ assembler_->
35 35
36 36
37 CodeGeneratorState::CodeGeneratorState(CodeGenerator* codegen) 37 CodeGeneratorState::CodeGeneratorState(CodeGenerator* codegen)
38 : StackResource(Isolate::Current()), 38 : StackResource(Isolate::Current()),
39 codegen_(codegen), 39 codegen_(codegen),
40 parent_(codegen->state()) { 40 parent_(codegen->state()) {
41 if (parent_ != NULL) { 41 if (parent_ != NULL) {
42 root_node_ = parent_->root_node_; 42 root_node_ = parent_->root_node_;
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 Address::Absolute(Isolate::Current()->stack_limit_address())); 276 Address::Absolute(Isolate::Current()->stack_limit_address()));
277 __ j(BELOW_EQUAL, &StubCode::StackOverflowLabel()); 277 __ j(BELOW_EQUAL, &StubCode::StackOverflowLabel());
278 // Do not optimize if: 278 // Do not optimize if:
279 // - we count invocations. 279 // - we count invocations.
280 // - optimization disabled via negative 'optimization_invocation_threshold; 280 // - optimization disabled via negative 'optimization_invocation_threshold;
281 // - function is marked as non-optimizable. 281 // - function is marked as non-optimizable.
282 // - type checks are enabled. 282 // - type checks are enabled.
283 const bool may_optimize = 283 const bool may_optimize =
284 !FLAG_report_invocation_count && 284 !FLAG_report_invocation_count &&
285 (FLAG_optimization_invocation_threshold >= 0) && 285 (FLAG_optimization_invocation_threshold >= 0) &&
286 !FLAG_debugger && 286 !Isolate::Current()->debugger()->IsActive() &&
287 parsed_function_.function().is_optimizable(); 287 parsed_function_.function().is_optimizable();
288 // Count invocation and check. 288 // Count invocation and check.
289 if (FLAG_report_invocation_count || may_optimize) { 289 if (FLAG_report_invocation_count || may_optimize) {
290 const Function& function = 290 const Function& function =
291 Function::ZoneHandle(parsed_function_.function().raw()); 291 Function::ZoneHandle(parsed_function_.function().raw());
292 __ LoadObject(EAX, function); 292 __ LoadObject(EAX, function);
293 __ movl(EBX, FieldAddress(EAX, Function::invocation_counter_offset())); 293 __ movl(EBX, FieldAddress(EAX, Function::invocation_counter_offset()));
294 __ incl(EBX); 294 __ incl(EBX);
295 if (may_optimize) { 295 if (may_optimize) {
296 __ cmpl(EBX, Immediate(FLAG_optimization_invocation_threshold)); 296 __ cmpl(EBX, Immediate(FLAG_optimization_invocation_threshold));
(...skipping 2449 matching lines...) Expand 10 before | Expand all | Expand 10 after
2746 message_buffer, kMessageBufferSize, 2746 message_buffer, kMessageBufferSize,
2747 format, args); 2747 format, args);
2748 va_end(args); 2748 va_end(args);
2749 Isolate::Current()->long_jump_base()->Jump(1, message_buffer); 2749 Isolate::Current()->long_jump_base()->Jump(1, message_buffer);
2750 UNREACHABLE(); 2750 UNREACHABLE();
2751 } 2751 }
2752 2752
2753 } // namespace dart 2753 } // namespace dart
2754 2754
2755 #endif // defined TARGET_ARCH_IA32 2755 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/include/dart_debugger_api.h ('k') | runtime/vm/dart_api_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698