Index: runtime/vm/kernel_binary.h |
diff --git a/runtime/vm/kernel_binary.h b/runtime/vm/kernel_binary.h |
index b8ae51c3b3b78b455c95b06ed5f99cd61d4c537c..0e6459f1dceb1a792e09f902aa1999ad42890ffb 100644 |
--- a/runtime/vm/kernel_binary.h |
+++ b/runtime/vm/kernel_binary.h |
@@ -268,19 +268,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> |
@@ -308,7 +295,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; } |
@@ -317,7 +303,6 @@ class ReaderHelper { |
Program* program_; |
BlockStack<VariableDeclaration> scope_; |
BlockStack<TypeParameter> type_parameters_; |
- BlockStack<SwitchCase> switch_cases_; |
BlockStack<LabeledStatement>* labels_; |
}; |
@@ -422,6 +407,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(); } |
@@ -439,6 +426,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_; |