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

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

Issue 2639273003: Fix environment mismatch in AOT inlining. (Closed)
Patch Set: clean up Created 3 years, 11 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
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.h » ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/aot_optimizer.h" 5 #include "vm/aot_optimizer.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/branch_optimizer.h" 8 #include "vm/branch_optimizer.h"
9 #include "vm/cha.h" 9 #include "vm/cha.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 1554 matching lines...) Expand 10 before | Expand all | Expand 10 after
1565 : Symbols::_classRangeCheck(); 1565 : Symbols::_classRangeCheck();
1566 const Function& target = Function::ZoneHandle( 1566 const Function& target = Function::ZoneHandle(
1567 Z, dart_internal.LookupFunctionAllowPrivate(target_name)); 1567 Z, dart_internal.LookupFunctionAllowPrivate(target_name));
1568 ASSERT(!target.IsNull()); 1568 ASSERT(!target.IsNull());
1569 ASSERT(target.IsRecognized() && target.always_inline()); 1569 ASSERT(target.IsRecognized() && target.always_inline());
1570 1570
1571 StaticCallInstr* new_call = 1571 StaticCallInstr* new_call =
1572 new (Z) StaticCallInstr(call->token_pos(), target, 1572 new (Z) StaticCallInstr(call->token_pos(), target,
1573 Object::null_array(), // argument_names 1573 Object::null_array(), // argument_names
1574 args, call->deopt_id()); 1574 args, call->deopt_id());
1575 Environment* copy = call->env()->DeepCopy(
1576 Z, call->env()->Length() - call->ArgumentCount());
1577 for (intptr_t i = 0; i < args->length(); ++i) {
1578 copy->PushValue(new (Z) Value((*args)[i]->value()->definition()));
1579 }
1580 call->RemoveEnvironment();
1575 ReplaceCall(call, new_call); 1581 ReplaceCall(call, new_call);
1582 copy->DeepCopyTo(Z, new_call);
1576 return; 1583 return;
1577 } 1584 }
1578 } 1585 }
1579 1586
1580 const ICData& unary_checks = 1587 const ICData& unary_checks =
1581 ICData::ZoneHandle(Z, call->ic_data()->AsUnaryClassChecks()); 1588 ICData::ZoneHandle(Z, call->ic_data()->AsUnaryClassChecks());
1582 if ((unary_checks.NumberOfChecks() > 0) && 1589 if ((unary_checks.NumberOfChecks() > 0) &&
1583 (unary_checks.NumberOfChecks() <= FLAG_max_polymorphic_checks)) { 1590 (unary_checks.NumberOfChecks() <= FLAG_max_polymorphic_checks)) {
1584 ZoneGrowableArray<intptr_t>* results = 1591 ZoneGrowableArray<intptr_t>* results =
1585 new (Z) ZoneGrowableArray<intptr_t>(unary_checks.NumberOfChecks() * 2); 1592 new (Z) ZoneGrowableArray<intptr_t>(unary_checks.NumberOfChecks() * 2);
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
2169 FlowGraph::kEffect); 2176 FlowGraph::kEffect);
2170 current_iterator()->RemoveCurrentFromGraph(); 2177 current_iterator()->RemoveCurrentFromGraph();
2171 } 2178 }
2172 } 2179 }
2173 } 2180 }
2174 } 2181 }
2175 2182
2176 #endif // DART_PRECOMPILER 2183 #endif // DART_PRECOMPILER
2177 2184
2178 } // namespace dart 2185 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698