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

Side by Side Diff: runtime/vm/tags.h

Issue 227433004: Add runtime and native entry tags (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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
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 #ifndef VM_TAGS_H_ 5 #ifndef VM_TAGS_H_
6 #define VM_TAGS_H_ 6 #define VM_TAGS_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 9
10 namespace dart { 10 namespace dart {
11 11
12 class Isolate; 12 class Isolate;
13 class JSONObject; 13 class JSONObject;
14 14
15 // The list below must be manually kept in sync with the VM sources.
16 #define RUNTIME_ENTRY_TAG_LIST(V) \
17 V(AllocateArray) \
18 V(AllocateContext) \
19 V(AllocateObject) \
20 V(BreakpointRuntimeHandler) \
21 V(SingleStepHandler) \
22 V(CloneContext) \
23 V(FixCallersTarget) \
24 V(InlineCacheMissHandlerOneArg) \
25 V(InlineCacheMissHandlerTwoArgs) \
26 V(InlineCacheMissHandlerThreeArgs) \
27 V(StaticCallMissHandlerTwoArgs) \
28 V(Instanceof) \
29 V(TypeCheck) \
30 V(BadTypeError) \
31 V(NonBoolTypeError) \
32 V(InstantiateType) \
33 V(InstantiateTypeArguments) \
34 V(InvokeNoSuchMethodFunction) \
35 V(MegamorphicCacheMissHandler) \
36 V(OptimizeInvokedFunction) \
37 V(TraceICCall) \
38 V(PatchStaticCall) \
39 V(InvokeNonClosure) \
40 V(ReThrow) \
41 V(StackOverflow) \
42 V(Throw) \
43 V(TraceFunctionEntry) \
44 V(TraceFunctionExit) \
45 V(DeoptimizeMaterialize) \
46 V(UpdateFieldCid) \
47 V(CompileFunction) \
siva 2014/04/08 16:27:54 Can this be made part of DEFINE_RUNTIME_ENTRY i.e
Cutch 2014/04/09 17:40:59 DEFINE_RUNTIME_ENTRY cannot execute code so I'm no
siva 2014/04/09 23:28:11 Look at UNIT_TEST_CASE in unit_test.h it creates a
Cutch 2014/04/10 15:30:27 Done.
48
49
15 #define VM_TAG_LIST(V) \ 50 #define VM_TAG_LIST(V) \
16 V(Idle) \ 51 V(Idle) \
17 V(VM) /* Catch all */ \ 52 V(VM) /* Catch all */ \
18 V(Compile) \ 53 V(Compile) \
19 V(Script) \ 54 V(Script) \
20 V(GCNewSpace) \ 55 V(GCNewSpace) \
21 V(GCOldSpace) \ 56 V(GCOldSpace) \
22 V(RuntimeNative) \ 57 V(Runtime) \
58 V(Native) \
23 59
24 60
25 class VMTag : public AllStatic { 61 class VMTag : public AllStatic {
26 public: 62 public:
27 enum VMTagId { 63 enum VMTagId {
28 kInvalidTagId = 0, 64 kInvalidTagId = 0,
29 #define DEFINE_VM_TAG_ID(tag) \ 65 #define DEFINE_VM_TAG_ID(tag) \
30 k##tag##TagId, 66 k##tag##TagId,
31 VM_TAG_LIST(DEFINE_VM_TAG_ID) 67 VM_TAG_LIST(DEFINE_VM_TAG_ID)
32 #undef DEFINE_VM_TAG_KIND 68 #undef DEFINE_VM_TAG_KIND
33 kNumVMTags, 69 kNumVMTags,
34 }; 70 };
35 71
36 static const char* TagName(uword id); 72 static const char* TagName(uword id);
73 static bool IsNativeEntryTag(uword id);
74
75 static bool IsRuntimeEntryTag(uword id);
76 static const char* RuntimeEntryTagName(uword id);
37 77
38 private: 78 private:
39 struct TagEntry { 79 struct TagEntry {
40 const char* name; 80 const char* name;
41 uword id; 81 uword id;
42 }; 82 };
43 static TagEntry entries_[]; 83 static TagEntry entries_[];
44 }; 84 };
45 85
46 86
(...skipping 19 matching lines...) Expand all
66 106
67 void PrintToJSONObject(JSONObject* obj); 107 void PrintToJSONObject(JSONObject* obj);
68 108
69 private: 109 private:
70 int64_t counters_[VMTag::kNumVMTags]; 110 int64_t counters_[VMTag::kNumVMTags];
71 }; 111 };
72 112
73 } // namespace dart 113 } // namespace dart
74 114
75 #endif // VM_TAGS_H_ 115 #endif // VM_TAGS_H_
OLDNEW
« runtime/vm/profiler.cc ('K') | « runtime/vm/stub_code_ia32.cc ('k') | runtime/vm/tags.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698