Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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()); |
| 481 } | 483 } |
| 482 | 484 |
| 483 DECLARE_COMPUTATION(InstanceCall) | 485 DECLARE_COMPUTATION(InstanceCall) |
| 484 | 486 |
| 485 intptr_t token_index() const { return token_index_; } | 487 intptr_t token_index() const { return token_index_; } |
| 486 intptr_t try_index() const { return try_index_; } | 488 intptr_t try_index() const { return try_index_; } |
| 487 const String& function_name() const { return function_name_; } | 489 const String& function_name() const { return function_name_; } |
| 490 Token::Kind token_kind() const { return token_kind_; } | |
| 488 intptr_t ArgumentCount() const { return arguments_->length(); } | 491 intptr_t ArgumentCount() const { return arguments_->length(); } |
| 489 Value* ArgumentAt(intptr_t index) const { return (*arguments_)[index]; } | 492 Value* ArgumentAt(intptr_t index) const { return (*arguments_)[index]; } |
| 490 const Array& argument_names() const { return argument_names_; } | 493 const Array& argument_names() const { return argument_names_; } |
| 491 intptr_t checked_argument_count() const { return checked_argument_count_; } | 494 intptr_t checked_argument_count() const { return checked_argument_count_; } |
| 492 | 495 |
| 493 virtual intptr_t InputCount() const; | 496 virtual intptr_t InputCount() const; |
| 494 virtual Value* InputAt(intptr_t i) const { return ArgumentAt(i); } | 497 virtual Value* InputAt(intptr_t i) const { return ArgumentAt(i); } |
| 495 | 498 |
| 496 virtual void PrintOperandsTo(BufferFormatter* f) const; | 499 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 497 | 500 |
| 498 private: | 501 private: |
| 499 const intptr_t token_index_; | 502 const intptr_t token_index_; |
| 500 const intptr_t try_index_; | 503 const intptr_t try_index_; |
| 501 const String& function_name_; | 504 const String& function_name_; |
| 505 const Token::Kind token_kind_; | |
|
Vyacheslav Egorov (Google)
2012/06/14 11:24:03
Please add a comment that it is expected to be bin
srdjan
2012/06/14 17:14:58
Added comment and assert
| |
| 502 ZoneGrowableArray<Value*>* const arguments_; | 506 ZoneGrowableArray<Value*>* const arguments_; |
| 503 const Array& argument_names_; | 507 const Array& argument_names_; |
| 504 const intptr_t checked_argument_count_; | 508 const intptr_t checked_argument_count_; |
| 505 | 509 |
| 506 DISALLOW_COPY_AND_ASSIGN(InstanceCallComp); | 510 DISALLOW_COPY_AND_ASSIGN(InstanceCallComp); |
| 507 }; | 511 }; |
| 508 | 512 |
| 509 | 513 |
| 510 class PolymorphicInstanceCallComp : public Computation { | 514 class PolymorphicInstanceCallComp : public Computation { |
| 511 public: | 515 public: |
| (...skipping 1848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2360 const GrowableArray<BlockEntryInstr*>& block_order_; | 2364 const GrowableArray<BlockEntryInstr*>& block_order_; |
| 2361 | 2365 |
| 2362 private: | 2366 private: |
| 2363 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 2367 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 2364 }; | 2368 }; |
| 2365 | 2369 |
| 2366 | 2370 |
| 2367 } // namespace dart | 2371 } // namespace dart |
| 2368 | 2372 |
| 2369 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 2373 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |