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

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

Issue 12529008: Collect type feedback for fields. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: ensure that not-null constraints are recomputed correctly Created 7 years, 9 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 2577 matching lines...) Expand 10 before | Expand all | Expand 10 after
2588 Append(for_value); 2588 Append(for_value);
2589 Value* store_value = for_value.value(); 2589 Value* store_value = for_value.value();
2590 if (FLAG_enable_type_checks) { 2590 if (FLAG_enable_type_checks) {
2591 const AbstractType& type = AbstractType::ZoneHandle(node->field().type()); 2591 const AbstractType& type = AbstractType::ZoneHandle(node->field().type());
2592 const String& dst_name = String::ZoneHandle(node->field().name()); 2592 const String& dst_name = String::ZoneHandle(node->field().name());
2593 store_value = BuildAssignableValue(node->value()->token_pos(), 2593 store_value = BuildAssignableValue(node->value()->token_pos(),
2594 store_value, 2594 store_value,
2595 type, 2595 type,
2596 dst_name); 2596 dst_name);
2597 } 2597 }
2598 StoreInstanceFieldInstr* store = new StoreInstanceFieldInstr( 2598
2599 node->field(), for_instance.value(), store_value, kEmitStoreBarrier); 2599 store_value = Bind(BuildStoreExprTemp(store_value));
2600 GuardFieldInstr* guard =
2601 new GuardFieldInstr(store_value,
2602 node->field(),
2603 Isolate::Current()->GetNextDeoptId());
2604 AddInstruction(guard);
2605
2606 store_value = Bind(BuildLoadExprTemp());
2607 StoreInstanceFieldInstr* store =
2608 new StoreInstanceFieldInstr(node->field(),
2609 for_instance.value(),
2610 store_value,
2611 kEmitStoreBarrier);
2600 ReturnDefinition(store); 2612 ReturnDefinition(store);
2601 } 2613 }
2602 2614
2603 2615
2604 // StoreInstanceFieldNode does not return result. 2616 // StoreInstanceFieldNode does not return result.
2605 void ValueGraphVisitor::VisitStoreInstanceFieldNode( 2617 void ValueGraphVisitor::VisitStoreInstanceFieldNode(
2606 StoreInstanceFieldNode* node) { 2618 StoreInstanceFieldNode* node) {
2607 UNIMPLEMENTED(); 2619 UNIMPLEMENTED();
2608 } 2620 }
2609 2621
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
3299 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; 3311 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1;
3300 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 3312 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
3301 OS::SNPrint(chars, len, kFormat, function_name, reason); 3313 OS::SNPrint(chars, len, kFormat, function_name, reason);
3302 const Error& error = Error::Handle( 3314 const Error& error = Error::Handle(
3303 LanguageError::New(String::Handle(String::New(chars)))); 3315 LanguageError::New(String::Handle(String::New(chars))));
3304 Isolate::Current()->long_jump_base()->Jump(1, error); 3316 Isolate::Current()->long_jump_base()->Jump(1, error);
3305 } 3317 }
3306 3318
3307 3319
3308 } // namespace dart 3320 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698