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

Unified Diff: runtime/vm/parser.cc

Issue 10407018: Start porting fast typechecks to x64. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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
« runtime/vm/flow_graph_builder.cc ('K') | « runtime/vm/intermediate_language.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 7716)
+++ runtime/vm/parser.cc (working copy)
@@ -236,6 +236,7 @@
}
+// For parsing a compilation unit.
Parser::Parser(const Script& script,
const Library& library)
: script_(script),
@@ -256,6 +257,7 @@
}
+// For parsing a function.
Parser::Parser(const Script& script,
const Function& function,
intptr_t token_index)
@@ -274,6 +276,9 @@
ASSERT(!tokens_.IsNull());
ASSERT(!function.IsNull());
SetPosition(token_index);
+ if (FLAG_enable_type_checks) {
+ EnsureExpressionTemp();
+ }
}
@@ -5261,8 +5266,11 @@
// Make sure that the instantiator is captured.
CaptureReceiver();
}
- AstNode* exception_type = new TypeNode(catch_pos, *exception_param.type);
+ TypeNode* exception_type = new TypeNode(catch_pos, *exception_param.type);
AstNode* exception_var = new LoadLocalNode(catch_pos, *catch_excp_var);
+ if (!exception_type->type().IsInstantiated()) {
+ EnsureExpressionTemp();
+ }
AstNode* type_cond_expr = new ComparisonNode(
catch_pos, Token::kIS, exception_var, exception_type);
current_block_->statements->Add(
@@ -5842,6 +5850,11 @@
if (Token::IsRelationalOperator(op_kind)
|| Token::IsInstanceofOperator(op_kind)
|| Token::IsEqualityOperator(op_kind)) {
+ if (Token::IsInstanceofOperator(op_kind)) {
+ if (!right_operand->AsTypeNode()->type().IsInstantiated()) {
+ EnsureExpressionTemp();
+ }
+ }
left_operand = new ComparisonNode(
op_pos, op_kind, left_operand, right_operand);
break; // Equality and relational operators cannot be chained.
« runtime/vm/flow_graph_builder.cc ('K') | « runtime/vm/intermediate_language.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698