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

Side by Side Diff: runtime/vm/intermediate_language.h

Issue 10536162: Add token kind into InstanceCallComp so that we do not need to extract it from name (addresses vego… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/token.h » ('j') | 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 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_
6 #define VM_INTERMEDIATE_LANGUAGE_H_ 6 #define VM_INTERMEDIATE_LANGUAGE_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/ast.h" 9 #include "vm/ast.h"
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 459
460 DISALLOW_COPY_AND_ASSIGN(ClosureCallComp); 460 DISALLOW_COPY_AND_ASSIGN(ClosureCallComp);
461 }; 461 };
462 462
463 463
464 class InstanceCallComp : public Computation { 464 class InstanceCallComp : public Computation {
465 public: 465 public:
466 InstanceCallComp(intptr_t token_index, 466 InstanceCallComp(intptr_t token_index,
467 intptr_t try_index, 467 intptr_t try_index,
468 const String& function_name, 468 const String& function_name,
469 Token::Kind token_kind,
469 ZoneGrowableArray<Value*>* arguments, 470 ZoneGrowableArray<Value*>* arguments,
470 const Array& argument_names, 471 const Array& argument_names,
471 intptr_t checked_argument_count) 472 intptr_t checked_argument_count)
472 : token_index_(token_index), 473 : token_index_(token_index),
473 try_index_(try_index), 474 try_index_(try_index),
474 function_name_(function_name), 475 function_name_(function_name),
476 token_kind_(token_kind),
475 arguments_(arguments), 477 arguments_(arguments),
476 argument_names_(argument_names), 478 argument_names_(argument_names),
477 checked_argument_count_(checked_argument_count) { 479 checked_argument_count_(checked_argument_count) {
478 ASSERT(function_name.IsZoneHandle()); 480 ASSERT(function_name.IsZoneHandle());
479 ASSERT(!arguments->is_empty()); 481 ASSERT(!arguments->is_empty());
480 ASSERT(argument_names.IsZoneHandle()); 482 ASSERT(argument_names.IsZoneHandle());
483 ASSERT(Token::IsBinaryToken(token_kind) ||
484 Token::IsUnaryToken(token_kind) ||
485 token_kind == Token::kGET);
481 } 486 }
482 487
483 DECLARE_COMPUTATION(InstanceCall) 488 DECLARE_COMPUTATION(InstanceCall)
484 489
485 intptr_t token_index() const { return token_index_; } 490 intptr_t token_index() const { return token_index_; }
486 intptr_t try_index() const { return try_index_; } 491 intptr_t try_index() const { return try_index_; }
487 const String& function_name() const { return function_name_; } 492 const String& function_name() const { return function_name_; }
493 Token::Kind token_kind() const { return token_kind_; }
488 intptr_t ArgumentCount() const { return arguments_->length(); } 494 intptr_t ArgumentCount() const { return arguments_->length(); }
489 Value* ArgumentAt(intptr_t index) const { return (*arguments_)[index]; } 495 Value* ArgumentAt(intptr_t index) const { return (*arguments_)[index]; }
490 const Array& argument_names() const { return argument_names_; } 496 const Array& argument_names() const { return argument_names_; }
491 intptr_t checked_argument_count() const { return checked_argument_count_; } 497 intptr_t checked_argument_count() const { return checked_argument_count_; }
492 498
493 virtual intptr_t InputCount() const; 499 virtual intptr_t InputCount() const;
494 virtual Value* InputAt(intptr_t i) const { return ArgumentAt(i); } 500 virtual Value* InputAt(intptr_t i) const { return ArgumentAt(i); }
495 501
496 virtual void PrintOperandsTo(BufferFormatter* f) const; 502 virtual void PrintOperandsTo(BufferFormatter* f) const;
497 503
498 private: 504 private:
499 const intptr_t token_index_; 505 const intptr_t token_index_;
500 const intptr_t try_index_; 506 const intptr_t try_index_;
501 const String& function_name_; 507 const String& function_name_;
508 const Token::Kind token_kind_; // Binary op, unary op or kGET.
502 ZoneGrowableArray<Value*>* const arguments_; 509 ZoneGrowableArray<Value*>* const arguments_;
503 const Array& argument_names_; 510 const Array& argument_names_;
504 const intptr_t checked_argument_count_; 511 const intptr_t checked_argument_count_;
505 512
506 DISALLOW_COPY_AND_ASSIGN(InstanceCallComp); 513 DISALLOW_COPY_AND_ASSIGN(InstanceCallComp);
507 }; 514 };
508 515
509 516
510 class PolymorphicInstanceCallComp : public Computation { 517 class PolymorphicInstanceCallComp : public Computation {
511 public: 518 public:
(...skipping 1848 matching lines...) Expand 10 before | Expand all | Expand 10 after
2360 const GrowableArray<BlockEntryInstr*>& block_order_; 2367 const GrowableArray<BlockEntryInstr*>& block_order_;
2361 2368
2362 private: 2369 private:
2363 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 2370 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
2364 }; 2371 };
2365 2372
2366 2373
2367 } // namespace dart 2374 } // namespace dart
2368 2375
2369 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 2376 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/token.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698