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

Side by Side Diff: runtime/vm/intermediate_language_ia32.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_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 } 329 }
330 330
331 331
332 static void EmitEqualityAsInstanceCall(FlowGraphCompiler* compiler, 332 static void EmitEqualityAsInstanceCall(FlowGraphCompiler* compiler,
333 intptr_t deopt_id, 333 intptr_t deopt_id,
334 intptr_t token_pos, 334 intptr_t token_pos,
335 Token::Kind kind, 335 Token::Kind kind,
336 LocationSummary* locs, 336 LocationSummary* locs,
337 const ICData& original_ic_data) { 337 const ICData& original_ic_data) {
338 if (!compiler->is_optimizing()) { 338 if (!compiler->is_optimizing()) {
339 compiler->AddCurrentDescriptor(PcDescriptors::kDeoptBefore, 339 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
340 deopt_id, 340 deopt_id,
341 token_pos); 341 token_pos);
342 } 342 }
343 const int kNumberOfArguments = 2; 343 const int kNumberOfArguments = 2;
344 const Array& kNoArgumentNames = Array::Handle(); 344 const Array& kNoArgumentNames = Array::Handle();
345 const int kNumArgumentsChecked = 2; 345 const int kNumArgumentsChecked = 2;
346 346
347 const Immediate& raw_null = 347 const Immediate& raw_null =
348 Immediate(reinterpret_cast<intptr_t>(Object::null())); 348 Immediate(reinterpret_cast<intptr_t>(Object::null()));
349 Label check_identity; 349 Label check_identity;
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 Array::Handle(), // No named arguments. 966 Array::Handle(), // No named arguments.
967 deopt, // Deoptimize target. 967 deopt, // Deoptimize target.
968 deopt_id(), 968 deopt_id(),
969 token_pos(), 969 token_pos(),
970 locs()); 970 locs());
971 return; 971 return;
972 } 972 }
973 const String& function_name = 973 const String& function_name =
974 String::ZoneHandle(Symbols::New(Token::Str(kind()))); 974 String::ZoneHandle(Symbols::New(Token::Str(kind())));
975 if (!compiler->is_optimizing()) { 975 if (!compiler->is_optimizing()) {
976 compiler->AddCurrentDescriptor(PcDescriptors::kDeoptBefore, 976 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
977 deopt_id(), 977 deopt_id(),
978 token_pos()); 978 token_pos());
979 } 979 }
980 const intptr_t kNumArguments = 2; 980 const intptr_t kNumArguments = 2;
981 const intptr_t kNumArgsChecked = 2; // Type-feedback. 981 const intptr_t kNumArgsChecked = 2; // Type-feedback.
982 ICData& relational_ic_data = ICData::ZoneHandle(ic_data()->raw()); 982 ICData& relational_ic_data = ICData::ZoneHandle(ic_data()->raw());
983 if (compiler->is_optimizing() && FLAG_propagate_ic_data) { 983 if (compiler->is_optimizing() && FLAG_propagate_ic_data) {
984 ASSERT(!ic_data()->IsNull()); 984 ASSERT(!ic_data()->IsNull());
985 if (ic_data()->NumberOfChecks() == 0) { 985 if (ic_data()->NumberOfChecks() == 0) {
986 // IC call for reoptimization populates original ICData. 986 // IC call for reoptimization populates original ICData.
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
1750 return summary; 1750 return summary;
1751 } 1751 }
1752 1752
1753 1753
1754 void InstanceOfInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1754 void InstanceOfInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1755 ASSERT(locs()->in(0).reg() == EAX); // Value. 1755 ASSERT(locs()->in(0).reg() == EAX); // Value.
1756 ASSERT(locs()->in(1).reg() == ECX); // Instantiator. 1756 ASSERT(locs()->in(1).reg() == ECX); // Instantiator.
1757 ASSERT(locs()->in(2).reg() == EDX); // Instantiator type arguments. 1757 ASSERT(locs()->in(2).reg() == EDX); // Instantiator type arguments.
1758 1758
1759 compiler->GenerateInstanceOf(token_pos(), 1759 compiler->GenerateInstanceOf(token_pos(),
1760 deopt_id(),
1761 type(), 1760 type(),
1762 negate_result(), 1761 negate_result(),
1763 locs()); 1762 locs());
1764 ASSERT(locs()->out().reg() == EAX); 1763 ASSERT(locs()->out().reg() == EAX);
1765 } 1764 }
1766 1765
1767 1766
1768 LocationSummary* CreateArrayInstr::MakeLocationSummary() const { 1767 LocationSummary* CreateArrayInstr::MakeLocationSummary() const {
1769 const intptr_t kNumInputs = 1; 1768 const intptr_t kNumInputs = 1;
1770 const intptr_t kNumTemps = 0; 1769 const intptr_t kNumTemps = 0;
(...skipping 1665 matching lines...) Expand 10 before | Expand all | Expand 10 after
3436 3435
3437 LocationSummary* GotoInstr::MakeLocationSummary() const { 3436 LocationSummary* GotoInstr::MakeLocationSummary() const {
3438 return new LocationSummary(0, 0, LocationSummary::kNoCall); 3437 return new LocationSummary(0, 0, LocationSummary::kNoCall);
3439 } 3438 }
3440 3439
3441 3440
3442 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3441 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3443 // Add deoptimization descriptor for deoptimizing instructions 3442 // Add deoptimization descriptor for deoptimizing instructions
3444 // that may be inserted before this instruction. 3443 // that may be inserted before this instruction.
3445 if (!compiler->is_optimizing()) { 3444 if (!compiler->is_optimizing()) {
3446 compiler->AddCurrentDescriptor(PcDescriptors::kDeoptBefore, 3445 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
3447 GetDeoptId(), 3446 GetDeoptId(),
3448 0); // No token position. 3447 0); // No token position.
3449 } 3448 }
3450 3449
3451 if (HasParallelMove()) { 3450 if (HasParallelMove()) {
3452 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); 3451 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move());
3453 } 3452 }
3454 3453
3455 // We can fall through if the successor is the next block in the list. 3454 // We can fall through if the successor is the next block in the list.
3456 // Otherwise, we need a jump. 3455 // Otherwise, we need a jump.
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
3720 PcDescriptors::kOther, 3719 PcDescriptors::kOther,
3721 locs()); 3720 locs());
3722 __ Drop(2); // Discard type arguments and receiver. 3721 __ Drop(2); // Discard type arguments and receiver.
3723 } 3722 }
3724 3723
3725 } // namespace dart 3724 } // namespace dart
3726 3725
3727 #undef __ 3726 #undef __
3728 3727
3729 #endif // defined TARGET_ARCH_IA32 3728 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698