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

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

Issue 11316218: Simplify and fix code aging. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed comment and rebased. Created 8 years 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/full-codegen-x64.cc ('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 // 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 info_->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) { 126 info_->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
127 __ int3(); 127 __ int3();
128 } 128 }
129 #endif 129 #endif
130 130
131 // Strict mode functions need to replace the receiver with undefined 131 // Strict mode functions need to replace the receiver with undefined
132 // when called as functions (without an explicit receiver 132 // when called as functions (without an explicit receiver
133 // object). rcx is zero for method calls and non-zero for function 133 // object). rcx is zero for method calls and non-zero for function
134 // calls. 134 // calls.
135 if (!info_->is_classic_mode() || info_->is_native()) { 135 if (!info_->is_classic_mode() || info_->is_native()) {
136 Label begin;
137 __ bind(&begin);
138 Label ok; 136 Label ok;
139 __ testq(rcx, rcx); 137 __ testq(rcx, rcx);
140 __ j(zero, &ok, Label::kNear); 138 __ j(zero, &ok, Label::kNear);
141 // +1 for return address. 139 // +1 for return address.
142 int receiver_offset = (scope()->num_parameters() + 1) * kPointerSize; 140 int receiver_offset = (scope()->num_parameters() + 1) * kPointerSize;
143 __ LoadRoot(kScratchRegister, Heap::kUndefinedValueRootIndex); 141 __ LoadRoot(kScratchRegister, Heap::kUndefinedValueRootIndex);
144 __ movq(Operand(rsp, receiver_offset), kScratchRegister); 142 __ movq(Operand(rsp, receiver_offset), kScratchRegister);
145 __ bind(&ok); 143 __ bind(&ok);
146 ASSERT(!FLAG_age_code ||
147 (kSizeOfOptimizedStrictModePrologue == ok.pos() - begin.pos()));
148 } 144 }
149 145
146 info()->set_prologue_offset(masm_->pc_offset());
150 __ push(rbp); // Caller's frame pointer. 147 __ push(rbp); // Caller's frame pointer.
151 __ movq(rbp, rsp); 148 __ movq(rbp, rsp);
152 __ push(rsi); // Callee's context. 149 __ push(rsi); // Callee's context.
153 __ push(rdi); // Callee's JS function. 150 __ push(rdi); // Callee's JS function.
154 151
155 // Reserve space for the stack slots needed by the code. 152 // Reserve space for the stack slots needed by the code.
156 int slots = GetStackSlotCount(); 153 int slots = GetStackSlotCount();
157 if (slots > 0) { 154 if (slots > 0) {
158 if (FLAG_debug_code) { 155 if (FLAG_debug_code) {
159 __ Set(rax, slots); 156 __ Set(rax, slots);
(...skipping 5221 matching lines...) Expand 10 before | Expand all | Expand 10 after
5381 FixedArray::kHeaderSize - kPointerSize)); 5378 FixedArray::kHeaderSize - kPointerSize));
5382 __ bind(&done); 5379 __ bind(&done);
5383 } 5380 }
5384 5381
5385 5382
5386 #undef __ 5383 #undef __
5387 5384
5388 } } // namespace v8::internal 5385 } } // namespace v8::internal
5389 5386
5390 #endif // V8_TARGET_ARCH_X64 5387 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698