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

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

Issue 12613004: To fully support hydrogen code stubs which accept a variable number of arguments, (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | Annotate | Revision Log
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 2718 matching lines...) Expand 10 before | Expand all | Expand 10 after
2729 JavaScriptFrameConstants::kDynamicAlignmentStateOffset)); 2729 JavaScriptFrameConstants::kDynamicAlignmentStateOffset));
2730 } 2730 }
2731 if (NeedsEagerFrame()) { 2731 if (NeedsEagerFrame()) {
2732 __ mov(esp, ebp); 2732 __ mov(esp, ebp);
2733 __ pop(ebp); 2733 __ pop(ebp);
2734 } 2734 }
2735 if (dynamic_frame_alignment_) { 2735 if (dynamic_frame_alignment_) {
2736 Label no_padding; 2736 Label no_padding;
2737 __ cmp(edx, Immediate(kNoAlignmentPadding)); 2737 __ cmp(edx, Immediate(kNoAlignmentPadding));
2738 __ j(equal, &no_padding); 2738 __ j(equal, &no_padding);
2739 if (FLAG_debug_code) { 2739
2740 __ cmp(Operand(esp, (GetParameterCount() + 2) * kPointerSize), 2740 if (instr->has_constant_parameter_count()) {
2741 Immediate(kAlignmentZapValue)); 2741 if (FLAG_debug_code) {
danno 2013/03/07 15:11:14 Can't you combine this code path with the one belo
mvstanton 2013/03/07 16:48:49 Done.
2742 __ Assert(equal, "expected alignment marker"); 2742 __ cmp(Operand(esp,
2743 (instr->constant_parameter_count() + 2) * kPointerSize),
2744 Immediate(kAlignmentZapValue));
2745 __ Assert(equal, "expected alignment marker");
2746 }
2747 __ Ret((instr->constant_parameter_count() + 2) * kPointerSize, ecx);
2748 } else {
2749 Register reg = ToRegister(instr->parameter_count());
2750 Register temp_reg = reg.is(ecx) ? ebx : ecx;
2751 if (FLAG_debug_code) {
2752 __ cmp(Operand(esp, reg, times_pointer_size, 2 * kPointerSize),
2753 Immediate(kAlignmentZapValue));
2754 __ Assert(equal, "expected alignment marker");
2755 }
2756
2757 // emit code to restore stack based on instr->parameter_count()
2758 __ pop(temp_reg); // save return address
2759 __ inc(reg); // 1 more for alignment
2760 __ shl(reg, kPointerSizeLog2);
2761 __ add(esp, reg);
2762 __ jmp(temp_reg);
2743 } 2763 }
2744 __ Ret((GetParameterCount() + 2) * kPointerSize, ecx);
2745 __ bind(&no_padding); 2764 __ bind(&no_padding);
2746 } 2765 }
2747 if (info()->IsStub()) { 2766
2748 __ Ret(); 2767 if (instr->has_constant_parameter_count()) {
danno 2013/03/07 15:11:14 if (instr->parameter_count()->IsConstantOperand())
mvstanton 2013/03/07 16:48:49 Done.
2768 __ Ret((instr->constant_parameter_count() + 1) * kPointerSize, ecx);
danno 2013/03/07 15:11:14 int32_t parameter_count = ToInteger32(LConstantOpe
mvstanton 2013/03/07 16:48:49 Done.
2749 } else { 2769 } else {
2750 __ Ret((GetParameterCount() + 1) * kPointerSize, ecx); 2770 Register reg = ToRegister(instr->parameter_count());
2771 Register return_addr_reg = reg.is(ecx) ? ebx : ecx;
2772 __ pop(return_addr_reg); // save return address
2773 __ shl(reg, kPointerSizeLog2);
2774 __ add(esp, reg);
2775 __ jmp(return_addr_reg);
2751 } 2776 }
2752 } 2777 }
2753 2778
2754 2779
2755 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { 2780 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) {
2756 Register result = ToRegister(instr->result()); 2781 Register result = ToRegister(instr->result());
2757 __ mov(result, Operand::Cell(instr->hydrogen()->cell())); 2782 __ mov(result, Operand::Cell(instr->hydrogen()->cell()));
2758 if (instr->hydrogen()->RequiresHoleCheck()) { 2783 if (instr->hydrogen()->RequiresHoleCheck()) {
2759 __ cmp(result, factory()->the_hole_value()); 2784 __ cmp(result, factory()->the_hole_value());
2760 DeoptimizeIf(equal, instr->environment()); 2785 DeoptimizeIf(equal, instr->environment());
(...skipping 3498 matching lines...) Expand 10 before | Expand all | Expand 10 after
6259 FixedArray::kHeaderSize - kPointerSize)); 6284 FixedArray::kHeaderSize - kPointerSize));
6260 __ bind(&done); 6285 __ bind(&done);
6261 } 6286 }
6262 6287
6263 6288
6264 #undef __ 6289 #undef __
6265 6290
6266 } } // namespace v8::internal 6291 } } // namespace v8::internal
6267 6292
6268 #endif // V8_TARGET_ARCH_IA32 6293 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698