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

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

Issue 526223002: Use Chrome compatible naming for compiler specifics. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: mips Created 6 years, 3 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 | « src/mips/lithium-codegen-mips.h ('k') | src/mips/lithium-gap-resolver-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 19 matching lines...) Expand all
30 #include "src/code-stubs.h" 30 #include "src/code-stubs.h"
31 #include "src/hydrogen-osr.h" 31 #include "src/hydrogen-osr.h"
32 #include "src/mips/lithium-codegen-mips.h" 32 #include "src/mips/lithium-codegen-mips.h"
33 #include "src/mips/lithium-gap-resolver-mips.h" 33 #include "src/mips/lithium-gap-resolver-mips.h"
34 34
35 35
36 namespace v8 { 36 namespace v8 {
37 namespace internal { 37 namespace internal {
38 38
39 39
40 class SafepointGenerator V8_FINAL : public CallWrapper { 40 class SafepointGenerator FINAL : public CallWrapper {
41 public: 41 public:
42 SafepointGenerator(LCodeGen* codegen, 42 SafepointGenerator(LCodeGen* codegen,
43 LPointerMap* pointers, 43 LPointerMap* pointers,
44 Safepoint::DeoptMode mode) 44 Safepoint::DeoptMode mode)
45 : codegen_(codegen), 45 : codegen_(codegen),
46 pointers_(pointers), 46 pointers_(pointers),
47 deopt_mode_(mode) { } 47 deopt_mode_(mode) { }
48 virtual ~SafepointGenerator() {} 48 virtual ~SafepointGenerator() {}
49 49
50 virtual void BeforeCall(int call_size) const V8_OVERRIDE {} 50 virtual void BeforeCall(int call_size) const OVERRIDE {}
51 51
52 virtual void AfterCall() const V8_OVERRIDE { 52 virtual void AfterCall() const OVERRIDE {
53 codegen_->RecordSafepoint(pointers_, deopt_mode_); 53 codegen_->RecordSafepoint(pointers_, deopt_mode_);
54 } 54 }
55 55
56 private: 56 private:
57 LCodeGen* codegen_; 57 LCodeGen* codegen_;
58 LPointerMap* pointers_; 58 LPointerMap* pointers_;
59 Safepoint::DeoptMode deopt_mode_; 59 Safepoint::DeoptMode deopt_mode_;
60 }; 60 };
61 61
62 62
(...skipping 2623 matching lines...) Expand 10 before | Expand all | Expand 10 after
2686 __ Branch(&true_label, eq, result, Operand(zero_reg)); 2686 __ Branch(&true_label, eq, result, Operand(zero_reg));
2687 __ li(result, Operand(factory()->false_value())); 2687 __ li(result, Operand(factory()->false_value()));
2688 __ Branch(&done); 2688 __ Branch(&done);
2689 __ bind(&true_label); 2689 __ bind(&true_label);
2690 __ li(result, Operand(factory()->true_value())); 2690 __ li(result, Operand(factory()->true_value()));
2691 __ bind(&done); 2691 __ bind(&done);
2692 } 2692 }
2693 2693
2694 2694
2695 void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { 2695 void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) {
2696 class DeferredInstanceOfKnownGlobal V8_FINAL : public LDeferredCode { 2696 class DeferredInstanceOfKnownGlobal FINAL : public LDeferredCode {
2697 public: 2697 public:
2698 DeferredInstanceOfKnownGlobal(LCodeGen* codegen, 2698 DeferredInstanceOfKnownGlobal(LCodeGen* codegen,
2699 LInstanceOfKnownGlobal* instr) 2699 LInstanceOfKnownGlobal* instr)
2700 : LDeferredCode(codegen), instr_(instr) { } 2700 : LDeferredCode(codegen), instr_(instr) { }
2701 virtual void Generate() V8_OVERRIDE { 2701 virtual void Generate() OVERRIDE {
2702 codegen()->DoDeferredInstanceOfKnownGlobal(instr_, &map_check_); 2702 codegen()->DoDeferredInstanceOfKnownGlobal(instr_, &map_check_);
2703 } 2703 }
2704 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } 2704 virtual LInstruction* instr() OVERRIDE { return instr_; }
2705 Label* map_check() { return &map_check_; } 2705 Label* map_check() { return &map_check_; }
2706 2706
2707 private: 2707 private:
2708 LInstanceOfKnownGlobal* instr_; 2708 LInstanceOfKnownGlobal* instr_;
2709 Label map_check_; 2709 Label map_check_;
2710 }; 2710 };
2711 2711
2712 DeferredInstanceOfKnownGlobal* deferred; 2712 DeferredInstanceOfKnownGlobal* deferred;
2713 deferred = new(zone()) DeferredInstanceOfKnownGlobal(this, instr); 2713 deferred = new(zone()) DeferredInstanceOfKnownGlobal(this, instr);
2714 2714
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
3665 __ mov(result, input); 3665 __ mov(result, input);
3666 __ subu(result, zero_reg, input); 3666 __ subu(result, zero_reg, input);
3667 // Overflow if result is still negative, i.e. 0x80000000. 3667 // Overflow if result is still negative, i.e. 0x80000000.
3668 DeoptimizeIf(lt, instr->environment(), result, Operand(zero_reg)); 3668 DeoptimizeIf(lt, instr->environment(), result, Operand(zero_reg));
3669 __ bind(&done); 3669 __ bind(&done);
3670 } 3670 }
3671 3671
3672 3672
3673 void LCodeGen::DoMathAbs(LMathAbs* instr) { 3673 void LCodeGen::DoMathAbs(LMathAbs* instr) {
3674 // Class for deferred case. 3674 // Class for deferred case.
3675 class DeferredMathAbsTaggedHeapNumber V8_FINAL : public LDeferredCode { 3675 class DeferredMathAbsTaggedHeapNumber FINAL : public LDeferredCode {
3676 public: 3676 public:
3677 DeferredMathAbsTaggedHeapNumber(LCodeGen* codegen, LMathAbs* instr) 3677 DeferredMathAbsTaggedHeapNumber(LCodeGen* codegen, LMathAbs* instr)
3678 : LDeferredCode(codegen), instr_(instr) { } 3678 : LDeferredCode(codegen), instr_(instr) { }
3679 virtual void Generate() V8_OVERRIDE { 3679 virtual void Generate() OVERRIDE {
3680 codegen()->DoDeferredMathAbsTaggedHeapNumber(instr_); 3680 codegen()->DoDeferredMathAbsTaggedHeapNumber(instr_);
3681 } 3681 }
3682 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } 3682 virtual LInstruction* instr() OVERRIDE { return instr_; }
3683 private: 3683 private:
3684 LMathAbs* instr_; 3684 LMathAbs* instr_;
3685 }; 3685 };
3686 3686
3687 Representation r = instr->hydrogen()->value()->representation(); 3687 Representation r = instr->hydrogen()->value()->representation();
3688 if (r.IsDouble()) { 3688 if (r.IsDouble()) {
3689 FPURegister input = ToDoubleRegister(instr->value()); 3689 FPURegister input = ToDoubleRegister(instr->value());
3690 FPURegister result = ToDoubleRegister(instr->result()); 3690 FPURegister result = ToDoubleRegister(instr->result());
3691 __ abs_d(result, input); 3691 __ abs_d(result, input);
3692 } else if (r.IsSmiOrInteger32()) { 3692 } else if (r.IsSmiOrInteger32()) {
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
4451 DCHECK(ToRegister(instr->left()).is(a1)); 4451 DCHECK(ToRegister(instr->left()).is(a1));
4452 DCHECK(ToRegister(instr->right()).is(a0)); 4452 DCHECK(ToRegister(instr->right()).is(a0));
4453 StringAddStub stub(isolate(), 4453 StringAddStub stub(isolate(),
4454 instr->hydrogen()->flags(), 4454 instr->hydrogen()->flags(),
4455 instr->hydrogen()->pretenure_flag()); 4455 instr->hydrogen()->pretenure_flag());
4456 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); 4456 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
4457 } 4457 }
4458 4458
4459 4459
4460 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { 4460 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) {
4461 class DeferredStringCharCodeAt V8_FINAL : public LDeferredCode { 4461 class DeferredStringCharCodeAt FINAL : public LDeferredCode {
4462 public: 4462 public:
4463 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) 4463 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr)
4464 : LDeferredCode(codegen), instr_(instr) { } 4464 : LDeferredCode(codegen), instr_(instr) { }
4465 virtual void Generate() V8_OVERRIDE { 4465 virtual void Generate() OVERRIDE {
4466 codegen()->DoDeferredStringCharCodeAt(instr_); 4466 codegen()->DoDeferredStringCharCodeAt(instr_);
4467 } 4467 }
4468 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } 4468 virtual LInstruction* instr() OVERRIDE { return instr_; }
4469 private: 4469 private:
4470 LStringCharCodeAt* instr_; 4470 LStringCharCodeAt* instr_;
4471 }; 4471 };
4472 4472
4473 DeferredStringCharCodeAt* deferred = 4473 DeferredStringCharCodeAt* deferred =
4474 new(zone()) DeferredStringCharCodeAt(this, instr); 4474 new(zone()) DeferredStringCharCodeAt(this, instr);
4475 StringCharLoadGenerator::Generate(masm(), 4475 StringCharLoadGenerator::Generate(masm(),
4476 ToRegister(instr->string()), 4476 ToRegister(instr->string()),
4477 ToRegister(instr->index()), 4477 ToRegister(instr->index()),
4478 ToRegister(instr->result()), 4478 ToRegister(instr->result()),
(...skipping 27 matching lines...) Expand all
4506 } 4506 }
4507 CallRuntimeFromDeferred(Runtime::kStringCharCodeAtRT, 2, instr, 4507 CallRuntimeFromDeferred(Runtime::kStringCharCodeAtRT, 2, instr,
4508 instr->context()); 4508 instr->context());
4509 __ AssertSmi(v0); 4509 __ AssertSmi(v0);
4510 __ SmiUntag(v0); 4510 __ SmiUntag(v0);
4511 __ StoreToSafepointRegisterSlot(v0, result); 4511 __ StoreToSafepointRegisterSlot(v0, result);
4512 } 4512 }
4513 4513
4514 4514
4515 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) { 4515 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) {
4516 class DeferredStringCharFromCode V8_FINAL : public LDeferredCode { 4516 class DeferredStringCharFromCode FINAL : public LDeferredCode {
4517 public: 4517 public:
4518 DeferredStringCharFromCode(LCodeGen* codegen, LStringCharFromCode* instr) 4518 DeferredStringCharFromCode(LCodeGen* codegen, LStringCharFromCode* instr)
4519 : LDeferredCode(codegen), instr_(instr) { } 4519 : LDeferredCode(codegen), instr_(instr) { }
4520 virtual void Generate() V8_OVERRIDE { 4520 virtual void Generate() OVERRIDE {
4521 codegen()->DoDeferredStringCharFromCode(instr_); 4521 codegen()->DoDeferredStringCharFromCode(instr_);
4522 } 4522 }
4523 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } 4523 virtual LInstruction* instr() OVERRIDE { return instr_; }
4524 private: 4524 private:
4525 LStringCharFromCode* instr_; 4525 LStringCharFromCode* instr_;
4526 }; 4526 };
4527 4527
4528 DeferredStringCharFromCode* deferred = 4528 DeferredStringCharFromCode* deferred =
4529 new(zone()) DeferredStringCharFromCode(this, instr); 4529 new(zone()) DeferredStringCharFromCode(this, instr);
4530 4530
4531 DCHECK(instr->hydrogen()->value()->representation().IsInteger32()); 4531 DCHECK(instr->hydrogen()->value()->representation().IsInteger32());
4532 Register char_code = ToRegister(instr->char_code()); 4532 Register char_code = ToRegister(instr->char_code());
4533 Register result = ToRegister(instr->result()); 4533 Register result = ToRegister(instr->result());
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
4584 LOperand* input = instr->value(); 4584 LOperand* input = instr->value();
4585 LOperand* output = instr->result(); 4585 LOperand* output = instr->result();
4586 4586
4587 FPURegister dbl_scratch = double_scratch0(); 4587 FPURegister dbl_scratch = double_scratch0();
4588 __ mtc1(ToRegister(input), dbl_scratch); 4588 __ mtc1(ToRegister(input), dbl_scratch);
4589 __ Cvt_d_uw(ToDoubleRegister(output), dbl_scratch, f22); 4589 __ Cvt_d_uw(ToDoubleRegister(output), dbl_scratch, f22);
4590 } 4590 }
4591 4591
4592 4592
4593 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { 4593 void LCodeGen::DoNumberTagI(LNumberTagI* instr) {
4594 class DeferredNumberTagI V8_FINAL : public LDeferredCode { 4594 class DeferredNumberTagI FINAL : public LDeferredCode {
4595 public: 4595 public:
4596 DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr) 4596 DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr)
4597 : LDeferredCode(codegen), instr_(instr) { } 4597 : LDeferredCode(codegen), instr_(instr) { }
4598 virtual void Generate() V8_OVERRIDE { 4598 virtual void Generate() OVERRIDE {
4599 codegen()->DoDeferredNumberTagIU(instr_, 4599 codegen()->DoDeferredNumberTagIU(instr_,
4600 instr_->value(), 4600 instr_->value(),
4601 instr_->temp1(), 4601 instr_->temp1(),
4602 instr_->temp2(), 4602 instr_->temp2(),
4603 SIGNED_INT32); 4603 SIGNED_INT32);
4604 } 4604 }
4605 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } 4605 virtual LInstruction* instr() OVERRIDE { return instr_; }
4606 private: 4606 private:
4607 LNumberTagI* instr_; 4607 LNumberTagI* instr_;
4608 }; 4608 };
4609 4609
4610 Register src = ToRegister(instr->value()); 4610 Register src = ToRegister(instr->value());
4611 Register dst = ToRegister(instr->result()); 4611 Register dst = ToRegister(instr->result());
4612 Register overflow = scratch0(); 4612 Register overflow = scratch0();
4613 4613
4614 DeferredNumberTagI* deferred = new(zone()) DeferredNumberTagI(this, instr); 4614 DeferredNumberTagI* deferred = new(zone()) DeferredNumberTagI(this, instr);
4615 __ SmiTagCheckOverflow(dst, src, overflow); 4615 __ SmiTagCheckOverflow(dst, src, overflow);
4616 __ BranchOnOverflow(deferred->entry(), overflow); 4616 __ BranchOnOverflow(deferred->entry(), overflow);
4617 __ bind(deferred->exit()); 4617 __ bind(deferred->exit());
4618 } 4618 }
4619 4619
4620 4620
4621 void LCodeGen::DoNumberTagU(LNumberTagU* instr) { 4621 void LCodeGen::DoNumberTagU(LNumberTagU* instr) {
4622 class DeferredNumberTagU V8_FINAL : public LDeferredCode { 4622 class DeferredNumberTagU FINAL : public LDeferredCode {
4623 public: 4623 public:
4624 DeferredNumberTagU(LCodeGen* codegen, LNumberTagU* instr) 4624 DeferredNumberTagU(LCodeGen* codegen, LNumberTagU* instr)
4625 : LDeferredCode(codegen), instr_(instr) { } 4625 : LDeferredCode(codegen), instr_(instr) { }
4626 virtual void Generate() V8_OVERRIDE { 4626 virtual void Generate() OVERRIDE {
4627 codegen()->DoDeferredNumberTagIU(instr_, 4627 codegen()->DoDeferredNumberTagIU(instr_,
4628 instr_->value(), 4628 instr_->value(),
4629 instr_->temp1(), 4629 instr_->temp1(),
4630 instr_->temp2(), 4630 instr_->temp2(),
4631 UNSIGNED_INT32); 4631 UNSIGNED_INT32);
4632 } 4632 }
4633 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } 4633 virtual LInstruction* instr() OVERRIDE { return instr_; }
4634 private: 4634 private:
4635 LNumberTagU* instr_; 4635 LNumberTagU* instr_;
4636 }; 4636 };
4637 4637
4638 Register input = ToRegister(instr->value()); 4638 Register input = ToRegister(instr->value());
4639 Register result = ToRegister(instr->result()); 4639 Register result = ToRegister(instr->result());
4640 4640
4641 DeferredNumberTagU* deferred = new(zone()) DeferredNumberTagU(this, instr); 4641 DeferredNumberTagU* deferred = new(zone()) DeferredNumberTagU(this, instr);
4642 __ Branch(deferred->entry(), hi, input, Operand(Smi::kMaxValue)); 4642 __ Branch(deferred->entry(), hi, input, Operand(Smi::kMaxValue));
4643 __ SmiTag(result, input); 4643 __ SmiTag(result, input);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
4706 4706
4707 // Done. Put the value in dbl_scratch into the value of the allocated heap 4707 // Done. Put the value in dbl_scratch into the value of the allocated heap
4708 // number. 4708 // number.
4709 __ bind(&done); 4709 __ bind(&done);
4710 __ sdc1(dbl_scratch, MemOperand(dst, HeapNumber::kValueOffset)); 4710 __ sdc1(dbl_scratch, MemOperand(dst, HeapNumber::kValueOffset));
4711 __ Addu(dst, dst, kHeapObjectTag); 4711 __ Addu(dst, dst, kHeapObjectTag);
4712 } 4712 }
4713 4713
4714 4714
4715 void LCodeGen::DoNumberTagD(LNumberTagD* instr) { 4715 void LCodeGen::DoNumberTagD(LNumberTagD* instr) {
4716 class DeferredNumberTagD V8_FINAL : public LDeferredCode { 4716 class DeferredNumberTagD FINAL : public LDeferredCode {
4717 public: 4717 public:
4718 DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr) 4718 DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr)
4719 : LDeferredCode(codegen), instr_(instr) { } 4719 : LDeferredCode(codegen), instr_(instr) { }
4720 virtual void Generate() V8_OVERRIDE { 4720 virtual void Generate() OVERRIDE {
4721 codegen()->DoDeferredNumberTagD(instr_); 4721 codegen()->DoDeferredNumberTagD(instr_);
4722 } 4722 }
4723 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } 4723 virtual LInstruction* instr() OVERRIDE { return instr_; }
4724 private: 4724 private:
4725 LNumberTagD* instr_; 4725 LNumberTagD* instr_;
4726 }; 4726 };
4727 4727
4728 DoubleRegister input_reg = ToDoubleRegister(instr->value()); 4728 DoubleRegister input_reg = ToDoubleRegister(instr->value());
4729 Register scratch = scratch0(); 4729 Register scratch = scratch0();
4730 Register reg = ToRegister(instr->result()); 4730 Register reg = ToRegister(instr->result());
4731 Register temp1 = ToRegister(instr->temp()); 4731 Register temp1 = ToRegister(instr->temp());
4732 Register temp2 = ToRegister(instr->temp2()); 4732 Register temp2 = ToRegister(instr->temp2());
4733 4733
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
4929 __ Mfhc1(scratch1, double_scratch); 4929 __ Mfhc1(scratch1, double_scratch);
4930 __ And(scratch1, scratch1, Operand(HeapNumber::kSignMask)); 4930 __ And(scratch1, scratch1, Operand(HeapNumber::kSignMask));
4931 DeoptimizeIf(ne, instr->environment(), scratch1, Operand(zero_reg)); 4931 DeoptimizeIf(ne, instr->environment(), scratch1, Operand(zero_reg));
4932 } 4932 }
4933 } 4933 }
4934 __ bind(&done); 4934 __ bind(&done);
4935 } 4935 }
4936 4936
4937 4937
4938 void LCodeGen::DoTaggedToI(LTaggedToI* instr) { 4938 void LCodeGen::DoTaggedToI(LTaggedToI* instr) {
4939 class DeferredTaggedToI V8_FINAL : public LDeferredCode { 4939 class DeferredTaggedToI FINAL : public LDeferredCode {
4940 public: 4940 public:
4941 DeferredTaggedToI(LCodeGen* codegen, LTaggedToI* instr) 4941 DeferredTaggedToI(LCodeGen* codegen, LTaggedToI* instr)
4942 : LDeferredCode(codegen), instr_(instr) { } 4942 : LDeferredCode(codegen), instr_(instr) { }
4943 virtual void Generate() V8_OVERRIDE { 4943 virtual void Generate() OVERRIDE {
4944 codegen()->DoDeferredTaggedToI(instr_); 4944 codegen()->DoDeferredTaggedToI(instr_);
4945 } 4945 }
4946 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } 4946 virtual LInstruction* instr() OVERRIDE { return instr_; }
4947 private: 4947 private:
4948 LTaggedToI* instr_; 4948 LTaggedToI* instr_;
4949 }; 4949 };
4950 4950
4951 LOperand* input = instr->value(); 4951 LOperand* input = instr->value();
4952 DCHECK(input->IsRegister()); 4952 DCHECK(input->IsRegister());
4953 DCHECK(input->Equals(instr->result())); 4953 DCHECK(input->Equals(instr->result()));
4954 4954
4955 Register input_reg = ToRegister(input); 4955 Register input_reg = ToRegister(input);
4956 4956
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
5140 RecordSafepointWithRegisters( 5140 RecordSafepointWithRegisters(
5141 instr->pointer_map(), 1, Safepoint::kNoLazyDeopt); 5141 instr->pointer_map(), 1, Safepoint::kNoLazyDeopt);
5142 __ StoreToSafepointRegisterSlot(v0, scratch0()); 5142 __ StoreToSafepointRegisterSlot(v0, scratch0());
5143 } 5143 }
5144 __ SmiTst(scratch0(), at); 5144 __ SmiTst(scratch0(), at);
5145 DeoptimizeIf(eq, instr->environment(), at, Operand(zero_reg)); 5145 DeoptimizeIf(eq, instr->environment(), at, Operand(zero_reg));
5146 } 5146 }
5147 5147
5148 5148
5149 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { 5149 void LCodeGen::DoCheckMaps(LCheckMaps* instr) {
5150 class DeferredCheckMaps V8_FINAL : public LDeferredCode { 5150 class DeferredCheckMaps FINAL : public LDeferredCode {
5151 public: 5151 public:
5152 DeferredCheckMaps(LCodeGen* codegen, LCheckMaps* instr, Register object) 5152 DeferredCheckMaps(LCodeGen* codegen, LCheckMaps* instr, Register object)
5153 : LDeferredCode(codegen), instr_(instr), object_(object) { 5153 : LDeferredCode(codegen), instr_(instr), object_(object) {
5154 SetExit(check_maps()); 5154 SetExit(check_maps());
5155 } 5155 }
5156 virtual void Generate() V8_OVERRIDE { 5156 virtual void Generate() OVERRIDE {
5157 codegen()->DoDeferredInstanceMigration(instr_, object_); 5157 codegen()->DoDeferredInstanceMigration(instr_, object_);
5158 } 5158 }
5159 Label* check_maps() { return &check_maps_; } 5159 Label* check_maps() { return &check_maps_; }
5160 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } 5160 virtual LInstruction* instr() OVERRIDE { return instr_; }
5161 private: 5161 private:
5162 LCheckMaps* instr_; 5162 LCheckMaps* instr_;
5163 Label check_maps_; 5163 Label check_maps_;
5164 Register object_; 5164 Register object_;
5165 }; 5165 };
5166 5166
5167 if (instr->hydrogen()->IsStabilityCheck()) { 5167 if (instr->hydrogen()->IsStabilityCheck()) {
5168 const UniqueSet<Map>* maps = instr->hydrogen()->maps(); 5168 const UniqueSet<Map>* maps = instr->hydrogen()->maps();
5169 for (int i = 0; i < maps->size(); ++i) { 5169 for (int i = 0; i < maps->size(); ++i) {
5170 AddStabilityDependency(maps->at(i).handle()); 5170 AddStabilityDependency(maps->at(i).handle());
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
5265 5265
5266 void LCodeGen::DoConstructDouble(LConstructDouble* instr) { 5266 void LCodeGen::DoConstructDouble(LConstructDouble* instr) {
5267 Register hi_reg = ToRegister(instr->hi()); 5267 Register hi_reg = ToRegister(instr->hi());
5268 Register lo_reg = ToRegister(instr->lo()); 5268 Register lo_reg = ToRegister(instr->lo());
5269 DoubleRegister result_reg = ToDoubleRegister(instr->result()); 5269 DoubleRegister result_reg = ToDoubleRegister(instr->result());
5270 __ Move(result_reg, lo_reg, hi_reg); 5270 __ Move(result_reg, lo_reg, hi_reg);
5271 } 5271 }
5272 5272
5273 5273
5274 void LCodeGen::DoAllocate(LAllocate* instr) { 5274 void LCodeGen::DoAllocate(LAllocate* instr) {
5275 class DeferredAllocate V8_FINAL : public LDeferredCode { 5275 class DeferredAllocate FINAL : public LDeferredCode {
5276 public: 5276 public:
5277 DeferredAllocate(LCodeGen* codegen, LAllocate* instr) 5277 DeferredAllocate(LCodeGen* codegen, LAllocate* instr)
5278 : LDeferredCode(codegen), instr_(instr) { } 5278 : LDeferredCode(codegen), instr_(instr) { }
5279 virtual void Generate() V8_OVERRIDE { 5279 virtual void Generate() OVERRIDE {
5280 codegen()->DoDeferredAllocate(instr_); 5280 codegen()->DoDeferredAllocate(instr_);
5281 } 5281 }
5282 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } 5282 virtual LInstruction* instr() OVERRIDE { return instr_; }
5283 private: 5283 private:
5284 LAllocate* instr_; 5284 LAllocate* instr_;
5285 }; 5285 };
5286 5286
5287 DeferredAllocate* deferred = 5287 DeferredAllocate* deferred =
5288 new(zone()) DeferredAllocate(this, instr); 5288 new(zone()) DeferredAllocate(this, instr);
5289 5289
5290 Register result = ToRegister(instr->result()); 5290 Register result = ToRegister(instr->result());
5291 Register scratch = ToRegister(instr->temp1()); 5291 Register scratch = ToRegister(instr->temp1());
5292 Register scratch2 = ToRegister(instr->temp2()); 5292 Register scratch2 = ToRegister(instr->temp2());
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
5679 __ CallRuntimeSaveDoubles(Runtime::kStackGuard); 5679 __ CallRuntimeSaveDoubles(Runtime::kStackGuard);
5680 RecordSafepointWithLazyDeopt( 5680 RecordSafepointWithLazyDeopt(
5681 instr, RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS); 5681 instr, RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS);
5682 DCHECK(instr->HasEnvironment()); 5682 DCHECK(instr->HasEnvironment());
5683 LEnvironment* env = instr->environment(); 5683 LEnvironment* env = instr->environment();
5684 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); 5684 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index());
5685 } 5685 }
5686 5686
5687 5687
5688 void LCodeGen::DoStackCheck(LStackCheck* instr) { 5688 void LCodeGen::DoStackCheck(LStackCheck* instr) {
5689 class DeferredStackCheck V8_FINAL : public LDeferredCode { 5689 class DeferredStackCheck FINAL : public LDeferredCode {
5690 public: 5690 public:
5691 DeferredStackCheck(LCodeGen* codegen, LStackCheck* instr) 5691 DeferredStackCheck(LCodeGen* codegen, LStackCheck* instr)
5692 : LDeferredCode(codegen), instr_(instr) { } 5692 : LDeferredCode(codegen), instr_(instr) { }
5693 virtual void Generate() V8_OVERRIDE { 5693 virtual void Generate() OVERRIDE {
5694 codegen()->DoDeferredStackCheck(instr_); 5694 codegen()->DoDeferredStackCheck(instr_);
5695 } 5695 }
5696 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } 5696 virtual LInstruction* instr() OVERRIDE { return instr_; }
5697 private: 5697 private:
5698 LStackCheck* instr_; 5698 LStackCheck* instr_;
5699 }; 5699 };
5700 5700
5701 DCHECK(instr->HasEnvironment()); 5701 DCHECK(instr->HasEnvironment());
5702 LEnvironment* env = instr->environment(); 5702 LEnvironment* env = instr->environment();
5703 // There is no LLazyBailout instruction for stack-checks. We have to 5703 // There is no LLazyBailout instruction for stack-checks. We have to
5704 // prepare for lazy deoptimization explicitly here. 5704 // prepare for lazy deoptimization explicitly here.
5705 if (instr->hydrogen()->is_function_entry()) { 5705 if (instr->hydrogen()->is_function_entry()) {
5706 // Perform stack overflow check. 5706 // Perform stack overflow check.
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
5820 __ Push(object, index); 5820 __ Push(object, index);
5821 __ mov(cp, zero_reg); 5821 __ mov(cp, zero_reg);
5822 __ CallRuntimeSaveDoubles(Runtime::kLoadMutableDouble); 5822 __ CallRuntimeSaveDoubles(Runtime::kLoadMutableDouble);
5823 RecordSafepointWithRegisters( 5823 RecordSafepointWithRegisters(
5824 instr->pointer_map(), 2, Safepoint::kNoLazyDeopt); 5824 instr->pointer_map(), 2, Safepoint::kNoLazyDeopt);
5825 __ StoreToSafepointRegisterSlot(v0, result); 5825 __ StoreToSafepointRegisterSlot(v0, result);
5826 } 5826 }
5827 5827
5828 5828
5829 void LCodeGen::DoLoadFieldByIndex(LLoadFieldByIndex* instr) { 5829 void LCodeGen::DoLoadFieldByIndex(LLoadFieldByIndex* instr) {
5830 class DeferredLoadMutableDouble V8_FINAL : public LDeferredCode { 5830 class DeferredLoadMutableDouble FINAL : public LDeferredCode {
5831 public: 5831 public:
5832 DeferredLoadMutableDouble(LCodeGen* codegen, 5832 DeferredLoadMutableDouble(LCodeGen* codegen,
5833 LLoadFieldByIndex* instr, 5833 LLoadFieldByIndex* instr,
5834 Register result, 5834 Register result,
5835 Register object, 5835 Register object,
5836 Register index) 5836 Register index)
5837 : LDeferredCode(codegen), 5837 : LDeferredCode(codegen),
5838 instr_(instr), 5838 instr_(instr),
5839 result_(result), 5839 result_(result),
5840 object_(object), 5840 object_(object),
5841 index_(index) { 5841 index_(index) {
5842 } 5842 }
5843 virtual void Generate() V8_OVERRIDE { 5843 virtual void Generate() OVERRIDE {
5844 codegen()->DoDeferredLoadMutableDouble(instr_, result_, object_, index_); 5844 codegen()->DoDeferredLoadMutableDouble(instr_, result_, object_, index_);
5845 } 5845 }
5846 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } 5846 virtual LInstruction* instr() OVERRIDE { return instr_; }
5847 private: 5847 private:
5848 LLoadFieldByIndex* instr_; 5848 LLoadFieldByIndex* instr_;
5849 Register result_; 5849 Register result_;
5850 Register object_; 5850 Register object_;
5851 Register index_; 5851 Register index_;
5852 }; 5852 };
5853 5853
5854 Register object = ToRegister(instr->object()); 5854 Register object = ToRegister(instr->object());
5855 Register index = ToRegister(instr->index()); 5855 Register index = ToRegister(instr->index());
5856 Register result = ToRegister(instr->result()); 5856 Register result = ToRegister(instr->result());
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
5897 __ li(at, scope_info); 5897 __ li(at, scope_info);
5898 __ Push(at, ToRegister(instr->function())); 5898 __ Push(at, ToRegister(instr->function()));
5899 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5899 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5900 RecordSafepoint(Safepoint::kNoLazyDeopt); 5900 RecordSafepoint(Safepoint::kNoLazyDeopt);
5901 } 5901 }
5902 5902
5903 5903
5904 #undef __ 5904 #undef __
5905 5905
5906 } } // namespace v8::internal 5906 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips/lithium-codegen-mips.h ('k') | src/mips/lithium-gap-resolver-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698