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

Unified Diff: runtime/vm/kernel_binary.cc

Issue 2656693006: Revert "Switched from GrowableArray to MallocGrowableArray to fix crash caused" (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/kernel_to_il.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/kernel_binary.cc
diff --git a/runtime/vm/kernel_binary.cc b/runtime/vm/kernel_binary.cc
index 2b7594e67d4a7713ff37c2b7ce6e18204d0e0e72..1f56c09be4e28396926cbec1b9673725f9df2d19 100644
--- a/runtime/vm/kernel_binary.cc
+++ b/runtime/vm/kernel_binary.cc
@@ -192,8 +192,8 @@ class BlockStack {
private:
int current_count_;
- MallocGrowableArray<T*> variables_;
- MallocGrowableArray<int> variable_count_;
+ std::vector<T*> variables_;
+ std::vector<int> variable_count_;
};
@@ -214,10 +214,9 @@ class BlockMap {
}
int Lookup(T* object) {
- typename MallocMap<T, int>::Pair* result = variables_.LookupPair(object);
- ASSERT(result != NULL);
- if (result == NULL) FATAL("lookup failure");
- return RawPointerKeyValueTrait<T, int>::ValueOf(*result);
+ ASSERT(variables_.find(object) != variables_.end());
+ if (variables_.find(object) == variables_.end()) FATAL("lookup failure");
+ return variables_[object];
}
void Push(T* v) {
@@ -226,11 +225,7 @@ class BlockMap {
current_count_++;
}
- void Set(T* v, int index) {
- typename MallocMap<T, int>::Pair* entry = variables_.LookupPair(v);
- ASSERT(entry != NULL);
- entry->value = index;
- }
+ void Set(T* v, int index) { variables_[v] = index; }
void Push(List<T>* decl) {
for (int i = 0; i < decl->length(); i++) {
@@ -246,8 +241,8 @@ class BlockMap {
private:
int current_count_;
int stack_height_;
- MallocMap<T, int> variables_;
- MallocGrowableArray<int> variable_count_;
+ std::map<T*, int> variables_;
+ std::vector<int> variable_count_;
};
« no previous file with comments | « no previous file | runtime/vm/kernel_to_il.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698