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

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

Issue 10693071: Use VM type cast and save handles. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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/exceptions.cc ('k') | runtime/vm/isolate.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 #include "vm/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/flow_graph_builder.h" 9 #include "vm/flow_graph_builder.h"
10 #include "vm/flow_graph_compiler.h" 10 #include "vm/flow_graph_compiler.h"
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 if (index == 0) return true_successor_; 582 if (index == 0) return true_successor_;
583 if (index == 1) return false_successor_; 583 if (index == 1) return false_successor_;
584 UNREACHABLE(); 584 UNREACHABLE();
585 return NULL; 585 return NULL;
586 } 586 }
587 587
588 588
589 // ==== Support for propagating static type. 589 // ==== Support for propagating static type.
590 RawAbstractType* ConstantVal::StaticType() const { 590 RawAbstractType* ConstantVal::StaticType() const {
591 if (value().IsInstance()) { 591 if (value().IsInstance()) {
592 Instance& instance = Instance::Handle(); 592 return Instance::Cast(value()).GetType();
593 instance ^= value().raw();
594 return instance.GetType();
595 } else { 593 } else {
596 UNREACHABLE(); 594 UNREACHABLE();
597 return AbstractType::null(); 595 return AbstractType::null();
598 } 596 }
599 } 597 }
600 598
601 599
602 RawAbstractType* UseVal::StaticType() const { 600 RawAbstractType* UseVal::StaticType() const {
603 return definition()->StaticType(); 601 return definition()->StaticType();
604 } 602 }
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
1338 const ExternalLabel label(closure_function.ToCString(), stub.EntryPoint()); 1336 const ExternalLabel label(closure_function.ToCString(), stub.EntryPoint());
1339 compiler->GenerateCall(token_pos(), try_index(), &label, 1337 compiler->GenerateCall(token_pos(), try_index(), &label,
1340 PcDescriptors::kOther); 1338 PcDescriptors::kOther);
1341 __ Drop(2); // Discard type arguments and receiver. 1339 __ Drop(2); // Discard type arguments and receiver.
1342 } 1340 }
1343 1341
1344 1342
1345 #undef __ 1343 #undef __
1346 1344
1347 } // namespace dart 1345 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/exceptions.cc ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698