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

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

Issue 11412106: Support VTune's JIT interface. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: add vtune.{cc,h} Created 8 years, 1 month 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
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/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/bigint_operations.h" 10 #include "vm/bigint_operations.h"
(...skipping 14 matching lines...) Expand all
25 #include "vm/growable_array.h" 25 #include "vm/growable_array.h"
26 #include "vm/heap.h" 26 #include "vm/heap.h"
27 #include "vm/object_store.h" 27 #include "vm/object_store.h"
28 #include "vm/parser.h" 28 #include "vm/parser.h"
29 #include "vm/runtime_entry.h" 29 #include "vm/runtime_entry.h"
30 #include "vm/scopes.h" 30 #include "vm/scopes.h"
31 #include "vm/stack_frame.h" 31 #include "vm/stack_frame.h"
32 #include "vm/symbols.h" 32 #include "vm/symbols.h"
33 #include "vm/timer.h" 33 #include "vm/timer.h"
34 #include "vm/unicode.h" 34 #include "vm/unicode.h"
35 #include "vm/vtune.h"
35 36
36 namespace dart { 37 namespace dart {
37 38
38 DEFINE_FLAG(bool, generate_gdb_symbols, false, 39 DEFINE_FLAG(bool, generate_gdb_symbols, false,
39 "Generate symbols of generated dart functions for debugging with GDB"); 40 "Generate symbols of generated dart functions for debugging with GDB");
40 DEFINE_FLAG(bool, show_internal_names, false, 41 DEFINE_FLAG(bool, show_internal_names, false,
41 "Show names of internal classes (e.g. \"OneByteString\") in error messages " 42 "Show names of internal classes (e.g. \"OneByteString\") in error messages "
42 "instead of showing the corresponding interface names (e.g. \"String\")"); 43 "instead of showing the corresponding interface names (e.g. \"String\")");
43 DEFINE_FLAG(bool, trace_disabling_optimized_code, false, 44 DEFINE_FLAG(bool, trace_disabling_optimized_code, false,
44 "Trace disabling optimized code."); 45 "Trace disabling optimized code.");
(...skipping 6995 matching lines...) Expand 10 before | Expand all | Expand 10 after
7040 OS::SNPrint(pname, (len + 1), kFormat, name, "entry"); 7041 OS::SNPrint(pname, (len + 1), kFormat, name, "entry");
7041 DebugInfo::RegisterSection(pname, instrs.EntryPoint(), prolog_offset); 7042 DebugInfo::RegisterSection(pname, instrs.EntryPoint(), prolog_offset);
7042 DebugInfo::RegisterSection(name, 7043 DebugInfo::RegisterSection(name,
7043 (instrs.EntryPoint() + prolog_offset), 7044 (instrs.EntryPoint() + prolog_offset),
7044 (instrs.size() - prolog_offset)); 7045 (instrs.size() - prolog_offset));
7045 } else { 7046 } else {
7046 DebugInfo::RegisterSection(name, instrs.EntryPoint(), instrs.size()); 7047 DebugInfo::RegisterSection(name, instrs.EntryPoint(), instrs.size());
7047 } 7048 }
7048 } 7049 }
7049 7050
7051 VTune::Register(name, instrs.EntryPoint(), instrs.size());
Ivan Posva 2012/11/26 04:36:38 We should really clean this up. The different tool
Vyacheslav Egorov (Google) 2012/11/26 15:11:10 Refactored.
7052
7050 const ZoneGrowableArray<int>& pointer_offsets = 7053 const ZoneGrowableArray<int>& pointer_offsets =
7051 assembler->GetPointerOffsets(); 7054 assembler->GetPointerOffsets();
7052 7055
7053 // Allocate the code object. 7056 // Allocate the code object.
7054 Code& code = Code::ZoneHandle(Code::New(pointer_offsets.length())); 7057 Code& code = Code::ZoneHandle(Code::New(pointer_offsets.length()));
7055 { 7058 {
7056 NoGCScope no_gc; 7059 NoGCScope no_gc;
7057 7060
7058 // Set pointer offsets list in Code object and resolve all handles in 7061 // Set pointer offsets list in Code object and resolve all handles in
7059 // the instruction stream to raw objects. 7062 // the instruction stream to raw objects.
(...skipping 12 matching lines...) Expand all
7072 return code.raw(); 7075 return code.raw();
7073 } 7076 }
7074 7077
7075 7078
7076 RawCode* Code::FinalizeCode(const Function& function, 7079 RawCode* Code::FinalizeCode(const Function& function,
7077 Assembler* assembler, 7080 Assembler* assembler,
7078 bool optimized) { 7081 bool optimized) {
7079 // Calling ToFullyQualifiedCString is very expensive, try to avoid it. 7082 // Calling ToFullyQualifiedCString is very expensive, try to avoid it.
7080 if (FLAG_generate_gdb_symbols || 7083 if (FLAG_generate_gdb_symbols ||
7081 Dart::perf_events_writer() != NULL || 7084 Dart::perf_events_writer() != NULL ||
7082 Dart::pprof_symbol_generator() != NULL) { 7085 Dart::pprof_symbol_generator() != NULL ||
7086 VTune::IsActive()) {
Ivan Posva 2012/11/26 04:36:38 This seems rather error prone, as the checking is
Vyacheslav Egorov (Google) 2012/11/26 15:11:10 Refactored.
7083 return FinalizeCode(function.ToFullyQualifiedCString(), 7087 return FinalizeCode(function.ToFullyQualifiedCString(),
7084 assembler, 7088 assembler,
7085 optimized); 7089 optimized);
7086 } else { 7090 } else {
7087 return FinalizeCode("", assembler); 7091 return FinalizeCode("", assembler);
7088 } 7092 }
7089 } 7093 }
7090 7094
7091 7095
7092 // Check if object matches find condition. 7096 // Check if object matches find condition.
(...skipping 4910 matching lines...) Expand 10 before | Expand all | Expand 10 after
12003 } 12007 }
12004 return result.raw(); 12008 return result.raw();
12005 } 12009 }
12006 12010
12007 12011
12008 const char* WeakProperty::ToCString() const { 12012 const char* WeakProperty::ToCString() const {
12009 return "_WeakProperty"; 12013 return "_WeakProperty";
12010 } 12014 }
12011 12015
12012 } // namespace dart 12016 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698