Index: runtime/vm/kernel_binary.h |
diff --git a/runtime/vm/kernel_binary.h b/runtime/vm/kernel_binary.h |
index 08fe8939501f7319f50c8b709af7eee7d9e6f297..51cc850aced9822a4de07565a0a6acc487f7e90b 100644 |
--- a/runtime/vm/kernel_binary.h |
+++ b/runtime/vm/kernel_binary.h |
@@ -267,19 +267,6 @@ class TypeParameterScope { |
}; |
-template <typename T> |
-class SwitchCaseScope { |
- public: |
- explicit SwitchCaseScope(T* builder) : builder_(builder) { |
- builder_->switch_cases().EnterScope(); |
- } |
- ~SwitchCaseScope() { builder_->switch_cases().LeaveScope(); } |
- |
- private: |
- T* builder_; |
-}; |
- |
- |
// Unlike other scopes, labels from enclosing functions are not visible in |
// nested functions. The LabelScope class is used to hide outer labels. |
template <typename Builder, typename Block> |
@@ -307,7 +294,6 @@ class ReaderHelper { |
BlockStack<VariableDeclaration>& variables() { return scope_; } |
BlockStack<TypeParameter>& type_parameters() { return type_parameters_; } |
- BlockStack<SwitchCase>& switch_cases() { return switch_cases_; } |
BlockStack<LabeledStatement>* labels() { return labels_; } |
void set_labels(BlockStack<LabeledStatement>* labels) { labels_ = labels; } |
@@ -323,7 +309,6 @@ class ReaderHelper { |
MallocGrowableArray<CanonicalName*> canonical_names_; |
BlockStack<VariableDeclaration> scope_; |
BlockStack<TypeParameter> type_parameters_; |
- BlockStack<SwitchCase> switch_cases_; |
BlockStack<LabeledStatement>* labels_; |
}; |
@@ -427,6 +412,8 @@ class Reader { |
uint8_t ReadByte() { return buffer_[offset_++]; } |
+ uint8_t PeekByte() { return buffer_[offset_]; } |
+ |
bool ReadBool() { return (ReadByte() & 1) == 1; } |
word ReadFlags() { return ReadByte(); } |
@@ -444,6 +431,19 @@ class Reader { |
} |
} |
+ Tag PeekTag(uint8_t* payload = NULL) { |
+ uint8_t byte = PeekByte(); |
+ bool has_payload = (byte & kSpecializedTagHighBit) != 0; |
+ if (has_payload) { |
+ if (payload != NULL) { |
+ *payload = byte & kSpecializedPayloadMask; |
+ } |
+ return static_cast<Tag>(byte & kSpecializedTagMask); |
+ } else { |
+ return static_cast<Tag>(byte); |
+ } |
+ } |
+ |
const uint8_t* Consume(int count) { |
ASSERT(offset_ + count <= size_); |
const uint8_t* old = buffer_ + offset_; |