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 1976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1987 __ ldr(r4, MemOperand(sp, offset_to_argv)); | 1987 __ ldr(r4, MemOperand(sp, offset_to_argv)); |
1988 | 1988 |
1989 // Push a frame with special values setup to mark it as an entry frame. | 1989 // Push a frame with special values setup to mark it as an entry frame. |
1990 // r0: code entry | 1990 // r0: code entry |
1991 // r1: function | 1991 // r1: function |
1992 // r2: receiver | 1992 // r2: receiver |
1993 // r3: argc | 1993 // r3: argc |
1994 // r4: argv | 1994 // r4: argv |
1995 Isolate* isolate = masm->isolate(); | 1995 Isolate* isolate = masm->isolate(); |
1996 int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY; | 1996 int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY; |
1997 __ mov(r8, Operand(Smi::FromInt(marker))); | 1997 __ mov(r8, Operand(Smi::FromInt(marker))); |
Rodolph Perfetta
2013/11/27 20:09:41
if (FLAG_enable_ool_constant_pool)
rmcilroy
2013/11/28 11:32:26
Done.
| |
1998 __ mov(r7, Operand(Smi::FromInt(marker))); | |
1998 __ mov(r6, Operand(Smi::FromInt(marker))); | 1999 __ mov(r6, Operand(Smi::FromInt(marker))); |
1999 __ mov(r5, | 2000 __ mov(r5, |
2000 Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate))); | 2001 Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate))); |
2001 __ ldr(r5, MemOperand(r5)); | 2002 __ ldr(r5, MemOperand(r5)); |
2002 __ mov(ip, Operand(-1)); // Push a bad frame pointer to fail if it is used. | 2003 __ mov(ip, Operand(-1)); // Push a bad frame pointer to fail if it is used. |
2003 __ Push(ip, r8, r6, r5); | 2004 __ stm(db_w, sp, r5.bit() | r6.bit() | r7.bit() | |
2005 (FLAG_enable_ool_constant_pool ? r8.bit() : 0) | | |
2006 ip.bit()); | |
2004 | 2007 |
2005 // Set up frame pointer for the frame to be pushed. | 2008 // Set up frame pointer for the frame to be pushed. |
2006 __ add(fp, sp, Operand(-EntryFrameConstants::kCallerFPOffset)); | 2009 __ add(fp, sp, Operand(-EntryFrameConstants::kCallerFPOffset)); |
2007 | 2010 |
2008 // If this is the outermost JS call, set js_entry_sp value. | 2011 // If this is the outermost JS call, set js_entry_sp value. |
2009 Label non_outermost_js; | 2012 Label non_outermost_js; |
2010 ExternalReference js_entry_sp(Isolate::kJSEntrySPAddress, isolate); | 2013 ExternalReference js_entry_sp(Isolate::kJSEntrySPAddress, isolate); |
2011 __ mov(r5, Operand(ExternalReference(js_entry_sp))); | 2014 __ mov(r5, Operand(ExternalReference(js_entry_sp))); |
2012 __ ldr(r6, MemOperand(r5)); | 2015 __ ldr(r6, MemOperand(r5)); |
2013 __ cmp(r6, Operand::Zero()); | 2016 __ cmp(r6, Operand::Zero()); |
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2577 __ Allocate(r9, r0, r3, r4, &runtime, TAG_OBJECT); | 2580 __ Allocate(r9, r0, r3, r4, &runtime, TAG_OBJECT); |
2578 | 2581 |
2579 // r0 = address of new object(s) (tagged) | 2582 // r0 = address of new object(s) (tagged) |
2580 // r2 = argument count (tagged) | 2583 // r2 = argument count (tagged) |
2581 // Get the arguments boilerplate from the current native context into r4. | 2584 // Get the arguments boilerplate from the current native context into r4. |
2582 const int kNormalOffset = | 2585 const int kNormalOffset = |
2583 Context::SlotOffset(Context::ARGUMENTS_BOILERPLATE_INDEX); | 2586 Context::SlotOffset(Context::ARGUMENTS_BOILERPLATE_INDEX); |
2584 const int kAliasedOffset = | 2587 const int kAliasedOffset = |
2585 Context::SlotOffset(Context::ALIASED_ARGUMENTS_BOILERPLATE_INDEX); | 2588 Context::SlotOffset(Context::ALIASED_ARGUMENTS_BOILERPLATE_INDEX); |
2586 | 2589 |
2587 __ ldr(r4, MemOperand(r8, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | 2590 __ ldr(r4, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
2588 __ ldr(r4, FieldMemOperand(r4, GlobalObject::kNativeContextOffset)); | 2591 __ ldr(r4, FieldMemOperand(r4, GlobalObject::kNativeContextOffset)); |
2589 __ cmp(r1, Operand::Zero()); | 2592 __ cmp(r1, Operand::Zero()); |
2590 __ ldr(r4, MemOperand(r4, kNormalOffset), eq); | 2593 __ ldr(r4, MemOperand(r4, kNormalOffset), eq); |
2591 __ ldr(r4, MemOperand(r4, kAliasedOffset), ne); | 2594 __ ldr(r4, MemOperand(r4, kAliasedOffset), ne); |
2592 | 2595 |
2593 // r0 = address of new object (tagged) | 2596 // r0 = address of new object (tagged) |
2594 // r1 = mapped parameter count (tagged) | 2597 // r1 = mapped parameter count (tagged) |
2595 // r2 = argument count (tagged) | 2598 // r2 = argument count (tagged) |
2596 // r4 = address of boilerplate object (tagged) | 2599 // r4 = address of boilerplate object (tagged) |
2597 // Copy the JS object part. | 2600 // Copy the JS object part. |
(...skipping 30 matching lines...) Expand all Loading... | |
2628 __ cmp(r1, Operand(Smi::FromInt(0))); | 2631 __ cmp(r1, Operand(Smi::FromInt(0))); |
2629 // Move backing store address to r3, because it is | 2632 // Move backing store address to r3, because it is |
2630 // expected there when filling in the unmapped arguments. | 2633 // expected there when filling in the unmapped arguments. |
2631 __ mov(r3, r4, LeaveCC, eq); | 2634 __ mov(r3, r4, LeaveCC, eq); |
2632 __ b(eq, &skip_parameter_map); | 2635 __ b(eq, &skip_parameter_map); |
2633 | 2636 |
2634 __ LoadRoot(r6, Heap::kNonStrictArgumentsElementsMapRootIndex); | 2637 __ LoadRoot(r6, Heap::kNonStrictArgumentsElementsMapRootIndex); |
2635 __ str(r6, FieldMemOperand(r4, FixedArray::kMapOffset)); | 2638 __ str(r6, FieldMemOperand(r4, FixedArray::kMapOffset)); |
2636 __ add(r6, r1, Operand(Smi::FromInt(2))); | 2639 __ add(r6, r1, Operand(Smi::FromInt(2))); |
2637 __ str(r6, FieldMemOperand(r4, FixedArray::kLengthOffset)); | 2640 __ str(r6, FieldMemOperand(r4, FixedArray::kLengthOffset)); |
2638 __ str(r8, FieldMemOperand(r4, FixedArray::kHeaderSize + 0 * kPointerSize)); | 2641 __ str(cp, FieldMemOperand(r4, FixedArray::kHeaderSize + 0 * kPointerSize)); |
2639 __ add(r6, r4, Operand(r1, LSL, 1)); | 2642 __ add(r6, r4, Operand(r1, LSL, 1)); |
2640 __ add(r6, r6, Operand(kParameterMapHeaderSize)); | 2643 __ add(r6, r6, Operand(kParameterMapHeaderSize)); |
2641 __ str(r6, FieldMemOperand(r4, FixedArray::kHeaderSize + 1 * kPointerSize)); | 2644 __ str(r6, FieldMemOperand(r4, FixedArray::kHeaderSize + 1 * kPointerSize)); |
2642 | 2645 |
2643 // Copy the parameter slots and the holes in the arguments. | 2646 // Copy the parameter slots and the holes in the arguments. |
2644 // We need to fill in mapped_parameter_count slots. They index the context, | 2647 // We need to fill in mapped_parameter_count slots. They index the context, |
2645 // where parameters are stored in reverse order, at | 2648 // where parameters are stored in reverse order, at |
2646 // MIN_CONTEXT_SLOTS .. MIN_CONTEXT_SLOTS+parameter_count-1 | 2649 // MIN_CONTEXT_SLOTS .. MIN_CONTEXT_SLOTS+parameter_count-1 |
2647 // The mapped parameter thus need to get indices | 2650 // The mapped parameter thus need to get indices |
2648 // MIN_CONTEXT_SLOTS+parameter_count-1 .. | 2651 // MIN_CONTEXT_SLOTS+parameter_count-1 .. |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3022 __ mov(r0, Operand::Zero()); | 3025 __ mov(r0, Operand::Zero()); |
3023 __ str(r0, MemOperand(sp, 2 * kPointerSize)); | 3026 __ str(r0, MemOperand(sp, 2 * kPointerSize)); |
3024 | 3027 |
3025 // Argument 5 (sp[4]): static offsets vector buffer. | 3028 // Argument 5 (sp[4]): static offsets vector buffer. |
3026 __ mov(r0, | 3029 __ mov(r0, |
3027 Operand(ExternalReference::address_of_static_offsets_vector(isolate))); | 3030 Operand(ExternalReference::address_of_static_offsets_vector(isolate))); |
3028 __ str(r0, MemOperand(sp, 1 * kPointerSize)); | 3031 __ str(r0, MemOperand(sp, 1 * kPointerSize)); |
3029 | 3032 |
3030 // For arguments 4 and 3 get string length, calculate start of string data and | 3033 // 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). | 3034 // calculate the shift of the index (0 for ASCII and 1 for two byte). |
3032 __ add(r8, subject, Operand(SeqString::kHeaderSize - kHeapObjectTag)); | 3035 __ add(r7, subject, Operand(SeqString::kHeaderSize - kHeapObjectTag)); |
3033 __ eor(r3, r3, Operand(1)); | 3036 __ eor(r3, r3, Operand(1)); |
3034 // Load the length from the original subject string from the previous stack | 3037 // 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 | 3038 // 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 | 3039 // 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.) | 3040 // the previous fp onto the stack and moves up sp by 2 * kPointerSize.) |
3038 __ ldr(subject, MemOperand(fp, kSubjectOffset + 2 * kPointerSize)); | 3041 __ ldr(subject, MemOperand(fp, kSubjectOffset + 2 * kPointerSize)); |
3039 // If slice offset is not 0, load the length from the original sliced string. | 3042 // If slice offset is not 0, load the length from the original sliced string. |
3040 // Argument 4, r3: End of string data | 3043 // Argument 4, r3: End of string data |
3041 // Argument 3, r2: Start of string data | 3044 // Argument 3, r2: Start of string data |
3042 // Prepare start and end index of the input. | 3045 // Prepare start and end index of the input. |
3043 __ add(r9, r8, Operand(r9, LSL, r3)); | 3046 __ add(r9, r7, Operand(r9, LSL, r3)); |
3044 __ add(r2, r9, Operand(r1, LSL, r3)); | 3047 __ add(r2, r9, Operand(r1, LSL, r3)); |
3045 | 3048 |
3046 __ ldr(r8, FieldMemOperand(subject, String::kLengthOffset)); | 3049 __ ldr(r7, FieldMemOperand(subject, String::kLengthOffset)); |
3047 __ SmiUntag(r8); | 3050 __ SmiUntag(r7); |
3048 __ add(r3, r9, Operand(r8, LSL, r3)); | 3051 __ add(r3, r9, Operand(r7, LSL, r3)); |
3049 | 3052 |
3050 // Argument 2 (r1): Previous index. | 3053 // Argument 2 (r1): Previous index. |
3051 // Already there | 3054 // Already there |
3052 | 3055 |
3053 // Argument 1 (r0): Subject string. | 3056 // Argument 1 (r0): Subject string. |
3054 __ mov(r0, subject); | 3057 __ mov(r0, subject); |
3055 | 3058 |
3056 // Locate the code entry and call it. | 3059 // Locate the code entry and call it. |
3057 __ add(r6, r6, Operand(Code::kHeaderSize - kHeapObjectTag)); | 3060 __ add(r6, r6, Operand(Code::kHeaderSize - kHeapObjectTag)); |
3058 DirectCEntryStub stub; | 3061 DirectCEntryStub stub; |
(...skipping 3073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6132 __ bind(&fast_elements_case); | 6135 __ bind(&fast_elements_case); |
6133 GenerateCase(masm, FAST_ELEMENTS); | 6136 GenerateCase(masm, FAST_ELEMENTS); |
6134 } | 6137 } |
6135 | 6138 |
6136 | 6139 |
6137 #undef __ | 6140 #undef __ |
6138 | 6141 |
6139 } } // namespace v8::internal | 6142 } } // namespace v8::internal |
6140 | 6143 |
6141 #endif // V8_TARGET_ARCH_ARM | 6144 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |