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

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

Issue 2776373002: Initial steps into streaming the kernel flowgraph (Closed)
Patch Set: Changed type Created 3 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
OLDNEW
(Empty)
1 // Copyright (c) 2016, 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 #include "vm/kernel_binary_flowgraph.h"
6
7 #if !defined(DART_PRECOMPILED_RUNTIME)
8
9 namespace dart {
10 namespace kernel {
11
12 Fragment KernelFlowgraphBuilder::BuildAt(int64_t kernel_offset) {
13 reader_->set_offset(kernel_offset);
14
15 uint8_t payload = 0;
16 Tag tag = reader_->ReadTag(&payload);
17 switch (tag) {
18 // case kInvalidExpression:
19 // return InvalidExpression::ReadFrom(reader_);
20 // case kVariableGet:
21 // return VariableGet::ReadFrom(reader_);
22 // case kSpecializedVariableGet:
23 // return VariableGet::ReadFrom(reader_, payload);
24 // case kVariableSet:
25 // return VariableSet::ReadFrom(reader_);
26 // case kSpecializedVariableSet:
27 // return VariableSet::ReadFrom(reader_, payload);
28 // case kPropertyGet:
29 // return PropertyGet::ReadFrom(reader_);
30 // case kPropertySet:
31 // return PropertySet::ReadFrom(reader_);
32 // case kDirectPropertyGet:
33 // return DirectPropertyGet::ReadFrom(reader_);
34 // case kDirectPropertySet:
35 // return DirectPropertySet::ReadFrom(reader_);
36 // case kStaticGet:
37 // return StaticGet::ReadFrom(reader_);
38 // case kStaticSet:
39 // return StaticSet::ReadFrom(reader_);
40 // case kMethodInvocation:
41 // return MethodInvocation::ReadFrom(reader_);
42 // case kDirectMethodInvocation:
43 // return DirectMethodInvocation::ReadFrom(reader_);
44 // case kStaticInvocation:
45 // return StaticInvocation::ReadFrom(reader_, false);
46 // case kConstStaticInvocation:
47 // return StaticInvocation::ReadFrom(reader_, true);
48 // case kConstructorInvocation:
49 // return ConstructorInvocation::ReadFrom(reader_, false);
50 // case kConstConstructorInvocation:
51 // return ConstructorInvocation::ReadFrom(reader_, true);
52 // case kNot:
53 // return Not::ReadFrom(reader_);
54 // case kLogicalExpression:
55 // return LogicalExpression::ReadFrom(reader_);
56 // case kConditionalExpression:
57 // return ConditionalExpression::ReadFrom(reader_);
58 // case kStringConcatenation:
59 // return StringConcatenation::ReadFrom(reader_);
60 // case kIsExpression:
61 // return IsExpression::ReadFrom(reader_);
62 // case kAsExpression:
63 // return AsExpression::ReadFrom(reader_);
64 // case kSymbolLiteral:
65 // return SymbolLiteral::ReadFrom(reader_);
66 // case kTypeLiteral:
67 // return TypeLiteral::ReadFrom(reader_);
68 // case kThisExpression:
69 // return ThisExpression::ReadFrom(reader_);
70 case kRethrow:
71 return buildRethrow();
72 // case kThrow:
73 // return Throw::ReadFrom(reader_);
74 // case kListLiteral:
75 // return ListLiteral::ReadFrom(reader_, false);
76 // case kConstListLiteral:
77 // return ListLiteral::ReadFrom(reader_, true);
78 // case kMapLiteral:
79 // return MapLiteral::ReadFrom(reader_, false);
80 // case kConstMapLiteral:
81 // return MapLiteral::ReadFrom(reader_, true);
82 // case kAwaitExpression:
83 // return AwaitExpression::ReadFrom(reader_);
84 // case kFunctionExpression:
85 // return FunctionExpression::ReadFrom(reader_);
86 // case kLet:
87 // return Let::ReadFrom(reader_);
88 // case kBigIntLiteral:
89 // return BigintLiteral::ReadFrom(reader_);
90 // case kStringLiteral:
91 // return StringLiteral::ReadFrom(reader_);
92 // case kSpecialIntLiteral:
93 // return IntLiteral::ReadFrom(reader_, payload);
94 // case kNegativeIntLiteral:
95 // return IntLiteral::ReadFrom(reader_, true);
96 // case kPositiveIntLiteral:
97 // return IntLiteral::ReadFrom(reader_, false);
98 // case kDoubleLiteral:
99 // return DoubleLiteral::ReadFrom(reader_);
100 // case kTrueLiteral:
101 // return BoolLiteral::ReadFrom(reader_, true);
102 // case kFalseLiteral:
103 // return BoolLiteral::ReadFrom(reader_, false);
104 // case kNullLiteral:
105 // return NullLiteral::ReadFrom(reader_);
106 default:
107 UNREACHABLE();
108 }
109
110 Fragment instructions;
Kevin Millikin (Google) 2017/03/28 12:50:00 return Fragment();
jensj 2017/03/29 09:30:42 Done.
111 return instructions;
112 }
113
114 Fragment KernelFlowgraphBuilder::buildRethrow() {
115 Fragment instructions;
116
117 TokenPosition position = reader_->ReadPosition();
Kevin Millikin (Google) 2017/03/28 12:50:00 I would take all these functions (KernelReader::Re
jensj 2017/03/29 09:30:41 Done.
118 instructions = flowGraph_builder_->DebugStepCheck(position);
Kevin Millikin (Google) 2017/03/28 12:50:00 Fragment instructions = DebugStepCheck(position);
jensj 2017/03/29 09:30:41 Done.
119 instructions += flowGraph_builder_->LoadLocal(
120 flowGraph_builder_->catch_block_->exception_var());
121 instructions += flowGraph_builder_->PushArgument();
122 instructions += flowGraph_builder_->LoadLocal(
123 flowGraph_builder_->catch_block_->stack_trace_var());
124 instructions += flowGraph_builder_->PushArgument();
125 instructions += flowGraph_builder_->RethrowException(
126 position, flowGraph_builder_->catch_block_->catch_try_index());
127
128 return instructions;
129 }
130
131 } // namespace kernel
132 } // namespace dart
133
134 #endif // !defined(DART_PRECOMPILED_RUNTIME)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698