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

Unified Diff: runtime/vm/code_generator.cc

Issue 800433004: Use a typed array for the irregexp stack. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: whitespace Created 5 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
Index: runtime/vm/code_generator.cc
diff --git a/runtime/vm/code_generator.cc b/runtime/vm/code_generator.cc
index 90e5ba5f7daf9d98d18dbdeeedbff4a9100ac361..73c4744db069492cd650a72dbf93d509b3a98ca0 100644
--- a/runtime/vm/code_generator.cc
+++ b/runtime/vm/code_generator.cc
@@ -1661,4 +1661,19 @@ DEFINE_RUNTIME_ENTRY(InitStaticField, 1) {
field.EvaluateInitializer();
}
+
+DEFINE_RUNTIME_ENTRY(GrowTypedData, 1) {
Vyacheslav Egorov (Google) 2015/01/20 16:26:24 The name is a bit confusing: but I can't come up w
zerny-google 2015/01/21 12:03:11 Since I've changed the call to take a typed-data c
Vyacheslav Egorov (Google) 2015/01/21 12:10:00 Agreed. Maybe GrowRegExpStack then?
+ const TypedData& old_data = TypedData::CheckedHandle(arguments.ArgAt(0));
+ ASSERT(!old_data.IsNull());
+ const intptr_t cid = old_data.GetClassId();
+ const intptr_t old_size = old_data.Length();
+ const intptr_t new_size = 2 * old_size;
+ const intptr_t elm_size = old_data.ElementSizeInBytes();
+ const TypedData& new_data =
+ TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld));
+ TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size);
+ arguments.SetReturn(new_data);
+}
+
+
} // namespace dart

Powered by Google App Engine
This is Rietveld 408576698