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

Side by Side Diff: runtime/vm/parser.cc

Issue 2411303003: Remove redundant code in parser. (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/parser.h" 5 #include "vm/parser.h"
6 #include "vm/flags.h" 6 #include "vm/flags.h"
7 7
8 #ifndef DART_PRECOMPILED_RUNTIME 8 #ifndef DART_PRECOMPILED_RUNTIME
9 9
10 #include "lib/invocation_mirror.h" 10 #include "lib/invocation_mirror.h"
(...skipping 10981 matching lines...) Expand 10 before | Expand all | Expand 10 after
10992 const TokenPosition type_pos = TokenPos(); 10992 const TokenPosition type_pos = TokenPos();
10993 const AbstractType& type = AbstractType::ZoneHandle(Z, 10993 const AbstractType& type = AbstractType::ZoneHandle(Z,
10994 ParseType(ClassFinalizer::kCanonicalize)); 10994 ParseType(ClassFinalizer::kCanonicalize));
10995 if (!type.IsInstantiated() && (FunctionLevel() > 0)) { 10995 if (!type.IsInstantiated() && (FunctionLevel() > 0)) {
10996 // Make sure that the instantiator is captured. 10996 // Make sure that the instantiator is captured.
10997 CaptureInstantiator(); 10997 CaptureInstantiator();
10998 } 10998 }
10999 right_operand = new(Z) TypeNode(type_pos, type); 10999 right_operand = new(Z) TypeNode(type_pos, type);
11000 // In production mode, the type may be malformed. 11000 // In production mode, the type may be malformed.
11001 // In checked mode, the type may be malformed or malbounded. 11001 // In checked mode, the type may be malformed or malbounded.
11002 if (((op_kind == Token::kIS) || (op_kind == Token::kISNOT) || 11002 if (type.IsMalformedOrMalbounded()) {
11003 (op_kind == Token::kAS)) &&
11004 type.IsMalformedOrMalbounded()) {
11005 // Note that a type error is thrown in a type test or in 11003 // Note that a type error is thrown in a type test or in
11006 // a type cast even if the tested value is null. 11004 // a type cast even if the tested value is null.
11007 // We need to evaluate the left operand for potential 11005 // We need to evaluate the left operand for potential
11008 // side effects. 11006 // side effects.
11009 LetNode* let = new(Z) LetNode(left_operand->token_pos()); 11007 LetNode* let = new(Z) LetNode(left_operand->token_pos());
11010 let->AddNode(left_operand); 11008 let->AddNode(left_operand);
11011 let->AddNode(ThrowTypeError(type_pos, type)); 11009 let->AddNode(ThrowTypeError(type_pos, type));
11012 left_operand = let; 11010 left_operand = let;
11013 break; // Type checks and casts can't be chained. 11011 break; // Type checks and casts can't be chained.
11014 } 11012 }
(...skipping 4079 matching lines...) Expand 10 before | Expand all | Expand 10 after
15094 const ArgumentListNode& function_args, 15092 const ArgumentListNode& function_args,
15095 const LocalVariable* temp_for_last_arg, 15093 const LocalVariable* temp_for_last_arg,
15096 bool is_super_invocation) { 15094 bool is_super_invocation) {
15097 UNREACHABLE(); 15095 UNREACHABLE();
15098 return NULL; 15096 return NULL;
15099 } 15097 }
15100 15098
15101 } // namespace dart 15099 } // namespace dart
15102 15100
15103 #endif // DART_PRECOMPILED_RUNTIME 15101 #endif // DART_PRECOMPILED_RUNTIME
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698