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

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

Issue 3001093002: Remove some "namespace" classes from C++ Kernel (Closed)
Patch Set: Created 3 years, 4 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
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 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 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 RUNTIME_VM_KERNEL_H_ 5 #ifndef RUNTIME_VM_KERNEL_H_
6 #define RUNTIME_VM_KERNEL_H_ 6 #define RUNTIME_VM_KERNEL_H_
7 7
8 #if !defined(DART_PRECOMPILED_RUNTIME) 8 #if !defined(DART_PRECOMPILED_RUNTIME)
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "vm/allocation.h" 10 #include "vm/allocation.h"
(...skipping 26 matching lines...) Expand all
37 public: 37 public:
38 NameIndex() : value_(-1) {} 38 NameIndex() : value_(-1) {}
39 explicit NameIndex(int value) : value_(value) {} 39 explicit NameIndex(int value) : value_(value) {}
40 40
41 operator int() const { return value_; } 41 operator int() const { return value_; }
42 42
43 private: 43 private:
44 int value_; 44 int value_;
45 }; 45 };
46 46
47 class Field { 47 const uint8_t kNativeYieldFlags = 0x2;
48 public:
49 enum Flags {
50 kFlagFinal = 1 << 0,
51 kFlagConst = 1 << 1,
52 kFlagStatic = 1 << 2,
53 };
54 };
55 48
56 class Constructor { 49 enum LogicalOperator { kAnd, kOr };
57 public:
58 enum Flags {
59 kFlagConst = 1 << 0,
60 kFlagExternal = 1 << 1,
61 };
62 };
63
64 class Procedure {
65 public:
66 enum Flags {
67 kFlagStatic = 1 << 0,
68 kFlagAbstract = 1 << 1,
69 kFlagExternal = 1 << 2,
70 kFlagConst = 1 << 3, // Only for external const factories.
71 };
72
73 // Keep in sync with package:dynamo/lib/ast.dart:ProcedureKind
74 enum ProcedureKind {
75 kMethod,
76 kGetter,
77 kSetter,
78 kOperator,
79 kFactory,
80
81 kIncompleteProcedure = 255
82 };
83 };
84
85 class FunctionNode {
86 public:
87 enum AsyncMarker {
88 kSync = 0,
89 kSyncStar = 1,
90 kAsync = 2,
91 kAsyncStar = 3,
92 kSyncYielding = 4,
93 };
94 };
95
96 class VariableDeclaration {
97 public:
98 enum Flags {
99 kFlagFinal = 1 << 0,
100 kFlagConst = 1 << 1,
101 };
102 };
103
104 class YieldStatement {
105 public:
106 enum {
107 kFlagYieldStar = 1 << 0,
108 kFlagNative = 1 << 1,
109 };
110 };
111
112 class LogicalExpression {
113 public:
114 enum Operator { kAnd, kOr };
115 };
116 50
117 class Program { 51 class Program {
118 public: 52 public:
119 ~Program() { 53 ~Program() {
120 free(const_cast<uint8_t*>(kernel_data_)); 54 free(const_cast<uint8_t*>(kernel_data_));
121 kernel_data_ = NULL; 55 kernel_data_ = NULL;
122 } 56 }
123 57
124 static Program* ReadFrom(Reader* reader); 58 static Program* ReadFrom(Reader* reader);
125 59
(...skipping 27 matching lines...) Expand all
153 87
154 } // namespace kernel 88 } // namespace kernel
155 89
156 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, 90 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer,
157 intptr_t buffer_length); 91 intptr_t buffer_length);
158 92
159 } // namespace dart 93 } // namespace dart
160 94
161 #endif // !defined(DART_PRECOMPILED_RUNTIME) 95 #endif // !defined(DART_PRECOMPILED_RUNTIME)
162 #endif // RUNTIME_VM_KERNEL_H_ 96 #endif // RUNTIME_VM_KERNEL_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/kernel_binary_flowgraph.h » ('j') | runtime/vm/kernel_binary_flowgraph.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698