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

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

Issue 2778693002: [kernel] Don't use kernel ast nodes as keys (Closed)
Patch Set: Remove reinterpret_cast that dartium-win-ia32-be doesn't like 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
« no previous file with comments | « no previous file | runtime/vm/kernel_binary.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 427
428 428
429 class TreeNode : public Node { 429 class TreeNode : public Node {
430 public: 430 public:
431 virtual ~TreeNode(); 431 virtual ~TreeNode();
432 432
433 DEFINE_CASTING_OPERATIONS(TreeNode); 433 DEFINE_CASTING_OPERATIONS(TreeNode);
434 434
435 virtual void AcceptVisitor(Visitor* visitor); 435 virtual void AcceptVisitor(Visitor* visitor);
436 virtual void AcceptTreeVisitor(TreeVisitor* visitor) = 0; 436 virtual void AcceptTreeVisitor(TreeVisitor* visitor) = 0;
437 intptr_t kernel_offset() { return kernel_offset_; }
437 438
438 protected: 439 protected:
439 TreeNode() {} 440 TreeNode() : kernel_offset_(-1) {}
441
442 // Offset for this node in the kernel-binary. If this node has a tag the
443 // offset includes the tag. Can be -1 to indicate "unknown" or invalid offset.
444 intptr_t kernel_offset_;
440 445
441 private: 446 private:
442 DISALLOW_COPY_AND_ASSIGN(TreeNode); 447 DISALLOW_COPY_AND_ASSIGN(TreeNode);
443 }; 448 };
444 449
445 450
446 class LinkedNode : public TreeNode { 451 class LinkedNode : public TreeNode {
447 public: 452 public:
448 virtual ~LinkedNode(); 453 virtual ~LinkedNode();
449 454
(...skipping 1993 matching lines...) Expand 10 before | Expand all | Expand 10 after
2443 2448
2444 2449
2445 class VariableDeclaration : public Statement { 2450 class VariableDeclaration : public Statement {
2446 public: 2451 public:
2447 enum Flags { 2452 enum Flags {
2448 kFlagFinal = 1 << 0, 2453 kFlagFinal = 1 << 0,
2449 kFlagConst = 1 << 1, 2454 kFlagConst = 1 << 1,
2450 }; 2455 };
2451 2456
2452 static VariableDeclaration* ReadFrom(Reader* reader); 2457 static VariableDeclaration* ReadFrom(Reader* reader);
2453 static VariableDeclaration* ReadFromImpl(Reader* reader); 2458 static VariableDeclaration* ReadFromImpl(Reader* reader, bool read_tag);
2454 2459
2455 virtual ~VariableDeclaration(); 2460 virtual ~VariableDeclaration();
2456 2461
2457 DEFINE_CASTING_OPERATIONS(VariableDeclaration); 2462 DEFINE_CASTING_OPERATIONS(VariableDeclaration);
2458 2463
2459 virtual void AcceptStatementVisitor(StatementVisitor* visitor); 2464 virtual void AcceptStatementVisitor(StatementVisitor* visitor);
2460 virtual void VisitChildren(Visitor* visitor); 2465 virtual void VisitChildren(Visitor* visitor);
2461 2466
2462 bool IsConst() { return (flags_ & kFlagConst) == kFlagConst; } 2467 bool IsConst() { return (flags_ & kFlagConst) == kFlagConst; }
2463 bool IsFinal() { return (flags_ & kFlagFinal) == kFlagFinal; } 2468 bool IsFinal() { return (flags_ & kFlagFinal) == kFlagFinal; }
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
3182 3187
3183 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, 3188 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer,
3184 intptr_t buffer_length); 3189 intptr_t buffer_length);
3185 3190
3186 3191
3187 3192
3188 } // namespace dart 3193 } // namespace dart
3189 3194
3190 #endif // !defined(DART_PRECOMPILED_RUNTIME) 3195 #endif // !defined(DART_PRECOMPILED_RUNTIME)
3191 #endif // RUNTIME_VM_KERNEL_H_ 3196 #endif // RUNTIME_VM_KERNEL_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/kernel_binary.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698