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

Side by Side Diff: src/x64/code-stubs-x64.cc

Issue 2311203002: Move kMaxRegularHeapObjectSize into globals (Closed)
Patch Set: Saving the file helps... Created 4 years, 3 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/snapshot/serializer.cc ('k') | src/x64/macro-assembler-x64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 #if V8_TARGET_ARCH_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/api-arguments.h" 8 #include "src/api-arguments.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 4290 matching lines...) Expand 10 before | Expand all | Expand 10 after
4301 __ LoadRoot(rcx, Heap::kEmptyFixedArrayRootIndex); 4301 __ LoadRoot(rcx, Heap::kEmptyFixedArrayRootIndex);
4302 __ movp(FieldOperand(rax, JSArray::kPropertiesOffset), rcx); 4302 __ movp(FieldOperand(rax, JSArray::kPropertiesOffset), rcx);
4303 __ movp(FieldOperand(rax, JSArray::kElementsOffset), rdx); 4303 __ movp(FieldOperand(rax, JSArray::kElementsOffset), rdx);
4304 __ movp(FieldOperand(rax, JSArray::kLengthOffset), rdi); 4304 __ movp(FieldOperand(rax, JSArray::kLengthOffset), rdi);
4305 STATIC_ASSERT(JSArray::kSize == 4 * kPointerSize); 4305 STATIC_ASSERT(JSArray::kSize == 4 * kPointerSize);
4306 __ Ret(); 4306 __ Ret();
4307 4307
4308 // Fall back to %AllocateInNewSpace (if not too big). 4308 // Fall back to %AllocateInNewSpace (if not too big).
4309 Label too_big_for_new_space; 4309 Label too_big_for_new_space;
4310 __ bind(&allocate); 4310 __ bind(&allocate);
4311 __ cmpl(rcx, Immediate(Page::kMaxRegularHeapObjectSize)); 4311 __ cmpl(rcx, Immediate(kMaxRegularHeapObjectSize));
4312 __ j(greater, &too_big_for_new_space); 4312 __ j(greater, &too_big_for_new_space);
4313 { 4313 {
4314 FrameScope scope(masm, StackFrame::INTERNAL); 4314 FrameScope scope(masm, StackFrame::INTERNAL);
4315 __ Integer32ToSmi(rax, rax); 4315 __ Integer32ToSmi(rax, rax);
4316 __ Integer32ToSmi(rcx, rcx); 4316 __ Integer32ToSmi(rcx, rcx);
4317 __ Push(rax); 4317 __ Push(rax);
4318 __ Push(rbx); 4318 __ Push(rbx);
4319 __ Push(rcx); 4319 __ Push(rcx);
4320 __ CallRuntime(Runtime::kAllocateInNewSpace); 4320 __ CallRuntime(Runtime::kAllocateInNewSpace);
4321 __ movp(rdx, rax); 4321 __ movp(rdx, rax);
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
4664 __ LoadRoot(rcx, Heap::kEmptyFixedArrayRootIndex); 4664 __ LoadRoot(rcx, Heap::kEmptyFixedArrayRootIndex);
4665 __ movp(FieldOperand(rax, JSStrictArgumentsObject::kPropertiesOffset), rcx); 4665 __ movp(FieldOperand(rax, JSStrictArgumentsObject::kPropertiesOffset), rcx);
4666 __ movp(FieldOperand(rax, JSStrictArgumentsObject::kElementsOffset), rdx); 4666 __ movp(FieldOperand(rax, JSStrictArgumentsObject::kElementsOffset), rdx);
4667 __ movp(FieldOperand(rax, JSStrictArgumentsObject::kLengthOffset), rdi); 4667 __ movp(FieldOperand(rax, JSStrictArgumentsObject::kLengthOffset), rdi);
4668 STATIC_ASSERT(JSStrictArgumentsObject::kSize == 4 * kPointerSize); 4668 STATIC_ASSERT(JSStrictArgumentsObject::kSize == 4 * kPointerSize);
4669 __ Ret(); 4669 __ Ret();
4670 4670
4671 // Fall back to %AllocateInNewSpace (if not too big). 4671 // Fall back to %AllocateInNewSpace (if not too big).
4672 Label too_big_for_new_space; 4672 Label too_big_for_new_space;
4673 __ bind(&allocate); 4673 __ bind(&allocate);
4674 __ cmpl(rcx, Immediate(Page::kMaxRegularHeapObjectSize)); 4674 __ cmpl(rcx, Immediate(kMaxRegularHeapObjectSize));
4675 __ j(greater, &too_big_for_new_space); 4675 __ j(greater, &too_big_for_new_space);
4676 { 4676 {
4677 FrameScope scope(masm, StackFrame::INTERNAL); 4677 FrameScope scope(masm, StackFrame::INTERNAL);
4678 __ Integer32ToSmi(rax, rax); 4678 __ Integer32ToSmi(rax, rax);
4679 __ Integer32ToSmi(rcx, rcx); 4679 __ Integer32ToSmi(rcx, rcx);
4680 __ Push(rax); 4680 __ Push(rax);
4681 __ Push(rbx); 4681 __ Push(rbx);
4682 __ Push(rcx); 4682 __ Push(rcx);
4683 __ CallRuntime(Runtime::kAllocateInNewSpace); 4683 __ CallRuntime(Runtime::kAllocateInNewSpace);
4684 __ movp(rdx, rax); 4684 __ movp(rdx, rax);
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
5204 kStackUnwindSpace, nullptr, return_value_operand, 5204 kStackUnwindSpace, nullptr, return_value_operand,
5205 NULL); 5205 NULL);
5206 } 5206 }
5207 5207
5208 #undef __ 5208 #undef __
5209 5209
5210 } // namespace internal 5210 } // namespace internal
5211 } // namespace v8 5211 } // namespace v8
5212 5212
5213 #endif // V8_TARGET_ARCH_X64 5213 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/snapshot/serializer.cc ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698