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

Side by Side Diff: src/mips/lithium-codegen-mips.cc

Issue 198973002: MIPS: Fix uses of range analysis results in HChange. (Closed) Base URL: https://github.com/v8/v8.git@gbl
Patch Set: Created 6 years, 9 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 | src/mips/lithium-mips.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 2012 the V8 project authors. All rights reserved.7 1 // Copyright 2012 the V8 project authors. All rights reserved.7
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4438 matching lines...) Expand 10 before | Expand all | Expand 10 after
4449 Register scratch = scratch0(); 4449 Register scratch = scratch0();
4450 __ lw(scratch, ToMemOperand(input)); 4450 __ lw(scratch, ToMemOperand(input));
4451 __ mtc1(scratch, single_scratch); 4451 __ mtc1(scratch, single_scratch);
4452 } else { 4452 } else {
4453 __ mtc1(ToRegister(input), single_scratch); 4453 __ mtc1(ToRegister(input), single_scratch);
4454 } 4454 }
4455 __ cvt_d_w(ToDoubleRegister(output), single_scratch); 4455 __ cvt_d_w(ToDoubleRegister(output), single_scratch);
4456 } 4456 }
4457 4457
4458 4458
4459 void LCodeGen::DoInteger32ToSmi(LInteger32ToSmi* instr) {
4460 LOperand* input = instr->value();
4461 LOperand* output = instr->result();
4462 Register scratch = scratch0();
4463
4464 ASSERT(output->IsRegister());
4465 if (!instr->hydrogen()->value()->HasRange() ||
4466 !instr->hydrogen()->value()->range()->IsInSmiRange()) {
4467 __ SmiTagCheckOverflow(ToRegister(output), ToRegister(input), scratch);
4468 DeoptimizeIf(lt, instr->environment(), scratch, Operand(zero_reg));
4469 } else {
4470 __ SmiTag(ToRegister(output), ToRegister(input));
4471 }
4472 }
4473
4474
4475 void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) { 4459 void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) {
4476 LOperand* input = instr->value(); 4460 LOperand* input = instr->value();
4477 LOperand* output = instr->result(); 4461 LOperand* output = instr->result();
4478 4462
4479 FPURegister dbl_scratch = double_scratch0(); 4463 FPURegister dbl_scratch = double_scratch0();
4480 __ mtc1(ToRegister(input), dbl_scratch); 4464 __ mtc1(ToRegister(input), dbl_scratch);
4481 __ Cvt_d_uw(ToDoubleRegister(output), dbl_scratch, f22); 4465 __ Cvt_d_uw(ToDoubleRegister(output), dbl_scratch, f22);
4482 } 4466 }
4483 4467
4484 4468
4485 void LCodeGen::DoUint32ToSmi(LUint32ToSmi* instr) {
4486 LOperand* input = instr->value();
4487 LOperand* output = instr->result();
4488 if (!instr->hydrogen()->value()->HasRange() ||
4489 !instr->hydrogen()->value()->range()->IsInSmiRange()) {
4490 Register scratch = scratch0();
4491 __ And(scratch, ToRegister(input), Operand(0xc0000000));
4492 DeoptimizeIf(ne, instr->environment(), scratch, Operand(zero_reg));
4493 }
4494 __ SmiTag(ToRegister(output), ToRegister(input));
4495 }
4496
4497
4498 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { 4469 void LCodeGen::DoNumberTagI(LNumberTagI* instr) {
4499 class DeferredNumberTagI V8_FINAL : public LDeferredCode { 4470 class DeferredNumberTagI V8_FINAL : public LDeferredCode {
4500 public: 4471 public:
4501 DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr) 4472 DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr)
4502 : LDeferredCode(codegen), instr_(instr) { } 4473 : LDeferredCode(codegen), instr_(instr) { }
4503 virtual void Generate() V8_OVERRIDE { 4474 virtual void Generate() V8_OVERRIDE {
4504 codegen()->DoDeferredNumberTagIU(instr_, 4475 codegen()->DoDeferredNumberTagIU(instr_,
4505 instr_->value(), 4476 instr_->value(),
4506 instr_->temp1(), 4477 instr_->temp1(),
4507 instr_->temp2(), 4478 instr_->temp2(),
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
4668 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 4639 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
4669 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); 4640 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber);
4670 RecordSafepointWithRegisters( 4641 RecordSafepointWithRegisters(
4671 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); 4642 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt);
4672 __ Subu(v0, v0, kHeapObjectTag); 4643 __ Subu(v0, v0, kHeapObjectTag);
4673 __ StoreToSafepointRegisterSlot(v0, reg); 4644 __ StoreToSafepointRegisterSlot(v0, reg);
4674 } 4645 }
4675 4646
4676 4647
4677 void LCodeGen::DoSmiTag(LSmiTag* instr) { 4648 void LCodeGen::DoSmiTag(LSmiTag* instr) {
4678 ASSERT(!instr->hydrogen_value()->CheckFlag(HValue::kCanOverflow)); 4649 HChange* hchange = instr->hydrogen();
4679 __ SmiTag(ToRegister(instr->result()), ToRegister(instr->value())); 4650 Register input = ToRegister(instr->value());
4651 Register output = ToRegister(instr->result());
4652 if (hchange->CheckFlag(HValue::kCanOverflow) &&
4653 hchange->value()->CheckFlag(HValue::kUint32)) {
4654 __ And(at, input, Operand(0xc0000000));
4655 DeoptimizeIf(ne, instr->environment(), at, Operand(zero_reg));
4656 }
4657 if (hchange->CheckFlag(HValue::kCanOverflow) &&
4658 !hchange->value()->CheckFlag(HValue::kUint32)) {
4659 __ SmiTagCheckOverflow(output, input, at);
4660 DeoptimizeIf(lt, instr->environment(), at, Operand(zero_reg));
4661 } else {
4662 __ SmiTag(output, input);
4663 }
4680 } 4664 }
4681 4665
4682 4666
4683 void LCodeGen::DoSmiUntag(LSmiUntag* instr) { 4667 void LCodeGen::DoSmiUntag(LSmiUntag* instr) {
4684 Register scratch = scratch0(); 4668 Register scratch = scratch0();
4685 Register input = ToRegister(instr->value()); 4669 Register input = ToRegister(instr->value());
4686 Register result = ToRegister(instr->result()); 4670 Register result = ToRegister(instr->result());
4687 if (instr->needs_check()) { 4671 if (instr->needs_check()) {
4688 STATIC_ASSERT(kHeapObjectTag == 1); 4672 STATIC_ASSERT(kHeapObjectTag == 1);
4689 // If the input is a HeapObject, value of scratch won't be zero. 4673 // If the input is a HeapObject, value of scratch won't be zero.
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after
5725 __ Subu(scratch, result, scratch); 5709 __ Subu(scratch, result, scratch);
5726 __ lw(result, FieldMemOperand(scratch, 5710 __ lw(result, FieldMemOperand(scratch,
5727 FixedArray::kHeaderSize - kPointerSize)); 5711 FixedArray::kHeaderSize - kPointerSize));
5728 __ bind(&done); 5712 __ bind(&done);
5729 } 5713 }
5730 5714
5731 5715
5732 #undef __ 5716 #undef __
5733 5717
5734 } } // namespace v8::internal 5718 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/mips/lithium-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698