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

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

Issue 10915026: We can throw an exception but we cannot deoptimize at a runtime call. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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/il_printer.cc ('k') | runtime/vm/intermediate_language.cc » ('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 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 bool is_eliminated() const { 495 bool is_eliminated() const {
496 return is_eliminated_; 496 return is_eliminated_;
497 } 497 }
498 void eliminate() { 498 void eliminate() {
499 ASSERT(!is_eliminated_); 499 ASSERT(!is_eliminated_);
500 is_eliminated_ = true; 500 is_eliminated_ = true;
501 } 501 }
502 502
503 virtual void PrintOperandsTo(BufferFormatter* f) const; 503 virtual void PrintOperandsTo(BufferFormatter* f) const;
504 504
505 virtual bool CanDeoptimize() const { return true; } 505 virtual bool CanDeoptimize() const { return false; }
506 virtual intptr_t ResultCid() const { return kDynamicCid; } 506 virtual intptr_t ResultCid() const { return kDynamicCid; }
507 507
508 private: 508 private:
509 const intptr_t token_pos_; 509 const intptr_t token_pos_;
510 const AbstractType& dst_type_; 510 const AbstractType& dst_type_;
511 const String& dst_name_; 511 const String& dst_name_;
512 bool is_eliminated_; 512 bool is_eliminated_;
513 513
514 DISALLOW_COPY_AND_ASSIGN(AssertAssignableComp); 514 DISALLOW_COPY_AND_ASSIGN(AssertAssignableComp);
515 }; 515 };
(...skipping 17 matching lines...) Expand all
533 bool is_eliminated() const { 533 bool is_eliminated() const {
534 return is_eliminated_; 534 return is_eliminated_;
535 } 535 }
536 void eliminate() { 536 void eliminate() {
537 ASSERT(!is_eliminated_); 537 ASSERT(!is_eliminated_);
538 is_eliminated_ = true; 538 is_eliminated_ = true;
539 } 539 }
540 540
541 virtual void PrintOperandsTo(BufferFormatter* f) const; 541 virtual void PrintOperandsTo(BufferFormatter* f) const;
542 542
543 virtual bool CanDeoptimize() const { return true; } 543 virtual bool CanDeoptimize() const { return false; }
544 virtual intptr_t ResultCid() const { return kBoolCid; } 544 virtual intptr_t ResultCid() const { return kBoolCid; }
545 545
546 private: 546 private:
547 const intptr_t token_pos_; 547 const intptr_t token_pos_;
548 bool is_eliminated_; 548 bool is_eliminated_;
549 549
550 DISALLOW_COPY_AND_ASSIGN(AssertBooleanComp); 550 DISALLOW_COPY_AND_ASSIGN(AssertBooleanComp);
551 }; 551 };
552 552
553 553
(...skipping 12 matching lines...) Expand all
566 intptr_t formal_parameter_index() const { 566 intptr_t formal_parameter_index() const {
567 return ast_node_.formal_parameter_index(); 567 return ast_node_.formal_parameter_index();
568 } 568 }
569 const String& formal_parameter_name() const { 569 const String& formal_parameter_name() const {
570 return ast_node_.formal_parameter_name(); 570 return ast_node_.formal_parameter_name();
571 } 571 }
572 Value* saved_arguments_descriptor() const { return inputs_[0]; } 572 Value* saved_arguments_descriptor() const { return inputs_[0]; }
573 573
574 virtual void PrintOperandsTo(BufferFormatter* f) const; 574 virtual void PrintOperandsTo(BufferFormatter* f) const;
575 575
576 virtual bool CanDeoptimize() const { return true; } 576 virtual bool CanDeoptimize() const { return false; }
577 virtual intptr_t ResultCid() const { return kBoolCid; } 577 virtual intptr_t ResultCid() const { return kBoolCid; }
578 578
579 private: 579 private:
580 const ArgumentDefinitionTestNode& ast_node_; 580 const ArgumentDefinitionTestNode& ast_node_;
581 581
582 DISALLOW_COPY_AND_ASSIGN(ArgumentDefinitionTestComp); 582 DISALLOW_COPY_AND_ASSIGN(ArgumentDefinitionTestComp);
583 }; 583 };
584 584
585 585
586 // Denotes the current context, normally held in a register. This is 586 // Denotes the current context, normally held in a register. This is
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
1228 Value* value() const { return inputs_[0]; } 1228 Value* value() const { return inputs_[0]; }
1229 Value* instantiator() const { return inputs_[1]; } 1229 Value* instantiator() const { return inputs_[1]; }
1230 Value* instantiator_type_arguments() const { return inputs_[2]; } 1230 Value* instantiator_type_arguments() const { return inputs_[2]; }
1231 1231
1232 bool negate_result() const { return negate_result_; } 1232 bool negate_result() const { return negate_result_; }
1233 const AbstractType& type() const { return type_; } 1233 const AbstractType& type() const { return type_; }
1234 intptr_t token_pos() const { return token_pos_; } 1234 intptr_t token_pos() const { return token_pos_; }
1235 1235
1236 virtual void PrintOperandsTo(BufferFormatter* f) const; 1236 virtual void PrintOperandsTo(BufferFormatter* f) const;
1237 1237
1238 virtual bool CanDeoptimize() const { return true; } 1238 virtual bool CanDeoptimize() const { return false; }
1239 virtual intptr_t ResultCid() const { return kBoolCid; } 1239 virtual intptr_t ResultCid() const { return kBoolCid; }
1240 1240
1241 private: 1241 private:
1242 const intptr_t token_pos_; 1242 const intptr_t token_pos_;
1243 Value* value_; 1243 Value* value_;
1244 Value* instantiator_; 1244 Value* instantiator_;
1245 Value* type_arguments_; 1245 Value* type_arguments_;
1246 const AbstractType& type_; 1246 const AbstractType& type_;
1247 const bool negate_result_; 1247 const bool negate_result_;
1248 1248
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
1294 inputs_[1] = instantiator; 1294 inputs_[1] = instantiator;
1295 } 1295 }
1296 1296
1297 DECLARE_COMPUTATION(AllocateObjectWithBoundsCheck) 1297 DECLARE_COMPUTATION(AllocateObjectWithBoundsCheck)
1298 1298
1299 const Function& constructor() const { return ast_node_.constructor(); } 1299 const Function& constructor() const { return ast_node_.constructor(); }
1300 intptr_t token_pos() const { return ast_node_.token_pos(); } 1300 intptr_t token_pos() const { return ast_node_.token_pos(); }
1301 1301
1302 virtual void PrintOperandsTo(BufferFormatter* f) const; 1302 virtual void PrintOperandsTo(BufferFormatter* f) const;
1303 1303
1304 virtual bool CanDeoptimize() const { return true; } 1304 virtual bool CanDeoptimize() const { return false; }
1305 virtual intptr_t ResultCid() const { return kDynamicCid; } 1305 virtual intptr_t ResultCid() const { return kDynamicCid; }
1306 1306
1307 private: 1307 private:
1308 const ConstructorCallNode& ast_node_; 1308 const ConstructorCallNode& ast_node_;
1309 1309
1310 DISALLOW_COPY_AND_ASSIGN(AllocateObjectWithBoundsCheckComp); 1310 DISALLOW_COPY_AND_ASSIGN(AllocateObjectWithBoundsCheckComp);
1311 }; 1311 };
1312 1312
1313 1313
1314 class CreateArrayComp : public TemplateComputation<1> { 1314 class CreateArrayComp : public TemplateComputation<1> {
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
1468 DECLARE_COMPUTATION(InstantiateTypeArguments) 1468 DECLARE_COMPUTATION(InstantiateTypeArguments)
1469 1469
1470 Value* instantiator() const { return inputs_[0]; } 1470 Value* instantiator() const { return inputs_[0]; }
1471 const AbstractTypeArguments& type_arguments() const { 1471 const AbstractTypeArguments& type_arguments() const {
1472 return type_arguments_; 1472 return type_arguments_;
1473 } 1473 }
1474 intptr_t token_pos() const { return token_pos_; } 1474 intptr_t token_pos() const { return token_pos_; }
1475 1475
1476 virtual void PrintOperandsTo(BufferFormatter* f) const; 1476 virtual void PrintOperandsTo(BufferFormatter* f) const;
1477 1477
1478 virtual bool CanDeoptimize() const { return true; } 1478 virtual bool CanDeoptimize() const { return false; }
1479 virtual intptr_t ResultCid() const { return kDynamicCid; } 1479 virtual intptr_t ResultCid() const { return kDynamicCid; }
1480 1480
1481 private: 1481 private:
1482 const intptr_t token_pos_; 1482 const intptr_t token_pos_;
1483 const AbstractTypeArguments& type_arguments_; 1483 const AbstractTypeArguments& type_arguments_;
1484 1484
1485 DISALLOW_COPY_AND_ASSIGN(InstantiateTypeArgumentsComp); 1485 DISALLOW_COPY_AND_ASSIGN(InstantiateTypeArgumentsComp);
1486 }; 1486 };
1487 1487
1488 1488
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
1598 : token_pos_(token_pos) { 1598 : token_pos_(token_pos) {
1599 ASSERT(context_value != NULL); 1599 ASSERT(context_value != NULL);
1600 inputs_[0] = context_value; 1600 inputs_[0] = context_value;
1601 } 1601 }
1602 1602
1603 intptr_t token_pos() const { return token_pos_; } 1603 intptr_t token_pos() const { return token_pos_; }
1604 Value* context_value() const { return inputs_[0]; } 1604 Value* context_value() const { return inputs_[0]; }
1605 1605
1606 DECLARE_COMPUTATION(CloneContext) 1606 DECLARE_COMPUTATION(CloneContext)
1607 1607
1608 virtual bool CanDeoptimize() const { return true; } 1608 virtual bool CanDeoptimize() const { return false; }
1609 virtual intptr_t ResultCid() const { return kIllegalCid; } 1609 virtual intptr_t ResultCid() const { return kIllegalCid; }
1610 1610
1611 private: 1611 private:
1612 const intptr_t token_pos_; 1612 const intptr_t token_pos_;
1613 1613
1614 DISALLOW_COPY_AND_ASSIGN(CloneContextComp); 1614 DISALLOW_COPY_AND_ASSIGN(CloneContextComp);
1615 }; 1615 };
1616 1616
1617 1617
1618 class CatchEntryComp : public TemplateComputation<0> { 1618 class CatchEntryComp : public TemplateComputation<0> {
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
1949 1949
1950 class CheckStackOverflowComp : public TemplateComputation<0> { 1950 class CheckStackOverflowComp : public TemplateComputation<0> {
1951 public: 1951 public:
1952 explicit CheckStackOverflowComp(intptr_t token_pos) 1952 explicit CheckStackOverflowComp(intptr_t token_pos)
1953 : token_pos_(token_pos) {} 1953 : token_pos_(token_pos) {}
1954 1954
1955 intptr_t token_pos() const { return token_pos_; } 1955 intptr_t token_pos() const { return token_pos_; }
1956 1956
1957 DECLARE_COMPUTATION(CheckStackOverflow) 1957 DECLARE_COMPUTATION(CheckStackOverflow)
1958 1958
1959 virtual bool CanDeoptimize() const { return true; } 1959 virtual bool CanDeoptimize() const { return false; }
1960 virtual intptr_t ResultCid() const { return kIllegalCid; } 1960 virtual intptr_t ResultCid() const { return kIllegalCid; }
1961 1961
1962 private: 1962 private:
1963 const intptr_t token_pos_; 1963 const intptr_t token_pos_;
1964 1964
1965 DISALLOW_COPY_AND_ASSIGN(CheckStackOverflowComp); 1965 DISALLOW_COPY_AND_ASSIGN(CheckStackOverflowComp);
1966 }; 1966 };
1967 1967
1968 1968
1969 class DoubleToDoubleComp : public TemplateComputation<1> { 1969 class DoubleToDoubleComp : public TemplateComputation<1> {
(...skipping 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after
3057 private: 3057 private:
3058 const intptr_t deopt_id_; 3058 const intptr_t deopt_id_;
3059 const intptr_t token_pos_; 3059 const intptr_t token_pos_;
3060 3060
3061 DISALLOW_COPY_AND_ASSIGN(ReturnInstr); 3061 DISALLOW_COPY_AND_ASSIGN(ReturnInstr);
3062 }; 3062 };
3063 3063
3064 3064
3065 class ThrowInstr : public TemplateInstruction<0> { 3065 class ThrowInstr : public TemplateInstruction<0> {
3066 public: 3066 public:
3067 explicit ThrowInstr(intptr_t token_pos) 3067 explicit ThrowInstr(intptr_t token_pos) : token_pos_(token_pos) { }
3068 : deopt_id_(Isolate::Current()->GetNextDeoptId()),
3069 token_pos_(token_pos) { }
3070 3068
3071 DECLARE_INSTRUCTION(Throw) 3069 DECLARE_INSTRUCTION(Throw)
3072 3070
3073 virtual intptr_t ArgumentCount() const { return 1; } 3071 virtual intptr_t ArgumentCount() const { return 1; }
3074 3072
3075 intptr_t deopt_id() const { return deopt_id_; }
3076 intptr_t token_pos() const { return token_pos_; } 3073 intptr_t token_pos() const { return token_pos_; }
3077 3074
3078 virtual LocationSummary* MakeLocationSummary() const; 3075 virtual LocationSummary* MakeLocationSummary() const;
3079 3076
3080 virtual void EmitNativeCode(FlowGraphCompiler* compiler); 3077 virtual void EmitNativeCode(FlowGraphCompiler* compiler);
3081 3078
3082 virtual bool CanDeoptimize() const { return false; } 3079 virtual bool CanDeoptimize() const { return false; }
3083 3080
3084 private: 3081 private:
3085 const intptr_t deopt_id_;
3086 const intptr_t token_pos_; 3082 const intptr_t token_pos_;
3087 3083
3088 DISALLOW_COPY_AND_ASSIGN(ThrowInstr); 3084 DISALLOW_COPY_AND_ASSIGN(ThrowInstr);
3089 }; 3085 };
3090 3086
3091 3087
3092 class ReThrowInstr : public TemplateInstruction<0> { 3088 class ReThrowInstr : public TemplateInstruction<0> {
3093 public: 3089 public:
3094 explicit ReThrowInstr(intptr_t token_pos) 3090 explicit ReThrowInstr(intptr_t token_pos) : token_pos_(token_pos) { }
3095 : deopt_id_(Isolate::Current()->GetNextDeoptId()),
3096 token_pos_(token_pos) { }
3097 3091
3098 DECLARE_INSTRUCTION(ReThrow) 3092 DECLARE_INSTRUCTION(ReThrow)
3099 3093
3100 virtual intptr_t ArgumentCount() const { return 2; } 3094 virtual intptr_t ArgumentCount() const { return 2; }
3101 3095
3102 intptr_t deopt_id() const { return deopt_id_; }
3103 intptr_t token_pos() const { return token_pos_; } 3096 intptr_t token_pos() const { return token_pos_; }
3104 3097
3105 virtual LocationSummary* MakeLocationSummary() const; 3098 virtual LocationSummary* MakeLocationSummary() const;
3106 3099
3107 virtual void EmitNativeCode(FlowGraphCompiler* compiler); 3100 virtual void EmitNativeCode(FlowGraphCompiler* compiler);
3108 3101
3109 virtual bool CanDeoptimize() const { return false; } 3102 virtual bool CanDeoptimize() const { return false; }
3110 3103
3111 private: 3104 private:
3112 const intptr_t deopt_id_;
3113 const intptr_t token_pos_; 3105 const intptr_t token_pos_;
3114 3106
3115 DISALLOW_COPY_AND_ASSIGN(ReThrowInstr); 3107 DISALLOW_COPY_AND_ASSIGN(ReThrowInstr);
3116 }; 3108 };
3117 3109
3118 3110
3119 class GotoInstr : public TemplateInstruction<0> { 3111 class GotoInstr : public TemplateInstruction<0> {
3120 public: 3112 public:
3121 explicit GotoInstr(JoinEntryInstr* entry) 3113 explicit GotoInstr(JoinEntryInstr* entry)
3122 : successor_(entry), 3114 : successor_(entry),
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
3337 ForwardInstructionIterator* current_iterator_; 3329 ForwardInstructionIterator* current_iterator_;
3338 3330
3339 private: 3331 private:
3340 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 3332 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
3341 }; 3333 };
3342 3334
3343 3335
3344 } // namespace dart 3336 } // namespace dart
3345 3337
3346 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 3338 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698