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

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

Issue 2628693004: TokenPositions on more nodes when running from Kernel (Closed)
Patch Set: Created 3 years, 11 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 1985 matching lines...) Expand 10 before | Expand all | Expand 10 after
1996 void WriteToImpl(Writer* writer); 1996 void WriteToImpl(Writer* writer);
1997 1997
1998 virtual ~Block(); 1998 virtual ~Block();
1999 1999
2000 DEFINE_CASTING_OPERATIONS(Block); 2000 DEFINE_CASTING_OPERATIONS(Block);
2001 2001
2002 virtual void AcceptStatementVisitor(StatementVisitor* visitor); 2002 virtual void AcceptStatementVisitor(StatementVisitor* visitor);
2003 virtual void VisitChildren(Visitor* visitor); 2003 virtual void VisitChildren(Visitor* visitor);
2004 2004
2005 List<Statement>& statements() { return statements_; } 2005 List<Statement>& statements() { return statements_; }
2006 TokenPosition end_position() { return end_position_; }
2006 2007
2007 private: 2008 private:
2008 Block() {} 2009 Block() : end_position_(TokenPosition::kNoSource) {}
2009 2010
2010 List<Statement> statements_; 2011 List<Statement> statements_;
2012 TokenPosition end_position_;
2011 2013
2012 DISALLOW_COPY_AND_ASSIGN(Block); 2014 DISALLOW_COPY_AND_ASSIGN(Block);
2013 }; 2015 };
2014 2016
2015 2017
2016 class EmptyStatement : public Statement { 2018 class EmptyStatement : public Statement {
2017 public: 2019 public:
2018 static EmptyStatement* ReadFrom(Reader* reader); 2020 static EmptyStatement* ReadFrom(Reader* reader);
2019 virtual void WriteTo(Writer* writer); 2021 virtual void WriteTo(Writer* writer);
2020 2022
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
2162 2164
2163 DEFINE_CASTING_OPERATIONS(ForStatement); 2165 DEFINE_CASTING_OPERATIONS(ForStatement);
2164 2166
2165 virtual void AcceptStatementVisitor(StatementVisitor* visitor); 2167 virtual void AcceptStatementVisitor(StatementVisitor* visitor);
2166 virtual void VisitChildren(Visitor* visitor); 2168 virtual void VisitChildren(Visitor* visitor);
2167 2169
2168 List<VariableDeclaration>& variables() { return variables_; } 2170 List<VariableDeclaration>& variables() { return variables_; }
2169 Expression* condition() { return condition_; } 2171 Expression* condition() { return condition_; }
2170 List<Expression>& updates() { return updates_; } 2172 List<Expression>& updates() { return updates_; }
2171 Statement* body() { return body_; } 2173 Statement* body() { return body_; }
2174 TokenPosition position() { return position_; }
2175 TokenPosition end_position() { return end_position_; }
2172 2176
2173 private: 2177 private:
2174 ForStatement() {} 2178 ForStatement()
2179 : position_(TokenPosition::kNoSource),
2180 end_position_(TokenPosition::kNoSource) {}
2175 2181
2176 List<VariableDeclaration> variables_; 2182 List<VariableDeclaration> variables_;
2177 Child<Expression> condition_; 2183 Child<Expression> condition_;
2178 List<Expression> updates_; 2184 List<Expression> updates_;
2179 Child<Statement> body_; 2185 Child<Statement> body_;
2186 TokenPosition position_;
2187 TokenPosition end_position_;
2180 2188
2181 DISALLOW_COPY_AND_ASSIGN(ForStatement); 2189 DISALLOW_COPY_AND_ASSIGN(ForStatement);
2182 }; 2190 };
2183 2191
2184 2192
2185 class ForInStatement : public Statement { 2193 class ForInStatement : public Statement {
2186 public: 2194 public:
2187 static ForInStatement* ReadFrom(Reader* reader, bool is_async); 2195 static ForInStatement* ReadFrom(Reader* reader, bool is_async);
2188 virtual void WriteTo(Writer* writer); 2196 virtual void WriteTo(Writer* writer);
2189 2197
2190 virtual ~ForInStatement(); 2198 virtual ~ForInStatement();
2191 2199
2192 DEFINE_CASTING_OPERATIONS(ForInStatement); 2200 DEFINE_CASTING_OPERATIONS(ForInStatement);
2193 2201
2194 virtual void AcceptStatementVisitor(StatementVisitor* visitor); 2202 virtual void AcceptStatementVisitor(StatementVisitor* visitor);
2195 virtual void VisitChildren(Visitor* visitor); 2203 virtual void VisitChildren(Visitor* visitor);
2196 2204
2197 VariableDeclaration* variable() { return variable_; } 2205 VariableDeclaration* variable() { return variable_; }
2198 Expression* iterable() { return iterable_; } 2206 Expression* iterable() { return iterable_; }
2199 Statement* body() { return body_; } 2207 Statement* body() { return body_; }
2200 bool is_async() { return is_async_; } 2208 bool is_async() { return is_async_; }
2209 TokenPosition position() { return position_; }
2210 TokenPosition end_position() { return end_position_; }
2201 2211
2202 private: 2212 private:
2203 ForInStatement() {} 2213 ForInStatement()
2214 : position_(TokenPosition::kNoSource),
2215 end_position_(TokenPosition::kNoSource) {}
2204 2216
2205 Child<VariableDeclaration> variable_; 2217 Child<VariableDeclaration> variable_;
2206 Child<Expression> iterable_; 2218 Child<Expression> iterable_;
2207 Child<Statement> body_; 2219 Child<Statement> body_;
2208 bool is_async_; 2220 bool is_async_;
2221 TokenPosition position_;
2222 TokenPosition end_position_;
2209 2223
2210 DISALLOW_COPY_AND_ASSIGN(ForInStatement); 2224 DISALLOW_COPY_AND_ASSIGN(ForInStatement);
2211 }; 2225 };
2212 2226
2213 2227
2214 class SwitchStatement : public Statement { 2228 class SwitchStatement : public Statement {
2215 public: 2229 public:
2216 static SwitchStatement* ReadFrom(Reader* reader); 2230 static SwitchStatement* ReadFrom(Reader* reader);
2217 virtual void WriteTo(Writer* writer); 2231 virtual void WriteTo(Writer* writer);
2218 2232
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
2373 2387
2374 DEFINE_CASTING_OPERATIONS(Catch); 2388 DEFINE_CASTING_OPERATIONS(Catch);
2375 2389
2376 virtual void AcceptTreeVisitor(TreeVisitor* visitor); 2390 virtual void AcceptTreeVisitor(TreeVisitor* visitor);
2377 virtual void VisitChildren(Visitor* visitor); 2391 virtual void VisitChildren(Visitor* visitor);
2378 2392
2379 DartType* guard() { return guard_; } 2393 DartType* guard() { return guard_; }
2380 VariableDeclaration* exception() { return exception_; } 2394 VariableDeclaration* exception() { return exception_; }
2381 VariableDeclaration* stack_trace() { return stack_trace_; } 2395 VariableDeclaration* stack_trace() { return stack_trace_; }
2382 Statement* body() { return body_; } 2396 Statement* body() { return body_; }
2397 TokenPosition position() { return position_; }
2398 TokenPosition end_position() { return end_position_; }
2383 2399
2384 private: 2400 private:
2385 Catch() {} 2401 Catch()
2402 : position_(TokenPosition::kNoSource),
2403 end_position_(TokenPosition::kNoSource) {}
2386 2404
2387 template <typename T> 2405 template <typename T>
2388 friend class List; 2406 friend class List;
2389 2407
2390 Child<DartType> guard_; 2408 Child<DartType> guard_;
2391 Child<VariableDeclaration> exception_; 2409 Child<VariableDeclaration> exception_;
2392 Child<VariableDeclaration> stack_trace_; 2410 Child<VariableDeclaration> stack_trace_;
2393 Child<Statement> body_; 2411 Child<Statement> body_;
2412 TokenPosition position_;
2413 TokenPosition end_position_;
2394 2414
2395 DISALLOW_COPY_AND_ASSIGN(Catch); 2415 DISALLOW_COPY_AND_ASSIGN(Catch);
2396 }; 2416 };
2397 2417
2398 2418
2399 class TryFinally : public Statement { 2419 class TryFinally : public Statement {
2400 public: 2420 public:
2401 static TryFinally* ReadFrom(Reader* reader); 2421 static TryFinally* ReadFrom(Reader* reader);
2402 virtual void WriteTo(Writer* writer); 2422 virtual void WriteTo(Writer* writer);
2403 2423
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
2470 virtual void AcceptStatementVisitor(StatementVisitor* visitor); 2490 virtual void AcceptStatementVisitor(StatementVisitor* visitor);
2471 virtual void VisitChildren(Visitor* visitor); 2491 virtual void VisitChildren(Visitor* visitor);
2472 2492
2473 bool IsConst() { return (flags_ & kFlagConst) == kFlagConst; } 2493 bool IsConst() { return (flags_ & kFlagConst) == kFlagConst; }
2474 bool IsFinal() { return (flags_ & kFlagFinal) == kFlagFinal; } 2494 bool IsFinal() { return (flags_ & kFlagFinal) == kFlagFinal; }
2475 2495
2476 String* name() { return name_; } 2496 String* name() { return name_; }
2477 DartType* type() { return type_; } 2497 DartType* type() { return type_; }
2478 InferredValue* inferred_value() { return inferred_value_; } 2498 InferredValue* inferred_value() { return inferred_value_; }
2479 Expression* initializer() { return initializer_; } 2499 Expression* initializer() { return initializer_; }
2500 TokenPosition end_position() { return end_position_; }
2480 2501
2481 private: 2502 private:
2482 VariableDeclaration() {} 2503 VariableDeclaration() : end_position_(TokenPosition::kNoSource) {}
2483 2504
2484 template <typename T> 2505 template <typename T>
2485 friend class List; 2506 friend class List;
2486 2507
2487 word flags_; 2508 word flags_;
2488 Ref<String> name_; 2509 Ref<String> name_;
2489 Child<DartType> type_; 2510 Child<DartType> type_;
2490 Child<InferredValue> inferred_value_; 2511 Child<InferredValue> inferred_value_;
2491 Child<Expression> initializer_; 2512 Child<Expression> initializer_;
2513 TokenPosition end_position_;
2492 2514
2493 DISALLOW_COPY_AND_ASSIGN(VariableDeclaration); 2515 DISALLOW_COPY_AND_ASSIGN(VariableDeclaration);
2494 }; 2516 };
2495 2517
2496 2518
2497 class FunctionDeclaration : public Statement { 2519 class FunctionDeclaration : public Statement {
2498 public: 2520 public:
2499 static FunctionDeclaration* ReadFrom(Reader* reader); 2521 static FunctionDeclaration* ReadFrom(Reader* reader);
2500 virtual void WriteTo(Writer* writer); 2522 virtual void WriteTo(Writer* writer);
2501 2523
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
3260 }; 3282 };
3261 3283
3262 3284
3263 void WritePrecompiledKernel(ByteWriter* out, kernel::Program* program); 3285 void WritePrecompiledKernel(ByteWriter* out, kernel::Program* program);
3264 3286
3265 3287
3266 } // namespace dart 3288 } // namespace dart
3267 3289
3268 #endif // !defined(DART_PRECOMPILED_RUNTIME) 3290 #endif // !defined(DART_PRECOMPILED_RUNTIME)
3269 #endif // RUNTIME_VM_KERNEL_H_ 3291 #endif // RUNTIME_VM_KERNEL_H_
OLDNEW
« no previous file with comments | « runtime/vm/debugger.cc ('k') | runtime/vm/kernel_binary.cc » ('j') | runtime/vm/kernel_binary.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698