OLD | NEW |
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 2634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2645 __ lea(r8, Operand(rbx, times_pointer_size, kParameterMapHeaderSize)); | 2645 __ lea(r8, Operand(rbx, times_pointer_size, kParameterMapHeaderSize)); |
2646 __ bind(&no_parameter_map); | 2646 __ bind(&no_parameter_map); |
2647 | 2647 |
2648 // 2. Backing store. | 2648 // 2. Backing store. |
2649 __ lea(r8, Operand(r8, rcx, times_pointer_size, FixedArray::kHeaderSize)); | 2649 __ lea(r8, Operand(r8, rcx, times_pointer_size, FixedArray::kHeaderSize)); |
2650 | 2650 |
2651 // 3. Arguments object. | 2651 // 3. Arguments object. |
2652 __ addq(r8, Immediate(Heap::kArgumentsObjectSize)); | 2652 __ addq(r8, Immediate(Heap::kArgumentsObjectSize)); |
2653 | 2653 |
2654 // Do the allocation of all three objects in one go. | 2654 // Do the allocation of all three objects in one go. |
2655 __ AllocateInNewSpace(r8, rax, rdx, rdi, &runtime, TAG_OBJECT); | 2655 __ Allocate(r8, rax, rdx, rdi, &runtime, TAG_OBJECT); |
2656 | 2656 |
2657 // rax = address of new object(s) (tagged) | 2657 // rax = address of new object(s) (tagged) |
2658 // rcx = argument count (untagged) | 2658 // rcx = argument count (untagged) |
2659 // Get the arguments boilerplate from the current native context into rdi. | 2659 // Get the arguments boilerplate from the current native context into rdi. |
2660 Label has_mapped_parameters, copy; | 2660 Label has_mapped_parameters, copy; |
2661 __ movq(rdi, Operand(rsi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | 2661 __ movq(rdi, Operand(rsi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
2662 __ movq(rdi, FieldOperand(rdi, GlobalObject::kNativeContextOffset)); | 2662 __ movq(rdi, FieldOperand(rdi, GlobalObject::kNativeContextOffset)); |
2663 __ testq(rbx, rbx); | 2663 __ testq(rbx, rbx); |
2664 __ j(not_zero, &has_mapped_parameters, Label::kNear); | 2664 __ j(not_zero, &has_mapped_parameters, Label::kNear); |
2665 | 2665 |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2863 // the arguments object and the elements array. | 2863 // the arguments object and the elements array. |
2864 Label add_arguments_object; | 2864 Label add_arguments_object; |
2865 __ bind(&try_allocate); | 2865 __ bind(&try_allocate); |
2866 __ testq(rcx, rcx); | 2866 __ testq(rcx, rcx); |
2867 __ j(zero, &add_arguments_object, Label::kNear); | 2867 __ j(zero, &add_arguments_object, Label::kNear); |
2868 __ lea(rcx, Operand(rcx, times_pointer_size, FixedArray::kHeaderSize)); | 2868 __ lea(rcx, Operand(rcx, times_pointer_size, FixedArray::kHeaderSize)); |
2869 __ bind(&add_arguments_object); | 2869 __ bind(&add_arguments_object); |
2870 __ addq(rcx, Immediate(Heap::kArgumentsObjectSizeStrict)); | 2870 __ addq(rcx, Immediate(Heap::kArgumentsObjectSizeStrict)); |
2871 | 2871 |
2872 // Do the allocation of both objects in one go. | 2872 // Do the allocation of both objects in one go. |
2873 __ AllocateInNewSpace(rcx, rax, rdx, rbx, &runtime, TAG_OBJECT); | 2873 __ Allocate(rcx, rax, rdx, rbx, &runtime, TAG_OBJECT); |
2874 | 2874 |
2875 // Get the arguments boilerplate from the current native context. | 2875 // Get the arguments boilerplate from the current native context. |
2876 __ movq(rdi, Operand(rsi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | 2876 __ movq(rdi, Operand(rsi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
2877 __ movq(rdi, FieldOperand(rdi, GlobalObject::kNativeContextOffset)); | 2877 __ movq(rdi, FieldOperand(rdi, GlobalObject::kNativeContextOffset)); |
2878 const int offset = | 2878 const int offset = |
2879 Context::SlotOffset(Context::STRICT_MODE_ARGUMENTS_BOILERPLATE_INDEX); | 2879 Context::SlotOffset(Context::STRICT_MODE_ARGUMENTS_BOILERPLATE_INDEX); |
2880 __ movq(rdi, Operand(rdi, offset)); | 2880 __ movq(rdi, Operand(rdi, offset)); |
2881 | 2881 |
2882 // Copy the JS object part. | 2882 // Copy the JS object part. |
2883 for (int i = 0; i < JSObject::kHeaderSize; i += kPointerSize) { | 2883 for (int i = 0; i < JSObject::kHeaderSize; i += kPointerSize) { |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3396 __ JumpIfNotSmi(r8, &slowcase); | 3396 __ JumpIfNotSmi(r8, &slowcase); |
3397 __ SmiToInteger32(rbx, r8); | 3397 __ SmiToInteger32(rbx, r8); |
3398 __ cmpl(rbx, Immediate(kMaxInlineLength)); | 3398 __ cmpl(rbx, Immediate(kMaxInlineLength)); |
3399 __ j(above, &slowcase); | 3399 __ j(above, &slowcase); |
3400 // Smi-tagging is equivalent to multiplying by 2. | 3400 // Smi-tagging is equivalent to multiplying by 2. |
3401 STATIC_ASSERT(kSmiTag == 0); | 3401 STATIC_ASSERT(kSmiTag == 0); |
3402 STATIC_ASSERT(kSmiTagSize == 1); | 3402 STATIC_ASSERT(kSmiTagSize == 1); |
3403 // Allocate RegExpResult followed by FixedArray with size in rbx. | 3403 // Allocate RegExpResult followed by FixedArray with size in rbx. |
3404 // JSArray: [Map][empty properties][Elements][Length-smi][index][input] | 3404 // JSArray: [Map][empty properties][Elements][Length-smi][index][input] |
3405 // Elements: [Map][Length][..elements..] | 3405 // Elements: [Map][Length][..elements..] |
3406 __ AllocateInNewSpace(JSRegExpResult::kSize + FixedArray::kHeaderSize, | 3406 __ Allocate(JSRegExpResult::kSize + FixedArray::kHeaderSize, |
3407 times_pointer_size, | 3407 times_pointer_size, |
3408 rbx, // In: Number of elements. | 3408 rbx, // In: Number of elements. |
3409 rax, // Out: Start of allocation (tagged). | 3409 rax, // Out: Start of allocation (tagged). |
3410 rcx, // Out: End of allocation. | 3410 rcx, // Out: End of allocation. |
3411 rdx, // Scratch register | 3411 rdx, // Scratch register |
3412 &slowcase, | 3412 &slowcase, |
3413 TAG_OBJECT); | 3413 TAG_OBJECT); |
3414 // rax: Start of allocated area, object-tagged. | 3414 // rax: Start of allocated area, object-tagged. |
3415 // rbx: Number of array elements as int32. | 3415 // rbx: Number of array elements as int32. |
3416 // r8: Number of array elements as smi. | 3416 // r8: Number of array elements as smi. |
3417 | 3417 |
3418 // Set JSArray map to global.regexp_result_map(). | 3418 // Set JSArray map to global.regexp_result_map(). |
3419 __ movq(rdx, ContextOperand(rsi, Context::GLOBAL_OBJECT_INDEX)); | 3419 __ movq(rdx, ContextOperand(rsi, Context::GLOBAL_OBJECT_INDEX)); |
3420 __ movq(rdx, FieldOperand(rdx, GlobalObject::kNativeContextOffset)); | 3420 __ movq(rdx, FieldOperand(rdx, GlobalObject::kNativeContextOffset)); |
3421 __ movq(rdx, ContextOperand(rdx, Context::REGEXP_RESULT_MAP_INDEX)); | 3421 __ movq(rdx, ContextOperand(rdx, Context::REGEXP_RESULT_MAP_INDEX)); |
3422 __ movq(FieldOperand(rax, HeapObject::kMapOffset), rdx); | 3422 __ movq(FieldOperand(rax, HeapObject::kMapOffset), rdx); |
3423 | 3423 |
(...skipping 3447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6871 #endif | 6871 #endif |
6872 | 6872 |
6873 __ Ret(); | 6873 __ Ret(); |
6874 } | 6874 } |
6875 | 6875 |
6876 #undef __ | 6876 #undef __ |
6877 | 6877 |
6878 } } // namespace v8::internal | 6878 } } // namespace v8::internal |
6879 | 6879 |
6880 #endif // V8_TARGET_ARCH_X64 | 6880 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |