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

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

Issue 12440041: Generalizing remaining Allocate functions in the macro assemblers used in pretenuring. (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
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/ia32/codegen-ia32.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 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 3559 matching lines...) Expand 10 before | Expand all | Expand 10 after
3570 __ lea(ebx, Operand(ebx, times_2, kParameterMapHeaderSize)); 3570 __ lea(ebx, Operand(ebx, times_2, kParameterMapHeaderSize));
3571 __ bind(&no_parameter_map); 3571 __ bind(&no_parameter_map);
3572 3572
3573 // 2. Backing store. 3573 // 2. Backing store.
3574 __ lea(ebx, Operand(ebx, ecx, times_2, FixedArray::kHeaderSize)); 3574 __ lea(ebx, Operand(ebx, ecx, times_2, FixedArray::kHeaderSize));
3575 3575
3576 // 3. Arguments object. 3576 // 3. Arguments object.
3577 __ add(ebx, Immediate(Heap::kArgumentsObjectSize)); 3577 __ add(ebx, Immediate(Heap::kArgumentsObjectSize));
3578 3578
3579 // Do the allocation of all three objects in one go. 3579 // Do the allocation of all three objects in one go.
3580 __ AllocateInNewSpace(ebx, eax, edx, edi, &runtime, TAG_OBJECT); 3580 __ Allocate(ebx, eax, edx, edi, &runtime, TAG_OBJECT);
3581 3581
3582 // eax = address of new object(s) (tagged) 3582 // eax = address of new object(s) (tagged)
3583 // ecx = argument count (tagged) 3583 // ecx = argument count (tagged)
3584 // esp[0] = mapped parameter count (tagged) 3584 // esp[0] = mapped parameter count (tagged)
3585 // esp[8] = parameter count (tagged) 3585 // esp[8] = parameter count (tagged)
3586 // esp[12] = address of receiver argument 3586 // esp[12] = address of receiver argument
3587 // Get the arguments boilerplate from the current native context into edi. 3587 // Get the arguments boilerplate from the current native context into edi.
3588 Label has_mapped_parameters, copy; 3588 Label has_mapped_parameters, copy;
3589 __ mov(edi, Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); 3589 __ mov(edi, Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
3590 __ mov(edi, FieldOperand(edi, GlobalObject::kNativeContextOffset)); 3590 __ mov(edi, FieldOperand(edi, GlobalObject::kNativeContextOffset));
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
3768 // the arguments object and the elements array. 3768 // the arguments object and the elements array.
3769 Label add_arguments_object; 3769 Label add_arguments_object;
3770 __ bind(&try_allocate); 3770 __ bind(&try_allocate);
3771 __ test(ecx, ecx); 3771 __ test(ecx, ecx);
3772 __ j(zero, &add_arguments_object, Label::kNear); 3772 __ j(zero, &add_arguments_object, Label::kNear);
3773 __ lea(ecx, Operand(ecx, times_2, FixedArray::kHeaderSize)); 3773 __ lea(ecx, Operand(ecx, times_2, FixedArray::kHeaderSize));
3774 __ bind(&add_arguments_object); 3774 __ bind(&add_arguments_object);
3775 __ add(ecx, Immediate(Heap::kArgumentsObjectSizeStrict)); 3775 __ add(ecx, Immediate(Heap::kArgumentsObjectSizeStrict));
3776 3776
3777 // Do the allocation of both objects in one go. 3777 // Do the allocation of both objects in one go.
3778 __ AllocateInNewSpace(ecx, eax, edx, ebx, &runtime, TAG_OBJECT); 3778 __ Allocate(ecx, eax, edx, ebx, &runtime, TAG_OBJECT);
3779 3779
3780 // Get the arguments boilerplate from the current native context. 3780 // Get the arguments boilerplate from the current native context.
3781 __ mov(edi, Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); 3781 __ mov(edi, Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
3782 __ mov(edi, FieldOperand(edi, GlobalObject::kNativeContextOffset)); 3782 __ mov(edi, FieldOperand(edi, GlobalObject::kNativeContextOffset));
3783 const int offset = 3783 const int offset =
3784 Context::SlotOffset(Context::STRICT_MODE_ARGUMENTS_BOILERPLATE_INDEX); 3784 Context::SlotOffset(Context::STRICT_MODE_ARGUMENTS_BOILERPLATE_INDEX);
3785 __ mov(edi, Operand(edi, offset)); 3785 __ mov(edi, Operand(edi, offset));
3786 3786
3787 // Copy the JS object part. 3787 // Copy the JS object part.
3788 for (int i = 0; i < JSObject::kHeaderSize; i += kPointerSize) { 3788 for (int i = 0; i < JSObject::kHeaderSize; i += kPointerSize) {
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
4292 __ mov(ebx, Operand(esp, kPointerSize * 3)); 4292 __ mov(ebx, Operand(esp, kPointerSize * 3));
4293 __ JumpIfNotSmi(ebx, &slowcase); 4293 __ JumpIfNotSmi(ebx, &slowcase);
4294 __ cmp(ebx, Immediate(Smi::FromInt(kMaxInlineLength))); 4294 __ cmp(ebx, Immediate(Smi::FromInt(kMaxInlineLength)));
4295 __ j(above, &slowcase); 4295 __ j(above, &slowcase);
4296 // Smi-tagging is equivalent to multiplying by 2. 4296 // Smi-tagging is equivalent to multiplying by 2.
4297 STATIC_ASSERT(kSmiTag == 0); 4297 STATIC_ASSERT(kSmiTag == 0);
4298 STATIC_ASSERT(kSmiTagSize == 1); 4298 STATIC_ASSERT(kSmiTagSize == 1);
4299 // Allocate RegExpResult followed by FixedArray with size in ebx. 4299 // Allocate RegExpResult followed by FixedArray with size in ebx.
4300 // JSArray: [Map][empty properties][Elements][Length-smi][index][input] 4300 // JSArray: [Map][empty properties][Elements][Length-smi][index][input]
4301 // Elements: [Map][Length][..elements..] 4301 // Elements: [Map][Length][..elements..]
4302 __ AllocateInNewSpace(JSRegExpResult::kSize + FixedArray::kHeaderSize, 4302 __ Allocate(JSRegExpResult::kSize + FixedArray::kHeaderSize,
4303 times_pointer_size, 4303 times_pointer_size,
4304 ebx, // In: Number of elements as a smi 4304 ebx, // In: Number of elements as a smi
4305 REGISTER_VALUE_IS_SMI, 4305 REGISTER_VALUE_IS_SMI,
4306 eax, // Out: Start of allocation (tagged). 4306 eax, // Out: Start of allocation (tagged).
4307 ecx, // Out: End of allocation. 4307 ecx, // Out: End of allocation.
4308 edx, // Scratch register 4308 edx, // Scratch register
4309 &slowcase, 4309 &slowcase,
4310 TAG_OBJECT); 4310 TAG_OBJECT);
4311 // eax: Start of allocated area, object-tagged. 4311 // eax: Start of allocated area, object-tagged.
4312 4312
4313 // Set JSArray map to global.regexp_result_map(). 4313 // Set JSArray map to global.regexp_result_map().
4314 // Set empty properties FixedArray. 4314 // Set empty properties FixedArray.
4315 // Set elements to point to FixedArray allocated right after the JSArray. 4315 // Set elements to point to FixedArray allocated right after the JSArray.
4316 // Interleave operations for better latency. 4316 // Interleave operations for better latency.
4317 __ mov(edx, ContextOperand(esi, Context::GLOBAL_OBJECT_INDEX)); 4317 __ mov(edx, ContextOperand(esi, Context::GLOBAL_OBJECT_INDEX));
4318 Factory* factory = masm->isolate()->factory(); 4318 Factory* factory = masm->isolate()->factory();
4319 __ mov(ecx, Immediate(factory->empty_fixed_array())); 4319 __ mov(ecx, Immediate(factory->empty_fixed_array()));
4320 __ lea(ebx, Operand(eax, JSRegExpResult::kSize)); 4320 __ lea(ebx, Operand(eax, JSRegExpResult::kSize));
(...skipping 3558 matching lines...) Expand 10 before | Expand all | Expand 10 after
7879 // Restore ecx. 7879 // Restore ecx.
7880 __ pop(ecx); 7880 __ pop(ecx);
7881 __ ret(0); 7881 __ ret(0);
7882 } 7882 }
7883 7883
7884 #undef __ 7884 #undef __
7885 7885
7886 } } // namespace v8::internal 7886 } } // namespace v8::internal
7887 7887
7888 #endif // V8_TARGET_ARCH_IA32 7888 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/ia32/codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698