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

Unified Diff: runtime/vm/kernel_binary_flowgraph.cc

Issue 2860823002: Introduce classes for string and name indexes (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/kernel_binary_flowgraph.h ('k') | runtime/vm/kernel_reader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/kernel_binary_flowgraph.cc
diff --git a/runtime/vm/kernel_binary_flowgraph.cc b/runtime/vm/kernel_binary_flowgraph.cc
index 4c78fbf827b86b4b4c63a2a91c9a03dcb0d2b656..ca318176b4f2fc75745a7c9406ae88a344333d5f 100644
--- a/runtime/vm/kernel_binary_flowgraph.cc
+++ b/runtime/vm/kernel_binary_flowgraph.cc
@@ -60,7 +60,7 @@ Instance& StreamingConstantEvaluator::EvaluateExpression() {
void StreamingConstantEvaluator::EvaluateStaticGet() {
builder_->ReadPosition();
- intptr_t target = builder_->ReadUInt() - 1;
+ NameIndex target = builder_->ReadCanonicalNameReference();
if (H.IsField(target)) {
const dart::Field& field =
@@ -94,7 +94,7 @@ void StreamingConstantEvaluator::EvaluateStaticGet() {
void StreamingConstantEvaluator::EvaluateSymbolLiteral() {
- int str_index = builder_->ReadUInt();
+ StringIndex str_index(builder_->ReadUInt());
const dart::String& symbol_value = H.DartSymbol(str_index);
const dart::Class& symbol_class =
@@ -109,7 +109,7 @@ void StreamingConstantEvaluator::EvaluateSymbolLiteral() {
void StreamingConstantEvaluator::EvaluateDoubleLiteral() {
- int str_index = builder_->ReadUInt();
+ StringIndex str_index(builder_->ReadUInt());
result_ = dart::Double::New(H.DartString(str_index), Heap::kOld);
result_ = H.Canonicalize(result_);
}
@@ -335,6 +335,11 @@ intptr_t StreamingFlowGraphBuilder::ReadListLength() {
}
+NameIndex StreamingFlowGraphBuilder::ReadCanonicalNameReference() {
+ return reader_->ReadCanonicalNameReference();
+}
+
+
TokenPosition StreamingFlowGraphBuilder::ReadPosition(bool record) {
return reader_->ReadPosition(record);
}
@@ -419,7 +424,7 @@ Fragment StreamingFlowGraphBuilder::BuildInvalidExpression() {
Fragment StreamingFlowGraphBuilder::BuildStaticGet() {
intptr_t saved_offset = ReaderOffset() - 1; // Include the tag.
TokenPosition position = ReadPosition();
- intptr_t target = ReadUInt() - 1;
+ NameIndex target = ReadCanonicalNameReference();
if (H.IsField(target)) {
const dart::Field& field =
@@ -482,13 +487,13 @@ Fragment StreamingFlowGraphBuilder::BuildRethrow() {
Fragment StreamingFlowGraphBuilder::BuildBigIntLiteral() {
- const dart::String& value = H.DartString(ReadUInt());
+ const dart::String& value = H.DartString(StringIndex(ReadUInt()));
return Constant(Integer::ZoneHandle(Z, Integer::New(value, Heap::kOld)));
}
Fragment StreamingFlowGraphBuilder::BuildStringLiteral() {
- intptr_t str_index = ReadUInt();
+ StringIndex str_index(ReadUInt());
return Constant(H.DartSymbol(str_index));
}
« no previous file with comments | « runtime/vm/kernel_binary_flowgraph.h ('k') | runtime/vm/kernel_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698