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

Unified Diff: runtime/vm/intermediate_language.h

Issue 2950783003: VM(RegExp): Allow OSR optimization of RegExp :matcher functions. (Closed)
Patch Set: Created 3 years, 6 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/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 588d082bc70a03551fc685729f18f6c3db2a823a..a00be28e4f53a3468bf8838ed7cc517cca17cc4a 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -7266,12 +7266,26 @@ class UnaryDoubleOpInstr : public TemplateDefinition<1, NoThrow, Pure> {
class CheckStackOverflowInstr : public TemplateInstruction<0, NoThrow> {
public:
+ enum Kind {
+ // Full stack overflow checks are emitted in both unoptimized and
+ // optimized versions of the code.
+ kFull,
+
+ // OsrEntry stack overflow checks are only needed in the unoptimized code
+ // because we can't OSR optimized code.
+ kOsrEntry,
+ };
+
CheckStackOverflowInstr(TokenPosition token_pos,
intptr_t loop_depth,
- intptr_t deopt_id)
+ intptr_t deopt_id,
+ Kind kind = kFull)
: TemplateInstruction(deopt_id),
token_pos_(token_pos),
- loop_depth_(loop_depth) {}
+ loop_depth_(loop_depth),
+ kind_(kind) {
+ ASSERT(kind != kOsrEntry || loop_depth > 0);
+ }
virtual TokenPosition token_pos() const { return token_pos_; }
bool in_loop() const { return loop_depth_ > 0; }
@@ -7281,6 +7295,8 @@ class CheckStackOverflowInstr : public TemplateInstruction<0, NoThrow> {
virtual bool ComputeCanDeoptimize() const { return true; }
+ virtual Instruction* Canonicalize(FlowGraph* flow_graph);
+
virtual EffectSet Effects() const { return EffectSet::None(); }
PRINT_OPERANDS_TO_SUPPORT
@@ -7288,6 +7304,7 @@ class CheckStackOverflowInstr : public TemplateInstruction<0, NoThrow> {
private:
const TokenPosition token_pos_;
const intptr_t loop_depth_;
+ const Kind kind_;
DISALLOW_COPY_AND_ASSIGN(CheckStackOverflowInstr);
};

Powered by Google App Engine
This is Rietveld 408576698