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

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

Issue 356923006: Iterate over PcDescriptors only via iterators, not via an index. (preparation for more compression … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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
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/bit_vector.h" 9 #include "vm/bit_vector.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 1003
1004 // Call to stub that checks whether the debugger is in single 1004 // Call to stub that checks whether the debugger is in single
1005 // step mode. This call must happen before the contexts are 1005 // step mode. This call must happen before the contexts are
1006 // unchained so that captured variables can be inspected. 1006 // unchained so that captured variables can be inspected.
1007 // No debugger check is done in native functions or for return 1007 // No debugger check is done in native functions or for return
1008 // statements for which there is no associated source position. 1008 // statements for which there is no associated source position.
1009 const Function& function = owner()->parsed_function()->function(); 1009 const Function& function = owner()->parsed_function()->function();
1010 if ((node->token_pos() != Scanner::kNoSourcePos) && 1010 if ((node->token_pos() != Scanner::kNoSourcePos) &&
1011 !function.is_native() && FLAG_enable_debugger) { 1011 !function.is_native() && FLAG_enable_debugger) {
1012 AddInstruction(new DebugStepCheckInstr(node->token_pos(), 1012 AddInstruction(new DebugStepCheckInstr(node->token_pos(),
1013 PcDescriptors::kRuntimeCall)); 1013 RawPcDescriptors::kRuntimeCall));
1014 } 1014 }
1015 1015
1016 if (FLAG_enable_type_checks) { 1016 if (FLAG_enable_type_checks) {
1017 const bool is_implicit_dynamic_getter = 1017 const bool is_implicit_dynamic_getter =
1018 (!function.is_static() && 1018 (!function.is_static() &&
1019 ((function.kind() == RawFunction::kImplicitGetter) || 1019 ((function.kind() == RawFunction::kImplicitGetter) ||
1020 (function.kind() == RawFunction::kImplicitStaticFinalGetter))); 1020 (function.kind() == RawFunction::kImplicitStaticFinalGetter)));
1021 // Implicit getters do not need a type check at return, unless they compute 1021 // Implicit getters do not need a type check at return, unless they compute
1022 // the initial value of a static field. 1022 // the initial value of a static field.
1023 // The body of a constructor cannot modify the type of the 1023 // The body of a constructor cannot modify the type of the
(...skipping 2079 matching lines...) Expand 10 before | Expand all | Expand 10 after
3103 // <Expression> ::= StoreLocal { local: LocalVariable 3103 // <Expression> ::= StoreLocal { local: LocalVariable
3104 // value: <Expression> } 3104 // value: <Expression> }
3105 void EffectGraphVisitor::VisitStoreLocalNode(StoreLocalNode* node) { 3105 void EffectGraphVisitor::VisitStoreLocalNode(StoreLocalNode* node) {
3106 // If the right hand side is an expression that does not contain 3106 // If the right hand side is an expression that does not contain
3107 // a safe point for the debugger to stop, add an explicit stub 3107 // a safe point for the debugger to stop, add an explicit stub
3108 // call. 3108 // call.
3109 if (node->value()->IsLiteralNode() || 3109 if (node->value()->IsLiteralNode() ||
3110 node->value()->IsLoadLocalNode()) { 3110 node->value()->IsLoadLocalNode()) {
3111 if (FLAG_enable_debugger) { 3111 if (FLAG_enable_debugger) {
3112 AddInstruction(new DebugStepCheckInstr(node->token_pos(), 3112 AddInstruction(new DebugStepCheckInstr(node->token_pos(),
3113 PcDescriptors::kRuntimeCall)); 3113 RawPcDescriptors::kRuntimeCall));
3114 } 3114 }
3115 } 3115 }
3116 3116
3117 ValueGraphVisitor for_value(owner()); 3117 ValueGraphVisitor for_value(owner());
3118 node->value()->Visit(&for_value); 3118 node->value()->Visit(&for_value);
3119 Append(for_value); 3119 Append(for_value);
3120 Value* store_value = for_value.value(); 3120 Value* store_value = for_value.value();
3121 if (FLAG_enable_type_checks) { 3121 if (FLAG_enable_type_checks) {
3122 store_value = BuildAssignableValue(node->value()->token_pos(), 3122 store_value = BuildAssignableValue(node->value()->token_pos(),
3123 store_value, 3123 store_value,
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
3949 Report::MessageF(Report::kBailout, 3949 Report::MessageF(Report::kBailout,
3950 Script::Handle(function.script()), 3950 Script::Handle(function.script()),
3951 function.token_pos(), 3951 function.token_pos(),
3952 "FlowGraphBuilder Bailout: %s %s", 3952 "FlowGraphBuilder Bailout: %s %s",
3953 String::Handle(function.name()).ToCString(), 3953 String::Handle(function.name()).ToCString(),
3954 reason); 3954 reason);
3955 UNREACHABLE(); 3955 UNREACHABLE();
3956 } 3956 }
3957 3957
3958 } // namespace dart 3958 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698