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

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

Issue 139973004: A64: Synchronize with r15814. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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/ic-mips.cc ('k') | 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. 1 // Copyright 2012 the V8 project authors. All rights reserved.
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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 if (NeedsEagerFrame()) { 152 if (NeedsEagerFrame()) {
153 if (info()->IsStub()) { 153 if (info()->IsStub()) {
154 __ Push(ra, fp, cp); 154 __ Push(ra, fp, cp);
155 __ Push(Smi::FromInt(StackFrame::STUB)); 155 __ Push(Smi::FromInt(StackFrame::STUB));
156 // Adjust FP to point to saved FP. 156 // Adjust FP to point to saved FP.
157 __ Addu(fp, sp, Operand(2 * kPointerSize)); 157 __ Addu(fp, sp, Operand(2 * kPointerSize));
158 } else { 158 } else {
159 // The following three instructions must remain together and unmodified 159 // The following three instructions must remain together and unmodified
160 // for code aging to work properly. 160 // for code aging to work properly.
161 __ Push(ra, fp, cp, a1); 161 __ Push(ra, fp, cp, a1);
162 // Add unused load of ip to ensure prologue sequence is identical for 162 // Add unused nop to ensure prologue sequence is identical for
163 // full-codegen and lithium-codegen. 163 // full-codegen and lithium-codegen.
164 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); 164 __ nop(Assembler::CODE_AGE_SEQUENCE_NOP);
165 // Adj. FP to point to saved FP. 165 // Adj. FP to point to saved FP.
166 __ Addu(fp, sp, Operand(2 * kPointerSize)); 166 __ Addu(fp, sp, Operand(2 * kPointerSize));
167 } 167 }
168 frame_is_built_ = true; 168 frame_is_built_ = true;
169 info_->AddNoFrameRange(0, masm_->pc_offset()); 169 info_->AddNoFrameRange(0, masm_->pc_offset());
170 } 170 }
171 171
172 // Reserve space for the stack slots needed by the code. 172 // Reserve space for the stack slots needed by the code.
173 int slots = GetStackSlotCount(); 173 int slots = GetStackSlotCount();
174 if (slots > 0) { 174 if (slots > 0) {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 if (FLAG_code_comments && instr->HasInterestingComment(this)) { 264 if (FLAG_code_comments && instr->HasInterestingComment(this)) {
265 Comment(";;; <@%d,#%d> %s", 265 Comment(";;; <@%d,#%d> %s",
266 current_instruction_, 266 current_instruction_,
267 instr->hydrogen_value()->id(), 267 instr->hydrogen_value()->id(),
268 instr->Mnemonic()); 268 instr->Mnemonic());
269 } 269 }
270 270
271 instr->CompileToNative(this); 271 instr->CompileToNative(this);
272 } 272 }
273 EnsureSpaceForLazyDeopt(); 273 EnsureSpaceForLazyDeopt();
274 last_lazy_deopt_pc_ = masm()->pc_offset();
274 return !is_aborted(); 275 return !is_aborted();
275 } 276 }
276 277
277 278
278 bool LCodeGen::GenerateDeferredCode() { 279 bool LCodeGen::GenerateDeferredCode() {
279 ASSERT(is_generating()); 280 ASSERT(is_generating());
280 if (deferred_.length() > 0) { 281 if (deferred_.length() > 0) {
281 for (int i = 0; !is_aborted() && i < deferred_.length(); i++) { 282 for (int i = 0; !is_aborted() && i < deferred_.length(); i++) {
282 LDeferredCode* code = deferred_[i]; 283 LDeferredCode* code = deferred_[i];
283 Comment(";;; <@%d,#%d> " 284 Comment(";;; <@%d,#%d> "
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
1017 case CodeStub::SubString: { 1018 case CodeStub::SubString: {
1018 SubStringStub stub; 1019 SubStringStub stub;
1019 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); 1020 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
1020 break; 1021 break;
1021 } 1022 }
1022 case CodeStub::NumberToString: { 1023 case CodeStub::NumberToString: {
1023 NumberToStringStub stub; 1024 NumberToStringStub stub;
1024 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); 1025 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
1025 break; 1026 break;
1026 } 1027 }
1027 case CodeStub::StringAdd: {
1028 StringAddStub stub(NO_STRING_ADD_FLAGS);
1029 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
1030 break;
1031 }
1032 case CodeStub::StringCompare: { 1028 case CodeStub::StringCompare: {
1033 StringCompareStub stub; 1029 StringCompareStub stub;
1034 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); 1030 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
1035 break; 1031 break;
1036 } 1032 }
1037 case CodeStub::TranscendentalCache: { 1033 case CodeStub::TranscendentalCache: {
1038 __ lw(a0, MemOperand(sp, 0)); 1034 __ lw(a0, MemOperand(sp, 0));
1039 TranscendentalCacheStub stub(instr->transcendental_type(), 1035 TranscendentalCacheStub stub(instr->transcendental_type(),
1040 TranscendentalCacheStub::TAGGED); 1036 TranscendentalCacheStub::TAGGED);
1041 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); 1037 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
(...skipping 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after
2787 ASSERT(ToRegister(instr->value()).is(a0)); 2783 ASSERT(ToRegister(instr->value()).is(a0));
2788 2784
2789 __ li(a2, Operand(instr->name())); 2785 __ li(a2, Operand(instr->name()));
2790 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) 2786 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode)
2791 ? isolate()->builtins()->StoreIC_Initialize_Strict() 2787 ? isolate()->builtins()->StoreIC_Initialize_Strict()
2792 : isolate()->builtins()->StoreIC_Initialize(); 2788 : isolate()->builtins()->StoreIC_Initialize();
2793 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr); 2789 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr);
2794 } 2790 }
2795 2791
2796 2792
2793 void LCodeGen::DoLinkObjectInList(LLinkObjectInList* instr) {
2794 Register object = ToRegister(instr->object());
2795 ExternalReference sites_list_address = instr->GetReference(isolate());
2796
2797 __ li(at, Operand(sites_list_address));
2798 __ lw(at, MemOperand(at));
2799 __ sw(at, FieldMemOperand(object,
2800 instr->hydrogen()->store_field().offset()));
2801 __ li(at, Operand(sites_list_address));
2802 __ sw(object, MemOperand(at));
2803 }
2804
2805
2797 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { 2806 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
2798 Register context = ToRegister(instr->context()); 2807 Register context = ToRegister(instr->context());
2799 Register result = ToRegister(instr->result()); 2808 Register result = ToRegister(instr->result());
2800 2809
2801 __ lw(result, ContextOperand(context, instr->slot_index())); 2810 __ lw(result, ContextOperand(context, instr->slot_index()));
2802 if (instr->hydrogen()->RequiresHoleCheck()) { 2811 if (instr->hydrogen()->RequiresHoleCheck()) {
2803 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); 2812 __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
2804 2813
2805 if (instr->hydrogen()->DeoptimizesOnHole()) { 2814 if (instr->hydrogen()->DeoptimizesOnHole()) {
2806 DeoptimizeIf(eq, instr->environment(), result, Operand(at)); 2815 DeoptimizeIf(eq, instr->environment(), result, Operand(at));
(...skipping 1642 matching lines...) Expand 10 before | Expand all | Expand 10 after
4449 UNREACHABLE(); 4458 UNREACHABLE();
4450 } 4459 }
4451 __ bind(&not_applicable); 4460 __ bind(&not_applicable);
4452 } 4461 }
4453 4462
4454 4463
4455 void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) { 4464 void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) {
4456 Register object = ToRegister(instr->object()); 4465 Register object = ToRegister(instr->object());
4457 Register temp = ToRegister(instr->temp()); 4466 Register temp = ToRegister(instr->temp());
4458 Label fail; 4467 Label fail;
4459 __ TestJSArrayForAllocationSiteInfo(object, temp, ne, &fail); 4468 __ TestJSArrayForAllocationMemento(object, temp, ne, &fail);
4460 DeoptimizeIf(al, instr->environment()); 4469 DeoptimizeIf(al, instr->environment());
4461 __ bind(&fail); 4470 __ bind(&fail);
4462 } 4471 }
4463 4472
4464 4473
4465 void LCodeGen::DoStringAdd(LStringAdd* instr) { 4474 void LCodeGen::DoStringAdd(LStringAdd* instr) {
4466 __ push(ToRegister(instr->left())); 4475 __ push(ToRegister(instr->left()));
4467 __ push(ToRegister(instr->right())); 4476 __ push(ToRegister(instr->right()));
4468 StringAddStub stub(NO_STRING_CHECK_IN_STUB); 4477 StringAddStub stub(instr->hydrogen()->flags());
4469 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); 4478 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
4470 } 4479 }
4471 4480
4472 4481
4473 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { 4482 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) {
4474 class DeferredStringCharCodeAt: public LDeferredCode { 4483 class DeferredStringCharCodeAt: public LDeferredCode {
4475 public: 4484 public:
4476 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) 4485 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr)
4477 : LDeferredCode(codegen), instr_(instr) { } 4486 : LDeferredCode(codegen), instr_(instr) { }
4478 virtual void Generate() { codegen()->DoDeferredStringCharCodeAt(instr_); } 4487 virtual void Generate() { codegen()->DoDeferredStringCharCodeAt(instr_); }
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
5308 Register size = ToRegister(instr->size()); 5317 Register size = ToRegister(instr->size());
5309 __ Allocate(size, 5318 __ Allocate(size,
5310 result, 5319 result,
5311 scratch, 5320 scratch,
5312 scratch2, 5321 scratch2,
5313 deferred->entry(), 5322 deferred->entry(),
5314 flags); 5323 flags);
5315 } 5324 }
5316 5325
5317 __ bind(deferred->exit()); 5326 __ bind(deferred->exit());
5327
5328 if (instr->hydrogen()->MustPrefillWithFiller()) {
5329 if (instr->size()->IsConstantOperand()) {
5330 int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
5331 __ li(scratch, Operand(size));
5332 } else {
5333 scratch = ToRegister(instr->size());
5334 }
5335 __ Subu(scratch, scratch, Operand(kPointerSize));
5336 __ Subu(result, result, Operand(kHeapObjectTag));
5337 Label loop;
5338 __ bind(&loop);
5339 __ li(scratch2, Operand(isolate()->factory()->one_pointer_filler_map()));
5340 __ Addu(at, result, Operand(scratch));
5341 __ sw(scratch2, MemOperand(at));
5342 __ Subu(scratch, scratch, Operand(kPointerSize));
5343 __ Branch(&loop, ge, scratch, Operand(zero_reg));
5344 __ Addu(result, result, Operand(kHeapObjectTag));
5345 }
5318 } 5346 }
5319 5347
5320 5348
5321 void LCodeGen::DoDeferredAllocate(LAllocate* instr) { 5349 void LCodeGen::DoDeferredAllocate(LAllocate* instr) {
5322 Register result = ToRegister(instr->result()); 5350 Register result = ToRegister(instr->result());
5323 5351
5324 // TODO(3095996): Get rid of this. For now, we need to make the 5352 // TODO(3095996): Get rid of this. For now, we need to make the
5325 // result register contain a valid pointer because it is already 5353 // result register contain a valid pointer because it is already
5326 // contained in the register pointer map. 5354 // contained in the register pointer map.
5327 __ mov(result, zero_reg); 5355 __ mov(result, zero_reg);
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
5600 int current_pc = masm()->pc_offset(); 5628 int current_pc = masm()->pc_offset();
5601 int patch_size = Deoptimizer::patch_size(); 5629 int patch_size = Deoptimizer::patch_size();
5602 if (current_pc < last_lazy_deopt_pc_ + patch_size) { 5630 if (current_pc < last_lazy_deopt_pc_ + patch_size) {
5603 int padding_size = last_lazy_deopt_pc_ + patch_size - current_pc; 5631 int padding_size = last_lazy_deopt_pc_ + patch_size - current_pc;
5604 ASSERT_EQ(0, padding_size % Assembler::kInstrSize); 5632 ASSERT_EQ(0, padding_size % Assembler::kInstrSize);
5605 while (padding_size > 0) { 5633 while (padding_size > 0) {
5606 __ nop(); 5634 __ nop();
5607 padding_size -= Assembler::kInstrSize; 5635 padding_size -= Assembler::kInstrSize;
5608 } 5636 }
5609 } 5637 }
5610 last_lazy_deopt_pc_ = masm()->pc_offset();
5611 } 5638 }
5612 5639
5613 5640
5614 void LCodeGen::DoLazyBailout(LLazyBailout* instr) { 5641 void LCodeGen::DoLazyBailout(LLazyBailout* instr) {
5615 EnsureSpaceForLazyDeopt(); 5642 EnsureSpaceForLazyDeopt();
5643 last_lazy_deopt_pc_ = masm()->pc_offset();
5616 ASSERT(instr->HasEnvironment()); 5644 ASSERT(instr->HasEnvironment());
5617 LEnvironment* env = instr->environment(); 5645 LEnvironment* env = instr->environment();
5618 RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); 5646 RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt);
5619 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); 5647 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index());
5620 } 5648 }
5621 5649
5622 5650
5623 void LCodeGen::DoDeoptimize(LDeoptimize* instr) { 5651 void LCodeGen::DoDeoptimize(LDeoptimize* instr) {
5624 if (instr->hydrogen_value()->IsSoftDeoptimize()) { 5652 if (instr->hydrogen_value()->IsSoftDeoptimize()) {
5625 SoftDeoptimize(instr->environment(), zero_reg, Operand(zero_reg)); 5653 SoftDeoptimize(instr->environment(), zero_reg, Operand(zero_reg));
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
5661 // There is no LLazyBailout instruction for stack-checks. We have to 5689 // There is no LLazyBailout instruction for stack-checks. We have to
5662 // prepare for lazy deoptimization explicitly here. 5690 // prepare for lazy deoptimization explicitly here.
5663 if (instr->hydrogen()->is_function_entry()) { 5691 if (instr->hydrogen()->is_function_entry()) {
5664 // Perform stack overflow check. 5692 // Perform stack overflow check.
5665 Label done; 5693 Label done;
5666 __ LoadRoot(at, Heap::kStackLimitRootIndex); 5694 __ LoadRoot(at, Heap::kStackLimitRootIndex);
5667 __ Branch(&done, hs, sp, Operand(at)); 5695 __ Branch(&done, hs, sp, Operand(at));
5668 StackCheckStub stub; 5696 StackCheckStub stub;
5669 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); 5697 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
5670 EnsureSpaceForLazyDeopt(); 5698 EnsureSpaceForLazyDeopt();
5699 last_lazy_deopt_pc_ = masm()->pc_offset();
5671 __ bind(&done); 5700 __ bind(&done);
5672 RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); 5701 RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt);
5673 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); 5702 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index());
5674 } else { 5703 } else {
5675 ASSERT(instr->hydrogen()->is_backwards_branch()); 5704 ASSERT(instr->hydrogen()->is_backwards_branch());
5676 // Perform stack overflow check if this goto needs it before jumping. 5705 // Perform stack overflow check if this goto needs it before jumping.
5677 DeferredStackCheck* deferred_stack_check = 5706 DeferredStackCheck* deferred_stack_check =
5678 new(zone()) DeferredStackCheck(this, instr); 5707 new(zone()) DeferredStackCheck(this, instr);
5679 __ LoadRoot(at, Heap::kStackLimitRootIndex); 5708 __ LoadRoot(at, Heap::kStackLimitRootIndex);
5680 __ Branch(deferred_stack_check->entry(), lo, sp, Operand(at)); 5709 __ Branch(deferred_stack_check->entry(), lo, sp, Operand(at));
5681 EnsureSpaceForLazyDeopt(); 5710 EnsureSpaceForLazyDeopt();
5711 last_lazy_deopt_pc_ = masm()->pc_offset();
5682 __ bind(instr->done_label()); 5712 __ bind(instr->done_label());
5683 deferred_stack_check->SetExit(instr->done_label()); 5713 deferred_stack_check->SetExit(instr->done_label());
5684 RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); 5714 RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt);
5685 // Don't record a deoptimization index for the safepoint here. 5715 // Don't record a deoptimization index for the safepoint here.
5686 // This will be done explicitly when emitting call and the safepoint in 5716 // This will be done explicitly when emitting call and the safepoint in
5687 // the deferred code. 5717 // the deferred code.
5688 } 5718 }
5689 } 5719 }
5690 5720
5691 5721
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
5794 __ Subu(scratch, result, scratch); 5824 __ Subu(scratch, result, scratch);
5795 __ lw(result, FieldMemOperand(scratch, 5825 __ lw(result, FieldMemOperand(scratch,
5796 FixedArray::kHeaderSize - kPointerSize)); 5826 FixedArray::kHeaderSize - kPointerSize));
5797 __ bind(&done); 5827 __ bind(&done);
5798 } 5828 }
5799 5829
5800 5830
5801 #undef __ 5831 #undef __
5802 5832
5803 } } // namespace v8::internal 5833 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips/ic-mips.cc ('k') | src/mips/lithium-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698