| 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 2566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2577 __ Allocate(r9, r0, r3, r4, &runtime, TAG_OBJECT); | 2577 __ Allocate(r9, r0, r3, r4, &runtime, TAG_OBJECT); |
| 2578 | 2578 |
| 2579 // r0 = address of new object(s) (tagged) | 2579 // r0 = address of new object(s) (tagged) |
| 2580 // r2 = argument count (tagged) | 2580 // r2 = argument count (tagged) |
| 2581 // Get the arguments boilerplate from the current native context into r4. | 2581 // Get the arguments boilerplate from the current native context into r4. |
| 2582 const int kNormalOffset = | 2582 const int kNormalOffset = |
| 2583 Context::SlotOffset(Context::ARGUMENTS_BOILERPLATE_INDEX); | 2583 Context::SlotOffset(Context::ARGUMENTS_BOILERPLATE_INDEX); |
| 2584 const int kAliasedOffset = | 2584 const int kAliasedOffset = |
| 2585 Context::SlotOffset(Context::ALIASED_ARGUMENTS_BOILERPLATE_INDEX); | 2585 Context::SlotOffset(Context::ALIASED_ARGUMENTS_BOILERPLATE_INDEX); |
| 2586 | 2586 |
| 2587 __ ldr(r4, MemOperand(r8, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | 2587 __ ldr(r4, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
| 2588 __ ldr(r4, FieldMemOperand(r4, GlobalObject::kNativeContextOffset)); | 2588 __ ldr(r4, FieldMemOperand(r4, GlobalObject::kNativeContextOffset)); |
| 2589 __ cmp(r1, Operand::Zero()); | 2589 __ cmp(r1, Operand::Zero()); |
| 2590 __ ldr(r4, MemOperand(r4, kNormalOffset), eq); | 2590 __ ldr(r4, MemOperand(r4, kNormalOffset), eq); |
| 2591 __ ldr(r4, MemOperand(r4, kAliasedOffset), ne); | 2591 __ ldr(r4, MemOperand(r4, kAliasedOffset), ne); |
| 2592 | 2592 |
| 2593 // r0 = address of new object (tagged) | 2593 // r0 = address of new object (tagged) |
| 2594 // r1 = mapped parameter count (tagged) | 2594 // r1 = mapped parameter count (tagged) |
| 2595 // r2 = argument count (tagged) | 2595 // r2 = argument count (tagged) |
| 2596 // r4 = address of boilerplate object (tagged) | 2596 // r4 = address of boilerplate object (tagged) |
| 2597 // Copy the JS object part. | 2597 // Copy the JS object part. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 2628 __ cmp(r1, Operand(Smi::FromInt(0))); | 2628 __ cmp(r1, Operand(Smi::FromInt(0))); |
| 2629 // Move backing store address to r3, because it is | 2629 // Move backing store address to r3, because it is |
| 2630 // expected there when filling in the unmapped arguments. | 2630 // expected there when filling in the unmapped arguments. |
| 2631 __ mov(r3, r4, LeaveCC, eq); | 2631 __ mov(r3, r4, LeaveCC, eq); |
| 2632 __ b(eq, &skip_parameter_map); | 2632 __ b(eq, &skip_parameter_map); |
| 2633 | 2633 |
| 2634 __ LoadRoot(r6, Heap::kNonStrictArgumentsElementsMapRootIndex); | 2634 __ LoadRoot(r6, Heap::kNonStrictArgumentsElementsMapRootIndex); |
| 2635 __ str(r6, FieldMemOperand(r4, FixedArray::kMapOffset)); | 2635 __ str(r6, FieldMemOperand(r4, FixedArray::kMapOffset)); |
| 2636 __ add(r6, r1, Operand(Smi::FromInt(2))); | 2636 __ add(r6, r1, Operand(Smi::FromInt(2))); |
| 2637 __ str(r6, FieldMemOperand(r4, FixedArray::kLengthOffset)); | 2637 __ str(r6, FieldMemOperand(r4, FixedArray::kLengthOffset)); |
| 2638 __ str(r8, FieldMemOperand(r4, FixedArray::kHeaderSize + 0 * kPointerSize)); | 2638 __ str(cp, FieldMemOperand(r4, FixedArray::kHeaderSize + 0 * kPointerSize)); |
| 2639 __ add(r6, r4, Operand(r1, LSL, 1)); | 2639 __ add(r6, r4, Operand(r1, LSL, 1)); |
| 2640 __ add(r6, r6, Operand(kParameterMapHeaderSize)); | 2640 __ add(r6, r6, Operand(kParameterMapHeaderSize)); |
| 2641 __ str(r6, FieldMemOperand(r4, FixedArray::kHeaderSize + 1 * kPointerSize)); | 2641 __ str(r6, FieldMemOperand(r4, FixedArray::kHeaderSize + 1 * kPointerSize)); |
| 2642 | 2642 |
| 2643 // Copy the parameter slots and the holes in the arguments. | 2643 // Copy the parameter slots and the holes in the arguments. |
| 2644 // We need to fill in mapped_parameter_count slots. They index the context, | 2644 // We need to fill in mapped_parameter_count slots. They index the context, |
| 2645 // where parameters are stored in reverse order, at | 2645 // where parameters are stored in reverse order, at |
| 2646 // MIN_CONTEXT_SLOTS .. MIN_CONTEXT_SLOTS+parameter_count-1 | 2646 // MIN_CONTEXT_SLOTS .. MIN_CONTEXT_SLOTS+parameter_count-1 |
| 2647 // The mapped parameter thus need to get indices | 2647 // The mapped parameter thus need to get indices |
| 2648 // MIN_CONTEXT_SLOTS+parameter_count-1 .. | 2648 // MIN_CONTEXT_SLOTS+parameter_count-1 .. |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3022 __ mov(r0, Operand::Zero()); | 3022 __ mov(r0, Operand::Zero()); |
| 3023 __ str(r0, MemOperand(sp, 2 * kPointerSize)); | 3023 __ str(r0, MemOperand(sp, 2 * kPointerSize)); |
| 3024 | 3024 |
| 3025 // Argument 5 (sp[4]): static offsets vector buffer. | 3025 // Argument 5 (sp[4]): static offsets vector buffer. |
| 3026 __ mov(r0, | 3026 __ mov(r0, |
| 3027 Operand(ExternalReference::address_of_static_offsets_vector(isolate))); | 3027 Operand(ExternalReference::address_of_static_offsets_vector(isolate))); |
| 3028 __ str(r0, MemOperand(sp, 1 * kPointerSize)); | 3028 __ str(r0, MemOperand(sp, 1 * kPointerSize)); |
| 3029 | 3029 |
| 3030 // For arguments 4 and 3 get string length, calculate start of string data and | 3030 // For arguments 4 and 3 get string length, calculate start of string data and |
| 3031 // calculate the shift of the index (0 for ASCII and 1 for two byte). | 3031 // calculate the shift of the index (0 for ASCII and 1 for two byte). |
| 3032 __ add(r8, subject, Operand(SeqString::kHeaderSize - kHeapObjectTag)); | 3032 __ add(r7, subject, Operand(SeqString::kHeaderSize - kHeapObjectTag)); |
| 3033 __ eor(r3, r3, Operand(1)); | 3033 __ eor(r3, r3, Operand(1)); |
| 3034 // Load the length from the original subject string from the previous stack | 3034 // Load the length from the original subject string from the previous stack |
| 3035 // frame. Therefore we have to use fp, which points exactly to two pointer | 3035 // frame. Therefore we have to use fp, which points exactly to two pointer |
| 3036 // sizes below the previous sp. (Because creating a new stack frame pushes | 3036 // sizes below the previous sp. (Because creating a new stack frame pushes |
| 3037 // the previous fp onto the stack and moves up sp by 2 * kPointerSize.) | 3037 // the previous fp onto the stack and moves up sp by 2 * kPointerSize.) |
| 3038 __ ldr(subject, MemOperand(fp, kSubjectOffset + 2 * kPointerSize)); | 3038 __ ldr(subject, MemOperand(fp, kSubjectOffset + 2 * kPointerSize)); |
| 3039 // If slice offset is not 0, load the length from the original sliced string. | 3039 // If slice offset is not 0, load the length from the original sliced string. |
| 3040 // Argument 4, r3: End of string data | 3040 // Argument 4, r3: End of string data |
| 3041 // Argument 3, r2: Start of string data | 3041 // Argument 3, r2: Start of string data |
| 3042 // Prepare start and end index of the input. | 3042 // Prepare start and end index of the input. |
| 3043 __ add(r9, r8, Operand(r9, LSL, r3)); | 3043 __ add(r9, r7, Operand(r9, LSL, r3)); |
| 3044 __ add(r2, r9, Operand(r1, LSL, r3)); | 3044 __ add(r2, r9, Operand(r1, LSL, r3)); |
| 3045 | 3045 |
| 3046 __ ldr(r8, FieldMemOperand(subject, String::kLengthOffset)); | 3046 __ ldr(r7, FieldMemOperand(subject, String::kLengthOffset)); |
| 3047 __ SmiUntag(r8); | 3047 __ SmiUntag(r7); |
| 3048 __ add(r3, r9, Operand(r8, LSL, r3)); | 3048 __ add(r3, r9, Operand(r7, LSL, r3)); |
| 3049 | 3049 |
| 3050 // Argument 2 (r1): Previous index. | 3050 // Argument 2 (r1): Previous index. |
| 3051 // Already there | 3051 // Already there |
| 3052 | 3052 |
| 3053 // Argument 1 (r0): Subject string. | 3053 // Argument 1 (r0): Subject string. |
| 3054 __ mov(r0, subject); | 3054 __ mov(r0, subject); |
| 3055 | 3055 |
| 3056 // Locate the code entry and call it. | 3056 // Locate the code entry and call it. |
| 3057 __ add(r6, r6, Operand(Code::kHeaderSize - kHeapObjectTag)); | 3057 __ add(r6, r6, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| 3058 DirectCEntryStub stub; | 3058 DirectCEntryStub stub; |
| (...skipping 3073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6132 __ bind(&fast_elements_case); | 6132 __ bind(&fast_elements_case); |
| 6133 GenerateCase(masm, FAST_ELEMENTS); | 6133 GenerateCase(masm, FAST_ELEMENTS); |
| 6134 } | 6134 } |
| 6135 | 6135 |
| 6136 | 6136 |
| 6137 #undef __ | 6137 #undef __ |
| 6138 | 6138 |
| 6139 } } // namespace v8::internal | 6139 } } // namespace v8::internal |
| 6140 | 6140 |
| 6141 #endif // V8_TARGET_ARCH_ARM | 6141 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |