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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart

Issue 1134063002: dart2js cps: Introduce GetStatic/SetStatic. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix SExpression parsing/unparsing Created 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library dart2js.ir_nodes_sexpr; 5 library dart2js.ir_nodes_sexpr;
6 6
7 import '../constants/values.dart'; 7 import '../constants/values.dart';
8 import '../util/util.dart'; 8 import '../util/util.dart';
9 import 'cps_ir_nodes.dart'; 9 import 'cps_ir_nodes.dart';
10 10
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 String body = indentBlock(() => visit(node.body)); 328 String body = indentBlock(() => visit(node.body));
329 return '$indentation(SetField $object $field $value)\n$body'; 329 return '$indentation(SetField $object $field $value)\n$body';
330 } 330 }
331 331
332 String visitGetField(GetField node) { 332 String visitGetField(GetField node) {
333 String object = access(node.object); 333 String object = access(node.object);
334 String field = node.field.name; 334 String field = node.field.name;
335 return '(GetField $object $field)'; 335 return '(GetField $object $field)';
336 } 336 }
337 337
338 String visitGetStatic(GetStatic node) {
339 String element = node.element.name;
340 return '(GetStatic $element)';
341 }
342
343 String visitSetStatic(SetStatic node) {
344 String element = node.element.name;
345 String value = access(node.value);
346 String body = indentBlock(() => visit(node.body));
347 return '$indentation(SetStatic $element $value\n$body)';
348 }
349
338 String visitCreateBox(CreateBox node) { 350 String visitCreateBox(CreateBox node) {
339 return '(CreateBox)'; 351 return '(CreateBox)';
340 } 352 }
341 353
342 String visitCreateInstance(CreateInstance node) { 354 String visitCreateInstance(CreateInstance node) {
343 String className = node.classElement.name; 355 String className = node.classElement.name;
344 String arguments = node.arguments.map(access).join(' '); 356 String arguments = node.arguments.map(access).join(' ');
345 String typeInformation = node.typeInformation.map(access).join(' '); 357 String typeInformation = node.typeInformation.map(access).join(' ');
346 return '(CreateInstance $className ($arguments)$typeInformation)'; 358 return '(CreateInstance $className ($arguments)$typeInformation)';
347 } 359 }
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 void setReturnContinuation(Continuation node) { 498 void setReturnContinuation(Continuation node) {
487 assert(!_names.containsKey(node) || _names[node] == 'return'); 499 assert(!_names.containsKey(node) || _names[node] == 'return');
488 _names[node] = 'return'; 500 _names[node] = 'return';
489 } 501 }
490 502
491 String getName(Node node) { 503 String getName(Node node) {
492 if (!_names.containsKey(node)) return 'MISSING_NAME'; 504 if (!_names.containsKey(node)) return 'MISSING_NAME';
493 return _names[node]; 505 return _names[node];
494 } 506 }
495 } 507 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698