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

Side by Side Diff: src/crankshaft/ppc/lithium-codegen-ppc.cc

Issue 2709483007: PPC/s390: [everywhere] Custom representation for frame type (Closed)
Patch Set: Created 3 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
« no previous file with comments | « src/compiler/s390/code-generator-s390.cc ('k') | src/crankshaft/s390/lithium-codegen-s390.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/crankshaft/ppc/lithium-codegen-ppc.h" 5 #include "src/crankshaft/ppc/lithium-codegen-ppc.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/builtins/builtins-constructor.h" 8 #include "src/builtins/builtins-constructor.h"
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 ";;; <@%d,#%d> " 280 ";;; <@%d,#%d> "
281 "-------------------- Deferred %s --------------------", 281 "-------------------- Deferred %s --------------------",
282 code->instruction_index(), code->instr()->hydrogen_value()->id(), 282 code->instruction_index(), code->instr()->hydrogen_value()->id(),
283 code->instr()->Mnemonic()); 283 code->instr()->Mnemonic());
284 __ bind(code->entry()); 284 __ bind(code->entry());
285 if (NeedsDeferredFrame()) { 285 if (NeedsDeferredFrame()) {
286 Comment(";;; Build frame"); 286 Comment(";;; Build frame");
287 DCHECK(!frame_is_built_); 287 DCHECK(!frame_is_built_);
288 DCHECK(info()->IsStub()); 288 DCHECK(info()->IsStub());
289 frame_is_built_ = true; 289 frame_is_built_ = true;
290 __ LoadSmiLiteral(scratch0(), Smi::FromInt(StackFrame::STUB)); 290 __ mov(scratch0(), Operand(StackFrame::TypeToMarker(StackFrame::STUB)));
291 __ PushCommonFrame(scratch0()); 291 __ PushCommonFrame(scratch0());
292 Comment(";;; Deferred code"); 292 Comment(";;; Deferred code");
293 } 293 }
294 code->Generate(); 294 code->Generate();
295 if (NeedsDeferredFrame()) { 295 if (NeedsDeferredFrame()) {
296 Comment(";;; Destroy frame"); 296 Comment(";;; Destroy frame");
297 DCHECK(frame_is_built_); 297 DCHECK(frame_is_built_);
298 __ PopCommonFrame(scratch0()); 298 __ PopCommonFrame(scratch0());
299 frame_is_built_ = false; 299 frame_is_built_ = false;
300 } 300 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 } else { 349 } else {
350 __ b(&call_deopt_entry, SetLK); 350 __ b(&call_deopt_entry, SetLK);
351 } 351 }
352 } 352 }
353 353
354 if (needs_frame.is_linked()) { 354 if (needs_frame.is_linked()) {
355 __ bind(&needs_frame); 355 __ bind(&needs_frame);
356 // This variant of deopt can only be used with stubs. Since we don't 356 // This variant of deopt can only be used with stubs. Since we don't
357 // have a function pointer to install in the stack frame that we're 357 // have a function pointer to install in the stack frame that we're
358 // building, install a special marker there instead. 358 // building, install a special marker there instead.
359 __ LoadSmiLiteral(ip, Smi::FromInt(StackFrame::STUB)); 359 __ mov(ip, Operand(StackFrame::TypeToMarker(StackFrame::STUB)));
360 __ push(ip); 360 __ push(ip);
361 DCHECK(info()->IsStub()); 361 DCHECK(info()->IsStub());
362 } 362 }
363 363
364 Comment(";;; call deopt"); 364 Comment(";;; call deopt");
365 __ bind(&call_deopt_entry); 365 __ bind(&call_deopt_entry);
366 366
367 if (info()->saves_caller_doubles()) { 367 if (info()->saves_caller_doubles()) {
368 DCHECK(info()->IsStub()); 368 DCHECK(info()->IsStub());
369 RestoreCallerDoubles(); 369 RestoreCallerDoubles();
(...skipping 2752 matching lines...) Expand 10 before | Expand all | Expand 10 after
3122 Register result = ToRegister(instr->result()); 3122 Register result = ToRegister(instr->result());
3123 3123
3124 if (instr->hydrogen()->from_inlined()) { 3124 if (instr->hydrogen()->from_inlined()) {
3125 __ subi(result, sp, Operand(2 * kPointerSize)); 3125 __ subi(result, sp, Operand(2 * kPointerSize));
3126 } else if (instr->hydrogen()->arguments_adaptor()) { 3126 } else if (instr->hydrogen()->arguments_adaptor()) {
3127 // Check if the calling frame is an arguments adaptor frame. 3127 // Check if the calling frame is an arguments adaptor frame.
3128 __ LoadP(scratch, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); 3128 __ LoadP(scratch, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
3129 __ LoadP( 3129 __ LoadP(
3130 result, 3130 result,
3131 MemOperand(scratch, CommonFrameConstants::kContextOrFrameTypeOffset)); 3131 MemOperand(scratch, CommonFrameConstants::kContextOrFrameTypeOffset));
3132 __ CmpSmiLiteral(result, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR), r0); 3132 __ cmpi(result,
3133 Operand(StackFrame::TypeToMarker(StackFrame::ARGUMENTS_ADAPTOR)));
3133 3134
3134 // Result is the frame pointer for the frame if not adapted and for the real 3135 // Result is the frame pointer for the frame if not adapted and for the real
3135 // frame below the adaptor frame if adapted. 3136 // frame below the adaptor frame if adapted.
3136 if (CpuFeatures::IsSupported(ISELECT)) { 3137 if (CpuFeatures::IsSupported(ISELECT)) {
3137 __ isel(eq, result, scratch, fp); 3138 __ isel(eq, result, scratch, fp);
3138 } else { 3139 } else {
3139 Label done, adapted; 3140 Label done, adapted;
3140 __ beq(&adapted); 3141 __ beq(&adapted);
3141 __ mr(result, fp); 3142 __ mr(result, fp);
3142 __ b(&done); 3143 __ b(&done);
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
3760 Comment(";;; PrepareForTailCall, actual: %d {", actual.immediate()); 3761 Comment(";;; PrepareForTailCall, actual: %d {", actual.immediate());
3761 } 3762 }
3762 } 3763 }
3763 3764
3764 // Check if next frame is an arguments adaptor frame. 3765 // Check if next frame is an arguments adaptor frame.
3765 Register caller_args_count_reg = scratch1; 3766 Register caller_args_count_reg = scratch1;
3766 Label no_arguments_adaptor, formal_parameter_count_loaded; 3767 Label no_arguments_adaptor, formal_parameter_count_loaded;
3767 __ LoadP(scratch2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); 3768 __ LoadP(scratch2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
3768 __ LoadP(scratch3, 3769 __ LoadP(scratch3,
3769 MemOperand(scratch2, StandardFrameConstants::kContextOffset)); 3770 MemOperand(scratch2, StandardFrameConstants::kContextOffset));
3770 __ CmpSmiLiteral(scratch3, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR), r0); 3771 __ cmpi(scratch3,
3772 Operand(StackFrame::TypeToMarker(StackFrame::ARGUMENTS_ADAPTOR)));
3771 __ bne(&no_arguments_adaptor); 3773 __ bne(&no_arguments_adaptor);
3772 3774
3773 // Drop current frame and load arguments count from arguments adaptor frame. 3775 // Drop current frame and load arguments count from arguments adaptor frame.
3774 __ mr(fp, scratch2); 3776 __ mr(fp, scratch2);
3775 __ LoadP(caller_args_count_reg, 3777 __ LoadP(caller_args_count_reg,
3776 MemOperand(fp, ArgumentsAdaptorFrameConstants::kLengthOffset)); 3778 MemOperand(fp, ArgumentsAdaptorFrameConstants::kLengthOffset));
3777 __ SmiUntag(caller_args_count_reg); 3779 __ SmiUntag(caller_args_count_reg);
3778 __ b(&formal_parameter_count_loaded); 3780 __ b(&formal_parameter_count_loaded);
3779 3781
3780 __ bind(&no_arguments_adaptor); 3782 __ bind(&no_arguments_adaptor);
(...skipping 1898 matching lines...) Expand 10 before | Expand all | Expand 10 after
5679 __ LoadP(result, 5681 __ LoadP(result,
5680 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); 5682 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize));
5681 __ bind(deferred->exit()); 5683 __ bind(deferred->exit());
5682 __ bind(&done); 5684 __ bind(&done);
5683 } 5685 }
5684 5686
5685 #undef __ 5687 #undef __
5686 5688
5687 } // namespace internal 5689 } // namespace internal
5688 } // namespace v8 5690 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/s390/code-generator-s390.cc ('k') | src/crankshaft/s390/lithium-codegen-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698