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

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

Issue 12457034: Ensure that all goto instructions have deoptimization target. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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) 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 "lib/error.h" 10 #include "lib/error.h"
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 } 327 }
328 328
329 329
330 static void EmitEqualityAsInstanceCall(FlowGraphCompiler* compiler, 330 static void EmitEqualityAsInstanceCall(FlowGraphCompiler* compiler,
331 intptr_t deopt_id, 331 intptr_t deopt_id,
332 intptr_t token_pos, 332 intptr_t token_pos,
333 Token::Kind kind, 333 Token::Kind kind,
334 LocationSummary* locs, 334 LocationSummary* locs,
335 const ICData& original_ic_data) { 335 const ICData& original_ic_data) {
336 if (!compiler->is_optimizing()) { 336 if (!compiler->is_optimizing()) {
337 compiler->AddCurrentDescriptor(PcDescriptors::kDeoptBefore, 337 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
338 deopt_id, 338 deopt_id,
339 token_pos); 339 token_pos);
340 } 340 }
341 const int kNumberOfArguments = 2; 341 const int kNumberOfArguments = 2;
342 const Array& kNoArgumentNames = Array::Handle(); 342 const Array& kNoArgumentNames = Array::Handle();
343 const int kNumArgumentsChecked = 2; 343 const int kNumArgumentsChecked = 2;
344 344
345 const Immediate& raw_null = 345 const Immediate& raw_null =
346 Immediate(reinterpret_cast<intptr_t>(Object::null())); 346 Immediate(reinterpret_cast<intptr_t>(Object::null()));
347 Label check_identity; 347 Label check_identity;
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 Array::Handle(), // No named arguments. 836 Array::Handle(), // No named arguments.
837 deopt, // Deoptimize target. 837 deopt, // Deoptimize target.
838 deopt_id(), 838 deopt_id(),
839 token_pos(), 839 token_pos(),
840 locs()); 840 locs());
841 return; 841 return;
842 } 842 }
843 const String& function_name = 843 const String& function_name =
844 String::ZoneHandle(Symbols::New(Token::Str(kind()))); 844 String::ZoneHandle(Symbols::New(Token::Str(kind())));
845 if (!compiler->is_optimizing()) { 845 if (!compiler->is_optimizing()) {
846 compiler->AddCurrentDescriptor(PcDescriptors::kDeoptBefore, 846 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
847 deopt_id(), 847 deopt_id(),
848 token_pos()); 848 token_pos());
849 } 849 }
850 const intptr_t kNumArguments = 2; 850 const intptr_t kNumArguments = 2;
851 const intptr_t kNumArgsChecked = 2; // Type-feedback. 851 const intptr_t kNumArgsChecked = 2; // Type-feedback.
852 ICData& relational_ic_data = ICData::ZoneHandle(ic_data()->raw()); 852 ICData& relational_ic_data = ICData::ZoneHandle(ic_data()->raw());
853 if (compiler->is_optimizing() && FLAG_propagate_ic_data) { 853 if (compiler->is_optimizing() && FLAG_propagate_ic_data) {
854 ASSERT(!ic_data()->IsNull()); 854 ASSERT(!ic_data()->IsNull());
855 if (ic_data()->NumberOfChecks() == 0) { 855 if (ic_data()->NumberOfChecks() == 0) {
856 // IC call for reoptimization populates original ICData. 856 // IC call for reoptimization populates original ICData.
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
1577 return summary; 1577 return summary;
1578 } 1578 }
1579 1579
1580 1580
1581 void InstanceOfInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1581 void InstanceOfInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1582 ASSERT(locs()->in(0).reg() == RAX); // Value. 1582 ASSERT(locs()->in(0).reg() == RAX); // Value.
1583 ASSERT(locs()->in(1).reg() == RCX); // Instantiator. 1583 ASSERT(locs()->in(1).reg() == RCX); // Instantiator.
1584 ASSERT(locs()->in(2).reg() == RDX); // Instantiator type arguments. 1584 ASSERT(locs()->in(2).reg() == RDX); // Instantiator type arguments.
1585 1585
1586 compiler->GenerateInstanceOf(token_pos(), 1586 compiler->GenerateInstanceOf(token_pos(),
1587 deopt_id(),
1588 type(), 1587 type(),
1589 negate_result(), 1588 negate_result(),
1590 locs()); 1589 locs());
1591 ASSERT(locs()->out().reg() == RAX); 1590 ASSERT(locs()->out().reg() == RAX);
1592 } 1591 }
1593 1592
1594 1593
1595 LocationSummary* CreateArrayInstr::MakeLocationSummary() const { 1594 LocationSummary* CreateArrayInstr::MakeLocationSummary() const {
1596 const intptr_t kNumInputs = 1; 1595 const intptr_t kNumInputs = 1;
1597 const intptr_t kNumTemps = 0; 1596 const intptr_t kNumTemps = 0;
(...skipping 1475 matching lines...) Expand 10 before | Expand all | Expand 10 after
3073 3072
3074 LocationSummary* GotoInstr::MakeLocationSummary() const { 3073 LocationSummary* GotoInstr::MakeLocationSummary() const {
3075 return new LocationSummary(0, 0, LocationSummary::kNoCall); 3074 return new LocationSummary(0, 0, LocationSummary::kNoCall);
3076 } 3075 }
3077 3076
3078 3077
3079 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3078 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3080 // Add deoptimization descriptor for deoptimizing instructions 3079 // Add deoptimization descriptor for deoptimizing instructions
3081 // that may be inserted before this instruction. 3080 // that may be inserted before this instruction.
3082 if (!compiler->is_optimizing()) { 3081 if (!compiler->is_optimizing()) {
3083 compiler->AddCurrentDescriptor(PcDescriptors::kDeoptBefore, 3082 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
3084 GetDeoptId(), 3083 GetDeoptId(),
3085 0); // No token position. 3084 0); // No token position.
3086 } 3085 }
3087 3086
3088 if (HasParallelMove()) { 3087 if (HasParallelMove()) {
3089 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); 3088 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move());
3090 } 3089 }
3091 3090
3092 // We can fall through if the successor is the next block in the list. 3091 // We can fall through if the successor is the next block in the list.
3093 // Otherwise, we need a jump. 3092 // Otherwise, we need a jump.
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
3357 PcDescriptors::kOther, 3356 PcDescriptors::kOther,
3358 locs()); 3357 locs());
3359 __ Drop(2); // Discard type arguments and receiver. 3358 __ Drop(2); // Discard type arguments and receiver.
3360 } 3359 }
3361 3360
3362 } // namespace dart 3361 } // namespace dart
3363 3362
3364 #undef __ 3363 #undef __
3365 3364
3366 #endif // defined TARGET_ARCH_X64 3365 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698