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

Unified Diff: runtime/vm/parser.cc

Issue 539153002: Port and integrate the irregexp engine from V8 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 5bad57247a806ced47b690dfd19c7bf1c34accee..79711bed56e2c05cf0df15ec70147823879e9008 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -223,6 +223,24 @@ void ParsedFunction::AllocateVariables() {
}
+void ParsedFunction::AllocateIrregexpVariables(intptr_t num_stack_locals) {
+ const intptr_t num_fixed_params = function().num_fixed_parameters();
+ const intptr_t num_opt_params = function().NumOptionalParameters();
+ const intptr_t num_params = num_fixed_params + num_opt_params;
+ // Compute start indices to parameters and locals, and the number of
+ // parameters to copy.
+ ASSERT(num_opt_params == 0);
+ // Parameter i will be at fp[kParamEndSlotFromFp + num_params - i] and
+ // local variable j will be at fp[kFirstLocalSlotFromFp - j].
+ first_parameter_index_ = kParamEndSlotFromFp + num_params;
+ first_stack_local_index_ = kFirstLocalSlotFromFp;
+ num_copied_params_ = 0;
+
+ // Frame indices are relative to the frame pointer and are decreasing.
+ num_stack_locals_ = num_stack_locals;
+}
+
+
struct Parser::Block : public ZoneAllocated {
Block(Block* outer_block, LocalScope* local_scope, SequenceNode* seq)
: parent(outer_block), scope(local_scope), statements(seq) {

Powered by Google App Engine
This is Rietveld 408576698