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

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

Issue 17501003: Minor cleanups to use null_array(), null_object() and null_string() handles. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/object.cc » ('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_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 intptr_t token_pos, 379 intptr_t token_pos,
380 Token::Kind kind, 380 Token::Kind kind,
381 LocationSummary* locs, 381 LocationSummary* locs,
382 const ICData& original_ic_data) { 382 const ICData& original_ic_data) {
383 if (!compiler->is_optimizing()) { 383 if (!compiler->is_optimizing()) {
384 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, 384 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
385 deopt_id, 385 deopt_id,
386 token_pos); 386 token_pos);
387 } 387 }
388 const int kNumberOfArguments = 2; 388 const int kNumberOfArguments = 2;
389 const Array& kNoArgumentNames = Array::Handle(); 389 const Array& kNoArgumentNames = Object::null_array();
390 const int kNumArgumentsChecked = 2; 390 const int kNumArgumentsChecked = 2;
391 391
392 Label check_identity; 392 Label check_identity;
393 __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null())); 393 __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null()));
394 __ ldm(IA, SP, (1 << R0) | (1 << R1)); 394 __ ldm(IA, SP, (1 << R0) | (1 << R1));
395 __ cmp(R1, ShifterOperand(IP)); 395 __ cmp(R1, ShifterOperand(IP));
396 __ b(&check_identity, EQ); 396 __ b(&check_identity, EQ);
397 __ cmp(R0, ShifterOperand(IP)); 397 __ cmp(R0, ShifterOperand(IP));
398 __ b(&check_identity, EQ); 398 __ b(&check_identity, EQ);
399 399
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 __ cmp(left, ShifterOperand(right)); 543 __ cmp(left, ShifterOperand(right));
544 if (branch != NULL) { 544 if (branch != NULL) {
545 branch->EmitBranchOnCondition(compiler, cond); 545 branch->EmitBranchOnCondition(compiler, cond);
546 } else { 546 } else {
547 Register result = locs->out().reg(); 547 Register result = locs->out().reg();
548 __ LoadObject(result, Bool::True(), cond); 548 __ LoadObject(result, Bool::True(), cond);
549 __ LoadObject(result, Bool::False(), NegateCondition(cond)); 549 __ LoadObject(result, Bool::False(), NegateCondition(cond));
550 } 550 }
551 } else { 551 } else {
552 const int kNumberOfArguments = 2; 552 const int kNumberOfArguments = 2;
553 const Array& kNoArgumentNames = Array::Handle(); 553 const Array& kNoArgumentNames = Object::null_array();
554 compiler->GenerateStaticCall(deopt_id, 554 compiler->GenerateStaticCall(deopt_id,
555 token_pos, 555 token_pos,
556 target, 556 target,
557 kNumberOfArguments, 557 kNumberOfArguments,
558 kNoArgumentNames, 558 kNoArgumentNames,
559 locs); 559 locs);
560 if (branch == NULL) { 560 if (branch == NULL) {
561 if (kind == Token::kNE) { 561 if (kind == Token::kNE) {
562 __ CompareObject(R0, Bool::True()); 562 __ CompareObject(R0, Bool::True());
563 __ LoadObject(R0, Bool::True(), NE); 563 __ LoadObject(R0, Bool::True(), NE);
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
924 if (HasICData() && (ic_data()->NumberOfChecks() > 0)) { 924 if (HasICData() && (ic_data()->NumberOfChecks() > 0)) {
925 Label* deopt = compiler->AddDeoptStub(deopt_id(), kDeoptRelationalOp); 925 Label* deopt = compiler->AddDeoptStub(deopt_id(), kDeoptRelationalOp);
926 // Load class into R2. Since this is a call, any register except 926 // Load class into R2. Since this is a call, any register except
927 // the fixed input registers would be ok. 927 // the fixed input registers would be ok.
928 ASSERT((left != R2) && (right != R2)); 928 ASSERT((left != R2) && (right != R2));
929 const intptr_t kNumArguments = 2; 929 const intptr_t kNumArguments = 2;
930 LoadValueCid(compiler, R2, left); 930 LoadValueCid(compiler, R2, left);
931 compiler->EmitTestAndCall(ICData::Handle(ic_data()->AsUnaryClassChecks()), 931 compiler->EmitTestAndCall(ICData::Handle(ic_data()->AsUnaryClassChecks()),
932 R2, // Class id register. 932 R2, // Class id register.
933 kNumArguments, 933 kNumArguments,
934 Array::Handle(), // No named arguments. 934 Object::null_array(), // No named arguments.
935 deopt, // Deoptimize target. 935 deopt, // Deoptimize target.
936 deopt_id(), 936 deopt_id(),
937 token_pos(), 937 token_pos(),
938 locs()); 938 locs());
939 return; 939 return;
940 } 940 }
941 const String& function_name = 941 const String& function_name =
942 String::ZoneHandle(Symbols::New(Token::Str(kind()))); 942 String::ZoneHandle(Symbols::New(Token::Str(kind())));
943 if (!compiler->is_optimizing()) { 943 if (!compiler->is_optimizing()) {
944 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, 944 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
(...skipping 2077 matching lines...) Expand 10 before | Expand all | Expand 10 after
3022 ASSERT(instance_call()->HasICData()); 3022 ASSERT(instance_call()->HasICData());
3023 const ICData& ic_data = *instance_call()->ic_data(); 3023 const ICData& ic_data = *instance_call()->ic_data();
3024 ASSERT((ic_data.NumberOfChecks() == 1)); 3024 ASSERT((ic_data.NumberOfChecks() == 1));
3025 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(0)); 3025 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(0));
3026 3026
3027 const intptr_t kNumberOfArguments = 1; 3027 const intptr_t kNumberOfArguments = 1;
3028 compiler->GenerateStaticCall(deopt_id(), 3028 compiler->GenerateStaticCall(deopt_id(),
3029 instance_call()->token_pos(), 3029 instance_call()->token_pos(),
3030 target, 3030 target,
3031 kNumberOfArguments, 3031 kNumberOfArguments,
3032 Array::Handle(), // No argument names., 3032 Object::null_array(), // No argument names.,
3033 locs()); 3033 locs());
3034 __ Bind(&done); 3034 __ Bind(&done);
3035 } 3035 }
3036 3036
3037 3037
3038 LocationSummary* DoubleToSmiInstr::MakeLocationSummary() const { 3038 LocationSummary* DoubleToSmiInstr::MakeLocationSummary() const {
3039 const intptr_t kNumInputs = 1; 3039 const intptr_t kNumInputs = 1;
3040 const intptr_t kNumTemps = 0; 3040 const intptr_t kNumTemps = 0;
3041 LocationSummary* result = new LocationSummary( 3041 LocationSummary* result = new LocationSummary(
3042 kNumInputs, kNumTemps, LocationSummary::kNoCall); 3042 kNumInputs, kNumTemps, LocationSummary::kNoCall);
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
3627 compiler->GenerateCall(token_pos(), 3627 compiler->GenerateCall(token_pos(),
3628 &label, 3628 &label,
3629 PcDescriptors::kOther, 3629 PcDescriptors::kOther,
3630 locs()); 3630 locs());
3631 __ Drop(2); // Discard type arguments and receiver. 3631 __ Drop(2); // Discard type arguments and receiver.
3632 } 3632 }
3633 3633
3634 } // namespace dart 3634 } // namespace dart
3635 3635
3636 #endif // defined TARGET_ARCH_ARM 3636 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698