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

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

Issue 14872002: Improve load forwarding: (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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) 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/flow_graph_builder.h" 5 #include "vm/flow_graph_builder.h"
6 6
7 #include "lib/invocation_mirror.h" 7 #include "lib/invocation_mirror.h"
8 #include "vm/ast_printer.h" 8 #include "vm/ast_printer.h"
9 #include "vm/code_descriptors.h" 9 #include "vm/code_descriptors.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 2616 matching lines...) Expand 10 before | Expand all | Expand 10 after
2627 2627
2628 void EffectGraphVisitor::VisitLoadInstanceFieldNode( 2628 void EffectGraphVisitor::VisitLoadInstanceFieldNode(
2629 LoadInstanceFieldNode* node) { 2629 LoadInstanceFieldNode* node) {
2630 ValueGraphVisitor for_instance(owner(), temp_index()); 2630 ValueGraphVisitor for_instance(owner(), temp_index());
2631 node->instance()->Visit(&for_instance); 2631 node->instance()->Visit(&for_instance);
2632 Append(for_instance); 2632 Append(for_instance);
2633 LoadFieldInstr* load = new LoadFieldInstr( 2633 LoadFieldInstr* load = new LoadFieldInstr(
2634 for_instance.value(), 2634 for_instance.value(),
2635 node->field().Offset(), 2635 node->field().Offset(),
2636 AbstractType::ZoneHandle(node->field().type())); 2636 AbstractType::ZoneHandle(node->field().type()));
2637 load->set_field(&Field::ZoneHandle(node->field().raw()));
srdjan 2013/05/02 21:00:54 That works, but I wonder why you do not reuse the
Vyacheslav Egorov (Google) 2013/05/02 21:20:25 Cleaned this up. set_field was requiring non-const
2637 ReturnDefinition(load); 2638 ReturnDefinition(load);
2638 } 2639 }
2639 2640
2640 2641
2641 void EffectGraphVisitor::VisitStoreInstanceFieldNode( 2642 void EffectGraphVisitor::VisitStoreInstanceFieldNode(
2642 StoreInstanceFieldNode* node) { 2643 StoreInstanceFieldNode* node) {
2643 ValueGraphVisitor for_instance(owner(), temp_index()); 2644 ValueGraphVisitor for_instance(owner(), temp_index());
2644 node->instance()->Visit(&for_instance); 2645 node->instance()->Visit(&for_instance);
2645 Append(for_instance); 2646 Append(for_instance);
2646 ValueGraphVisitor for_value(owner(), for_instance.temp_index()); 2647 ValueGraphVisitor for_value(owner(), for_instance.temp_index());
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
3373 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; 3374 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1;
3374 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 3375 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
3375 OS::SNPrint(chars, len, kFormat, function_name, reason); 3376 OS::SNPrint(chars, len, kFormat, function_name, reason);
3376 const Error& error = Error::Handle( 3377 const Error& error = Error::Handle(
3377 LanguageError::New(String::Handle(String::New(chars)))); 3378 LanguageError::New(String::Handle(String::New(chars))));
3378 Isolate::Current()->long_jump_base()->Jump(1, error); 3379 Isolate::Current()->long_jump_base()->Jump(1, error);
3379 } 3380 }
3380 3381
3381 3382
3382 } // namespace dart 3383 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698