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

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

Issue 2922913004: Add Dart_Save/LoadCompilationTrace. (Closed)
Patch Set: . Created 3 years, 6 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
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/vm/compilation_trace.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
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.
4
5 #ifndef RUNTIME_VM_COMPILATION_TRACE_H_
6 #define RUNTIME_VM_COMPILATION_TRACE_H_
7
8 #include "platform/assert.h"
9 #include "vm/compiler.h"
10 #include "vm/object.h"
11 #include "vm/program_visitor.h"
12 #include "vm/zone_text_buffer.h"
13
14 namespace dart {
15
16 class CompilationTraceSaver : public FunctionVisitor {
17 public:
18 explicit CompilationTraceSaver(Zone* zone);
19 void Visit(const Function& function);
20
21 void StealBuffer(uint8_t** buffer, intptr_t* buffer_length) {
22 *buffer = reinterpret_cast<uint8_t*>(buf_.buffer());
23 *buffer_length = buf_.length() + 1; // Include terminating NUL.
24 }
25
26 private:
27 ZoneTextBuffer buf_;
28 String& func_name_;
29 Class& cls_;
30 String& cls_name_;
31 Library& lib_;
32 String& uri_;
33 };
34
35 class CompilationTraceLoader : public ValueObject {
36 public:
37 explicit CompilationTraceLoader(Thread* thread);
38
39 RawObject* CompileTrace(char* buffer);
40
41 private:
42 RawObject* CompileTriple(const char* uri_cstr,
43 const char* cls_cstr,
44 const char* func_cstr);
45 RawObject* CompileFunction(const Function& function);
46 RawObject* EvaluateInitializer(const Field& field);
47
48 Thread* thread_;
49 Zone* zone_;
50 String& uri_;
51 String& class_name_;
52 String& function_name_;
53 String& function_name2_;
54 Library& lib_;
55 Class& cls_;
56 Function& function_;
57 Function& function2_;
58 Field& field_;
59 Object& error_;
60 };
61
62 } // namespace dart
63
64 #endif // RUNTIME_VM_COMPILATION_TRACE_H_
OLDNEW
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/vm/compilation_trace.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698