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

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 288213002: Refactor MacroAssembler::Prologue. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comment Created 6 years, 7 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/x64/macro-assembler-x64.h ('k') | no next file » | 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 // 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 "v8.h" 5 #include "v8.h"
6 6
7 #if V8_TARGET_ARCH_X64 7 #if V8_TARGET_ARCH_X64
8 8
9 #include "bootstrapper.h" 9 #include "bootstrapper.h"
10 #include "codegen.h" 10 #include "codegen.h"
(...skipping 3871 matching lines...) Expand 10 before | Expand all | Expand 10 after
3882 jmp(done, near_jump); 3882 jmp(done, near_jump);
3883 } 3883 }
3884 } else { 3884 } else {
3885 Jump(adaptor, RelocInfo::CODE_TARGET); 3885 Jump(adaptor, RelocInfo::CODE_TARGET);
3886 } 3886 }
3887 bind(&invoke); 3887 bind(&invoke);
3888 } 3888 }
3889 } 3889 }
3890 3890
3891 3891
3892 void MacroAssembler::Prologue(CompilationInfo* info) { 3892 void MacroAssembler::StubPrologue() {
3893 if (info->IsStub()) {
3894 pushq(rbp); // Caller's frame pointer. 3893 pushq(rbp); // Caller's frame pointer.
3895 movp(rbp, rsp); 3894 movp(rbp, rsp);
3896 Push(rsi); // Callee's context. 3895 Push(rsi); // Callee's context.
3897 Push(Smi::FromInt(StackFrame::STUB)); 3896 Push(Smi::FromInt(StackFrame::STUB));
3897 }
3898
3899
3900 void MacroAssembler::Prologue(bool code_pre_aging) {
3901 PredictableCodeSizeScope predictible_code_size_scope(this,
3902 kNoCodeAgeSequenceLength);
3903 if (code_pre_aging) {
3904 // Pre-age the code.
3905 Call(isolate()->builtins()->MarkCodeAsExecutedOnce(),
3906 RelocInfo::CODE_AGE_SEQUENCE);
3907 Nop(kNoCodeAgeSequenceLength - Assembler::kShortCallInstructionLength);
3898 } else { 3908 } else {
3899 PredictableCodeSizeScope predictible_code_size_scope(this, 3909 pushq(rbp); // Caller's frame pointer.
3900 kNoCodeAgeSequenceLength); 3910 movp(rbp, rsp);
3901 if (info->IsCodePreAgingActive()) { 3911 Push(rsi); // Callee's context.
3902 // Pre-age the code. 3912 Push(rdi); // Callee's JS function.
3903 Call(isolate()->builtins()->MarkCodeAsExecutedOnce(),
3904 RelocInfo::CODE_AGE_SEQUENCE);
3905 Nop(kNoCodeAgeSequenceLength - Assembler::kShortCallInstructionLength);
3906 } else {
3907 pushq(rbp); // Caller's frame pointer.
3908 movp(rbp, rsp);
3909 Push(rsi); // Callee's context.
3910 Push(rdi); // Callee's JS function.
3911 }
3912 } 3913 }
3913 } 3914 }
3914 3915
3915 3916
3916 void MacroAssembler::EnterFrame(StackFrame::Type type) { 3917 void MacroAssembler::EnterFrame(StackFrame::Type type) {
3917 pushq(rbp); 3918 pushq(rbp);
3918 movp(rbp, rsp); 3919 movp(rbp, rsp);
3919 Push(rsi); // Context. 3920 Push(rsi); // Context.
3920 Push(Smi::FromInt(type)); 3921 Push(Smi::FromInt(type));
3921 Move(kScratchRegister, CodeObject(), RelocInfo::EMBEDDED_OBJECT); 3922 Move(kScratchRegister, CodeObject(), RelocInfo::EMBEDDED_OBJECT);
(...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after
5234 if (ms.shift() > 0) sarl(rdx, Immediate(ms.shift())); 5235 if (ms.shift() > 0) sarl(rdx, Immediate(ms.shift()));
5235 movl(rax, dividend); 5236 movl(rax, dividend);
5236 shrl(rax, Immediate(31)); 5237 shrl(rax, Immediate(31));
5237 addl(rdx, rax); 5238 addl(rdx, rax);
5238 } 5239 }
5239 5240
5240 5241
5241 } } // namespace v8::internal 5242 } } // namespace v8::internal
5242 5243
5243 #endif // V8_TARGET_ARCH_X64 5244 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698