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

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

Issue 1672873003: Bailout if field state changed during background compilation. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Comment Created 4 years, 10 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 | « runtime/vm/intermediate_language_mips.cc ('k') | runtime/vm/object.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/globals.h" // Needed here to get TARGET_ARCH_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/compiler.h"
10 #include "vm/dart_entry.h" 11 #include "vm/dart_entry.h"
11 #include "vm/flow_graph.h" 12 #include "vm/flow_graph.h"
12 #include "vm/flow_graph_compiler.h" 13 #include "vm/flow_graph_compiler.h"
13 #include "vm/flow_graph_range_analysis.h" 14 #include "vm/flow_graph_range_analysis.h"
14 #include "vm/locations.h" 15 #include "vm/locations.h"
15 #include "vm/object_store.h" 16 #include "vm/object_store.h"
16 #include "vm/parser.h" 17 #include "vm/parser.h"
17 #include "vm/stack_frame.h" 18 #include "vm/stack_frame.h"
18 #include "vm/stub_code.h" 19 #include "vm/stub_code.h"
19 #include "vm/symbols.h" 20 #include "vm/symbols.h"
(...skipping 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after
1450 } 1451 }
1451 1452
1452 1453
1453 void GuardFieldClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1454 void GuardFieldClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1454 ASSERT(sizeof(classid_t) == kInt32Size); 1455 ASSERT(sizeof(classid_t) == kInt32Size);
1455 const intptr_t value_cid = value()->Type()->ToCid(); 1456 const intptr_t value_cid = value()->Type()->ToCid();
1456 const intptr_t field_cid = field().guarded_cid(); 1457 const intptr_t field_cid = field().guarded_cid();
1457 const intptr_t nullability = field().is_nullable() ? kNullCid : kIllegalCid; 1458 const intptr_t nullability = field().is_nullable() ? kNullCid : kIllegalCid;
1458 1459
1459 if (field_cid == kDynamicCid) { 1460 if (field_cid == kDynamicCid) {
1461 if (Compiler::IsBackgroundCompilation()) {
1462 // Field state changed while compiling.
1463 Compiler::AbortBackgroundCompilation(deopt_id());
1464 }
1460 ASSERT(!compiler->is_optimizing()); 1465 ASSERT(!compiler->is_optimizing());
1461 return; // Nothing to emit. 1466 return; // Nothing to emit.
1462 } 1467 }
1463 1468
1464 const bool emit_full_guard = 1469 const bool emit_full_guard =
1465 !compiler->is_optimizing() || (field_cid == kIllegalCid); 1470 !compiler->is_optimizing() || (field_cid == kIllegalCid);
1466 1471
1467 const bool needs_value_cid_temp_reg = 1472 const bool needs_value_cid_temp_reg =
1468 (value_cid == kDynamicCid) && (emit_full_guard || (field_cid != kSmiCid)); 1473 (value_cid == kDynamicCid) && (emit_full_guard || (field_cid != kSmiCid));
1469 1474
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1591 zone, kNumInputs, 0, LocationSummary::kNoCall); 1596 zone, kNumInputs, 0, LocationSummary::kNoCall);
1592 summary->set_in(0, Location::RequiresRegister()); 1597 summary->set_in(0, Location::RequiresRegister());
1593 return summary; 1598 return summary;
1594 } 1599 }
1595 UNREACHABLE(); 1600 UNREACHABLE();
1596 } 1601 }
1597 1602
1598 1603
1599 void GuardFieldLengthInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1604 void GuardFieldLengthInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1600 if (field().guarded_list_length() == Field::kNoFixedLength) { 1605 if (field().guarded_list_length() == Field::kNoFixedLength) {
1606 if (Compiler::IsBackgroundCompilation()) {
1607 // Field state changed while compiling.
1608 Compiler::AbortBackgroundCompilation(deopt_id());
1609 }
1601 ASSERT(!compiler->is_optimizing()); 1610 ASSERT(!compiler->is_optimizing());
1602 return; // Nothing to emit. 1611 return; // Nothing to emit.
1603 } 1612 }
1604 1613
1605 Label* deopt = compiler->is_optimizing() ? 1614 Label* deopt = compiler->is_optimizing() ?
1606 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL; 1615 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL;
1607 1616
1608 const Register value_reg = locs()->in(0).reg(); 1617 const Register value_reg = locs()->in(0).reg();
1609 1618
1610 if (!compiler->is_optimizing() || 1619 if (!compiler->is_optimizing() ||
(...skipping 4839 matching lines...) Expand 10 before | Expand all | Expand 10 after
6450 __ Drop(1); 6459 __ Drop(1);
6451 __ popq(result); 6460 __ popq(result);
6452 } 6461 }
6453 6462
6454 6463
6455 } // namespace dart 6464 } // namespace dart
6456 6465
6457 #undef __ 6466 #undef __
6458 6467
6459 #endif // defined TARGET_ARCH_X64 6468 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698