| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 | 113 |
| 114 // Generate code for a JS function. On entry to the function the receiver | 114 // Generate code for a JS function. On entry to the function the receiver |
| 115 // and arguments have been pushed on the stack left to right. The actual | 115 // and arguments have been pushed on the stack left to right. The actual |
| 116 // argument count matches the formal parameter count expected by the | 116 // argument count matches the formal parameter count expected by the |
| 117 // function. | 117 // function. |
| 118 // | 118 // |
| 119 // The live registers are: | 119 // The live registers are: |
| 120 // o r1: the JS function object being called (i.e., ourselves) | 120 // o r1: the JS function object being called (i.e., ourselves) |
| 121 // o cp: our context | 121 // o cp: our context |
| 122 // o pp: our constant pool pointer (if FLAG_enable_ool_constant_pool) |
| 122 // o fp: our caller's frame pointer | 123 // o fp: our caller's frame pointer |
| 123 // o sp: stack pointer | 124 // o sp: stack pointer |
| 124 // o lr: return address | 125 // o lr: return address |
| 125 // | 126 // |
| 126 // The function builds a JS frame. Please see JavaScriptFrameConstants in | 127 // The function builds a JS frame. Please see JavaScriptFrameConstants in |
| 127 // frames-arm.h for its layout. | 128 // frames-arm.h for its layout. |
| 128 void FullCodeGenerator::Generate() { | 129 void FullCodeGenerator::Generate() { |
| 129 CompilationInfo* info = info_; | 130 CompilationInfo* info = info_; |
| 130 handler_table_ = | 131 handler_table_ = |
| 131 isolate()->factory()->NewFixedArray(function()->handler_count(), TENURED); | 132 isolate()->factory()->NewFixedArray(function()->handler_count(), TENURED); |
| (...skipping 1872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2004 __ str(cp, FieldMemOperand(r0, JSGeneratorObject::kContextOffset)); | 2005 __ str(cp, FieldMemOperand(r0, JSGeneratorObject::kContextOffset)); |
| 2005 __ mov(r1, cp); | 2006 __ mov(r1, cp); |
| 2006 __ RecordWriteField(r0, JSGeneratorObject::kContextOffset, r1, r2, | 2007 __ RecordWriteField(r0, JSGeneratorObject::kContextOffset, r1, r2, |
| 2007 kLRHasBeenSaved, kDontSaveFPRegs); | 2008 kLRHasBeenSaved, kDontSaveFPRegs); |
| 2008 __ add(r1, fp, Operand(StandardFrameConstants::kExpressionsOffset)); | 2009 __ add(r1, fp, Operand(StandardFrameConstants::kExpressionsOffset)); |
| 2009 __ cmp(sp, r1); | 2010 __ cmp(sp, r1); |
| 2010 __ b(eq, &post_runtime); | 2011 __ b(eq, &post_runtime); |
| 2011 __ push(r0); // generator object | 2012 __ push(r0); // generator object |
| 2012 __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); | 2013 __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); |
| 2013 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2014 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 2015 __ RestoreConstantPoolPointer(); |
| 2014 __ bind(&post_runtime); | 2016 __ bind(&post_runtime); |
| 2015 __ pop(result_register()); | 2017 __ pop(result_register()); |
| 2016 EmitReturnSequence(); | 2018 EmitReturnSequence(); |
| 2017 | 2019 |
| 2018 __ bind(&resume); | 2020 __ bind(&resume); |
| 2019 context()->Plug(result_register()); | 2021 context()->Plug(result_register()); |
| 2020 break; | 2022 break; |
| 2021 } | 2023 } |
| 2022 | 2024 |
| 2023 case Yield::FINAL: { | 2025 case Yield::FINAL: { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2070 __ push(r0); // g | 2072 __ push(r0); // g |
| 2071 ASSERT(l_continuation.pos() > 0 && Smi::IsValid(l_continuation.pos())); | 2073 ASSERT(l_continuation.pos() > 0 && Smi::IsValid(l_continuation.pos())); |
| 2072 __ mov(r1, Operand(Smi::FromInt(l_continuation.pos()))); | 2074 __ mov(r1, Operand(Smi::FromInt(l_continuation.pos()))); |
| 2073 __ str(r1, FieldMemOperand(r0, JSGeneratorObject::kContinuationOffset)); | 2075 __ str(r1, FieldMemOperand(r0, JSGeneratorObject::kContinuationOffset)); |
| 2074 __ str(cp, FieldMemOperand(r0, JSGeneratorObject::kContextOffset)); | 2076 __ str(cp, FieldMemOperand(r0, JSGeneratorObject::kContextOffset)); |
| 2075 __ mov(r1, cp); | 2077 __ mov(r1, cp); |
| 2076 __ RecordWriteField(r0, JSGeneratorObject::kContextOffset, r1, r2, | 2078 __ RecordWriteField(r0, JSGeneratorObject::kContextOffset, r1, r2, |
| 2077 kLRHasBeenSaved, kDontSaveFPRegs); | 2079 kLRHasBeenSaved, kDontSaveFPRegs); |
| 2078 __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); | 2080 __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); |
| 2079 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2081 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 2082 __ RestoreConstantPoolPointer(); |
| 2080 __ pop(r0); // result | 2083 __ pop(r0); // result |
| 2081 EmitReturnSequence(); | 2084 EmitReturnSequence(); |
| 2082 __ bind(&l_resume); // received in r0 | 2085 __ bind(&l_resume); // received in r0 |
| 2083 __ PopTryHandler(); | 2086 __ PopTryHandler(); |
| 2084 | 2087 |
| 2085 // receiver = iter; f = 'next'; arg = received; | 2088 // receiver = iter; f = 'next'; arg = received; |
| 2086 __ bind(&l_next); | 2089 __ bind(&l_next); |
| 2087 __ LoadRoot(r2, Heap::knext_stringRootIndex); // "next" | 2090 __ LoadRoot(r2, Heap::knext_stringRootIndex); // "next" |
| 2088 __ ldr(r3, MemOperand(sp, 1 * kPointerSize)); // iter | 2091 __ ldr(r3, MemOperand(sp, 1 * kPointerSize)); // iter |
| 2089 __ Push(r3, r0); // iter, received | 2092 __ Push(r3, r0); // iter, received |
| 2090 | 2093 |
| 2091 // result = receiver[f](arg); | 2094 // result = receiver[f](arg); |
| 2092 __ bind(&l_call); | 2095 __ bind(&l_call); |
| 2093 Handle<Code> ic = isolate()->stub_cache()->ComputeKeyedCallInitialize(1); | 2096 Handle<Code> ic = isolate()->stub_cache()->ComputeKeyedCallInitialize(1); |
| 2094 CallIC(ic); | 2097 CallIC(ic); |
| 2095 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2098 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 2099 __ RestoreConstantPoolPointer(); |
| 2096 | 2100 |
| 2097 // if (!result.done) goto l_try; | 2101 // if (!result.done) goto l_try; |
| 2098 __ bind(&l_loop); | 2102 __ bind(&l_loop); |
| 2099 __ push(r0); // save result | 2103 __ push(r0); // save result |
| 2100 __ LoadRoot(r2, Heap::kdone_stringRootIndex); // "done" | 2104 __ LoadRoot(r2, Heap::kdone_stringRootIndex); // "done" |
| 2101 Handle<Code> done_ic = isolate()->builtins()->LoadIC_Initialize(); | 2105 Handle<Code> done_ic = isolate()->builtins()->LoadIC_Initialize(); |
| 2102 CallIC(done_ic); // result.done in r0 | 2106 CallIC(done_ic); // result.done in r0 |
| 2103 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); | 2107 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); |
| 2104 CallIC(bool_ic); | 2108 CallIC(bool_ic); |
| 2105 __ cmp(r0, Operand(0)); | 2109 __ cmp(r0, Operand(0)); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2158 // Enter a new JavaScript frame, and initialize its slots as they were when | 2162 // Enter a new JavaScript frame, and initialize its slots as they were when |
| 2159 // the generator was suspended. | 2163 // the generator was suspended. |
| 2160 Label resume_frame; | 2164 Label resume_frame; |
| 2161 __ bind(&push_frame); | 2165 __ bind(&push_frame); |
| 2162 __ bl(&resume_frame); | 2166 __ bl(&resume_frame); |
| 2163 __ jmp(&done); | 2167 __ jmp(&done); |
| 2164 __ bind(&resume_frame); | 2168 __ bind(&resume_frame); |
| 2165 // lr = return address. | 2169 // lr = return address. |
| 2166 // fp = caller's frame pointer. | 2170 // fp = caller's frame pointer. |
| 2167 // cp = callee's context, | 2171 // cp = callee's context, |
| 2172 // pp = callee's constant pool (if FLAG_enable_ool_constant_pool), |
| 2168 // r4 = callee's JS function. | 2173 // r4 = callee's JS function. |
| 2169 __ Push(lr, fp, cp, r4); | 2174 __ PushFixedFrame(r4); |
| 2170 // Adjust FP to point to saved FP. | 2175 // Adjust FP to point to saved FP. |
| 2171 __ add(fp, sp, Operand(2 * kPointerSize)); | 2176 __ add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); |
| 2172 | 2177 |
| 2173 // Load the operand stack size. | 2178 // Load the operand stack size. |
| 2174 __ ldr(r3, FieldMemOperand(r1, JSGeneratorObject::kOperandStackOffset)); | 2179 __ ldr(r3, FieldMemOperand(r1, JSGeneratorObject::kOperandStackOffset)); |
| 2175 __ ldr(r3, FieldMemOperand(r3, FixedArray::kLengthOffset)); | 2180 __ ldr(r3, FieldMemOperand(r3, FixedArray::kLengthOffset)); |
| 2176 __ SmiUntag(r3); | 2181 __ SmiUntag(r3); |
| 2177 | 2182 |
| 2178 // If we are sending a value and there is no operand stack, we can jump back | 2183 // If we are sending a value and there is no operand stack, we can jump back |
| 2179 // in directly. | 2184 // in directly. |
| 2180 if (resume_mode == JSGeneratorObject::NEXT) { | 2185 if (resume_mode == JSGeneratorObject::NEXT) { |
| 2181 Label slow_resume; | 2186 Label slow_resume; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2224 Handle<Map> map(isolate()->native_context()->generator_result_map()); | 2229 Handle<Map> map(isolate()->native_context()->generator_result_map()); |
| 2225 | 2230 |
| 2226 __ Allocate(map->instance_size(), r0, r2, r3, &gc_required, TAG_OBJECT); | 2231 __ Allocate(map->instance_size(), r0, r2, r3, &gc_required, TAG_OBJECT); |
| 2227 __ jmp(&allocated); | 2232 __ jmp(&allocated); |
| 2228 | 2233 |
| 2229 __ bind(&gc_required); | 2234 __ bind(&gc_required); |
| 2230 __ Push(Smi::FromInt(map->instance_size())); | 2235 __ Push(Smi::FromInt(map->instance_size())); |
| 2231 __ CallRuntime(Runtime::kAllocateInNewSpace, 1); | 2236 __ CallRuntime(Runtime::kAllocateInNewSpace, 1); |
| 2232 __ ldr(context_register(), | 2237 __ ldr(context_register(), |
| 2233 MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2238 MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 2239 __ RestoreConstantPoolPointer(); |
| 2234 | 2240 |
| 2235 __ bind(&allocated); | 2241 __ bind(&allocated); |
| 2236 __ mov(r1, Operand(map)); | 2242 __ mov(r1, Operand(map)); |
| 2237 __ pop(r2); | 2243 __ pop(r2); |
| 2238 __ mov(r3, Operand(isolate()->factory()->ToBoolean(done))); | 2244 __ mov(r3, Operand(isolate()->factory()->ToBoolean(done))); |
| 2239 __ mov(r4, Operand(isolate()->factory()->empty_fixed_array())); | 2245 __ mov(r4, Operand(isolate()->factory()->empty_fixed_array())); |
| 2240 ASSERT_EQ(map->instance_size(), 5 * kPointerSize); | 2246 ASSERT_EQ(map->instance_size(), 5 * kPointerSize); |
| 2241 __ str(r1, FieldMemOperand(r0, HeapObject::kMapOffset)); | 2247 __ str(r1, FieldMemOperand(r0, HeapObject::kMapOffset)); |
| 2242 __ str(r4, FieldMemOperand(r0, JSObject::kPropertiesOffset)); | 2248 __ str(r4, FieldMemOperand(r0, JSObject::kPropertiesOffset)); |
| 2243 __ str(r4, FieldMemOperand(r0, JSObject::kElementsOffset)); | 2249 __ str(r4, FieldMemOperand(r0, JSObject::kElementsOffset)); |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2609 } | 2615 } |
| 2610 __ mov(r2, Operand(name)); | 2616 __ mov(r2, Operand(name)); |
| 2611 } | 2617 } |
| 2612 // Record source position for debugger. | 2618 // Record source position for debugger. |
| 2613 SetSourcePosition(expr->position()); | 2619 SetSourcePosition(expr->position()); |
| 2614 // Call the IC initialization code. | 2620 // Call the IC initialization code. |
| 2615 Handle<Code> ic = | 2621 Handle<Code> ic = |
| 2616 isolate()->stub_cache()->ComputeCallInitialize(arg_count, mode); | 2622 isolate()->stub_cache()->ComputeCallInitialize(arg_count, mode); |
| 2617 CallIC(ic, mode, expr->CallFeedbackId()); | 2623 CallIC(ic, mode, expr->CallFeedbackId()); |
| 2618 RecordJSReturnSite(expr); | 2624 RecordJSReturnSite(expr); |
| 2619 // Restore context register. | 2625 // Restore context and pointer pool registers. |
| 2620 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2626 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 2627 __ RestoreConstantPoolPointer(); |
| 2621 context()->Plug(r0); | 2628 context()->Plug(r0); |
| 2622 } | 2629 } |
| 2623 | 2630 |
| 2624 | 2631 |
| 2625 void FullCodeGenerator::EmitKeyedCallWithIC(Call* expr, | 2632 void FullCodeGenerator::EmitKeyedCallWithIC(Call* expr, |
| 2626 Expression* key) { | 2633 Expression* key) { |
| 2627 // Load the key. | 2634 // Load the key. |
| 2628 VisitForAccumulatorValue(key); | 2635 VisitForAccumulatorValue(key); |
| 2629 | 2636 |
| 2630 // Swap the name of the function and the receiver on the stack to follow | 2637 // Swap the name of the function and the receiver on the stack to follow |
| (...skipping 11 matching lines...) Expand all Loading... |
| 2642 } | 2649 } |
| 2643 } | 2650 } |
| 2644 // Record source position for debugger. | 2651 // Record source position for debugger. |
| 2645 SetSourcePosition(expr->position()); | 2652 SetSourcePosition(expr->position()); |
| 2646 // Call the IC initialization code. | 2653 // Call the IC initialization code. |
| 2647 Handle<Code> ic = | 2654 Handle<Code> ic = |
| 2648 isolate()->stub_cache()->ComputeKeyedCallInitialize(arg_count); | 2655 isolate()->stub_cache()->ComputeKeyedCallInitialize(arg_count); |
| 2649 __ ldr(r2, MemOperand(sp, (arg_count + 1) * kPointerSize)); // Key. | 2656 __ ldr(r2, MemOperand(sp, (arg_count + 1) * kPointerSize)); // Key. |
| 2650 CallIC(ic, RelocInfo::CODE_TARGET, expr->CallFeedbackId()); | 2657 CallIC(ic, RelocInfo::CODE_TARGET, expr->CallFeedbackId()); |
| 2651 RecordJSReturnSite(expr); | 2658 RecordJSReturnSite(expr); |
| 2652 // Restore context register. | 2659 // Restore context and pointer pool registers. |
| 2653 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2660 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 2661 __ RestoreConstantPoolPointer(); |
| 2654 context()->DropAndPlug(1, r0); // Drop the key still on the stack. | 2662 context()->DropAndPlug(1, r0); // Drop the key still on the stack. |
| 2655 } | 2663 } |
| 2656 | 2664 |
| 2657 | 2665 |
| 2658 void FullCodeGenerator::EmitCallWithStub(Call* expr, CallFunctionFlags flags) { | 2666 void FullCodeGenerator::EmitCallWithStub(Call* expr, CallFunctionFlags flags) { |
| 2659 // Code common for calls using the call stub. | 2667 // Code common for calls using the call stub. |
| 2660 ZoneList<Expression*>* args = expr->arguments(); | 2668 ZoneList<Expression*>* args = expr->arguments(); |
| 2661 int arg_count = args->length(); | 2669 int arg_count = args->length(); |
| 2662 { PreservePositionScope scope(masm()->positions_recorder()); | 2670 { PreservePositionScope scope(masm()->positions_recorder()); |
| 2663 for (int i = 0; i < arg_count; i++) { | 2671 for (int i = 0; i < arg_count; i++) { |
| 2664 VisitForStackValue(args->at(i)); | 2672 VisitForStackValue(args->at(i)); |
| 2665 } | 2673 } |
| 2666 } | 2674 } |
| 2667 // Record source position for debugger. | 2675 // Record source position for debugger. |
| 2668 SetSourcePosition(expr->position()); | 2676 SetSourcePosition(expr->position()); |
| 2669 | 2677 |
| 2670 // Record call targets in unoptimized code. | 2678 // Record call targets in unoptimized code. |
| 2671 flags = static_cast<CallFunctionFlags>(flags | RECORD_CALL_TARGET); | 2679 flags = static_cast<CallFunctionFlags>(flags | RECORD_CALL_TARGET); |
| 2672 Handle<Object> uninitialized = | 2680 Handle<Object> uninitialized = |
| 2673 TypeFeedbackCells::UninitializedSentinel(isolate()); | 2681 TypeFeedbackCells::UninitializedSentinel(isolate()); |
| 2674 Handle<Cell> cell = isolate()->factory()->NewCell(uninitialized); | 2682 Handle<Cell> cell = isolate()->factory()->NewCell(uninitialized); |
| 2675 RecordTypeFeedbackCell(expr->CallFeedbackId(), cell); | 2683 RecordTypeFeedbackCell(expr->CallFeedbackId(), cell); |
| 2676 __ mov(r2, Operand(cell)); | 2684 __ mov(r2, Operand(cell)); |
| 2677 | 2685 |
| 2678 CallFunctionStub stub(arg_count, flags); | 2686 CallFunctionStub stub(arg_count, flags); |
| 2679 __ ldr(r1, MemOperand(sp, (arg_count + 1) * kPointerSize)); | 2687 __ ldr(r1, MemOperand(sp, (arg_count + 1) * kPointerSize)); |
| 2680 __ CallStub(&stub, expr->CallFeedbackId()); | 2688 __ CallStub(&stub, expr->CallFeedbackId()); |
| 2681 RecordJSReturnSite(expr); | 2689 RecordJSReturnSite(expr); |
| 2682 // Restore context register. | 2690 // Restore context and pointer pool registers. |
| 2683 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2691 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 2692 __ RestoreConstantPoolPointer(); |
| 2684 context()->DropAndPlug(1, r0); | 2693 context()->DropAndPlug(1, r0); |
| 2685 } | 2694 } |
| 2686 | 2695 |
| 2687 | 2696 |
| 2688 void FullCodeGenerator::EmitResolvePossiblyDirectEval(int arg_count) { | 2697 void FullCodeGenerator::EmitResolvePossiblyDirectEval(int arg_count) { |
| 2689 // r4: copy of the first argument or undefined if it doesn't exist. | 2698 // r4: copy of the first argument or undefined if it doesn't exist. |
| 2690 if (arg_count > 0) { | 2699 if (arg_count > 0) { |
| 2691 __ ldr(r4, MemOperand(sp, arg_count * kPointerSize)); | 2700 __ ldr(r4, MemOperand(sp, arg_count * kPointerSize)); |
| 2692 } else { | 2701 } else { |
| 2693 __ LoadRoot(r4, Heap::kUndefinedValueRootIndex); | 2702 __ LoadRoot(r4, Heap::kUndefinedValueRootIndex); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2750 __ str(r0, MemOperand(sp, (arg_count + 1) * kPointerSize)); | 2759 __ str(r0, MemOperand(sp, (arg_count + 1) * kPointerSize)); |
| 2751 __ str(r1, MemOperand(sp, arg_count * kPointerSize)); | 2760 __ str(r1, MemOperand(sp, arg_count * kPointerSize)); |
| 2752 } | 2761 } |
| 2753 | 2762 |
| 2754 // Record source position for debugger. | 2763 // Record source position for debugger. |
| 2755 SetSourcePosition(expr->position()); | 2764 SetSourcePosition(expr->position()); |
| 2756 CallFunctionStub stub(arg_count, RECEIVER_MIGHT_BE_IMPLICIT); | 2765 CallFunctionStub stub(arg_count, RECEIVER_MIGHT_BE_IMPLICIT); |
| 2757 __ ldr(r1, MemOperand(sp, (arg_count + 1) * kPointerSize)); | 2766 __ ldr(r1, MemOperand(sp, (arg_count + 1) * kPointerSize)); |
| 2758 __ CallStub(&stub); | 2767 __ CallStub(&stub); |
| 2759 RecordJSReturnSite(expr); | 2768 RecordJSReturnSite(expr); |
| 2760 // Restore context register. | 2769 // Restore context and pointer pool registers. |
| 2761 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2770 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 2771 __ RestoreConstantPoolPointer(); |
| 2762 context()->DropAndPlug(1, r0); | 2772 context()->DropAndPlug(1, r0); |
| 2763 } else if (proxy != NULL && proxy->var()->IsUnallocated()) { | 2773 } else if (proxy != NULL && proxy->var()->IsUnallocated()) { |
| 2764 // Push global object as receiver for the call IC. | 2774 // Push global object as receiver for the call IC. |
| 2765 __ ldr(r0, GlobalObjectOperand()); | 2775 __ ldr(r0, GlobalObjectOperand()); |
| 2766 __ push(r0); | 2776 __ push(r0); |
| 2767 EmitCallWithIC(expr, proxy->name(), RelocInfo::CODE_TARGET_CONTEXT); | 2777 EmitCallWithIC(expr, proxy->name(), RelocInfo::CODE_TARGET_CONTEXT); |
| 2768 } else if (proxy != NULL && proxy->var()->IsLookupSlot()) { | 2778 } else if (proxy != NULL && proxy->var()->IsLookupSlot()) { |
| 2769 // Call to a lookup slot (dynamically introduced variable). | 2779 // Call to a lookup slot (dynamically introduced variable). |
| 2770 Label slow, done; | 2780 Label slow, done; |
| 2771 | 2781 |
| (...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3745 __ JumpIfSmi(r0, &runtime); | 3755 __ JumpIfSmi(r0, &runtime); |
| 3746 __ CompareObjectType(r0, r1, r1, JS_FUNCTION_TYPE); | 3756 __ CompareObjectType(r0, r1, r1, JS_FUNCTION_TYPE); |
| 3747 __ b(ne, &runtime); | 3757 __ b(ne, &runtime); |
| 3748 | 3758 |
| 3749 // InvokeFunction requires the function in r1. Move it in there. | 3759 // InvokeFunction requires the function in r1. Move it in there. |
| 3750 __ mov(r1, result_register()); | 3760 __ mov(r1, result_register()); |
| 3751 ParameterCount count(arg_count); | 3761 ParameterCount count(arg_count); |
| 3752 __ InvokeFunction(r1, count, CALL_FUNCTION, | 3762 __ InvokeFunction(r1, count, CALL_FUNCTION, |
| 3753 NullCallWrapper(), CALL_AS_METHOD); | 3763 NullCallWrapper(), CALL_AS_METHOD); |
| 3754 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 3764 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 3765 __ RestoreConstantPoolPointer(); |
| 3755 __ jmp(&done); | 3766 __ jmp(&done); |
| 3756 | 3767 |
| 3757 __ bind(&runtime); | 3768 __ bind(&runtime); |
| 3758 __ push(r0); | 3769 __ push(r0); |
| 3759 __ CallRuntime(Runtime::kCall, args->length()); | 3770 __ CallRuntime(Runtime::kCall, args->length()); |
| 3760 __ bind(&done); | 3771 __ bind(&done); |
| 3761 | 3772 |
| 3762 context()->Plug(r0); | 3773 context()->Plug(r0); |
| 3763 } | 3774 } |
| 3764 | 3775 |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4159 VisitForStackValue(args->at(i)); | 4170 VisitForStackValue(args->at(i)); |
| 4160 } | 4171 } |
| 4161 | 4172 |
| 4162 if (expr->is_jsruntime()) { | 4173 if (expr->is_jsruntime()) { |
| 4163 // Call the JS runtime function. | 4174 // Call the JS runtime function. |
| 4164 __ mov(r2, Operand(expr->name())); | 4175 __ mov(r2, Operand(expr->name())); |
| 4165 RelocInfo::Mode mode = RelocInfo::CODE_TARGET; | 4176 RelocInfo::Mode mode = RelocInfo::CODE_TARGET; |
| 4166 Handle<Code> ic = | 4177 Handle<Code> ic = |
| 4167 isolate()->stub_cache()->ComputeCallInitialize(arg_count, mode); | 4178 isolate()->stub_cache()->ComputeCallInitialize(arg_count, mode); |
| 4168 CallIC(ic, mode, expr->CallRuntimeFeedbackId()); | 4179 CallIC(ic, mode, expr->CallRuntimeFeedbackId()); |
| 4169 // Restore context register. | 4180 // Restore context and pointer pool registers. |
| 4170 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 4181 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 4182 __ RestoreConstantPoolPointer(); |
| 4171 } else { | 4183 } else { |
| 4172 // Call the C runtime function. | 4184 // Call the C runtime function. |
| 4173 __ CallRuntime(expr->function(), arg_count); | 4185 __ CallRuntime(expr->function(), arg_count); |
| 4174 } | 4186 } |
| 4175 context()->Plug(r0); | 4187 context()->Plug(r0); |
| 4176 } | 4188 } |
| 4177 | 4189 |
| 4178 | 4190 |
| 4179 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { | 4191 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { |
| 4180 switch (expr->op()) { | 4192 switch (expr->op()) { |
| (...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4924 ASSERT(Memory::uint32_at(interrupt_address_pointer) == | 4936 ASSERT(Memory::uint32_at(interrupt_address_pointer) == |
| 4925 reinterpret_cast<uint32_t>( | 4937 reinterpret_cast<uint32_t>( |
| 4926 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4938 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 4927 return OSR_AFTER_STACK_CHECK; | 4939 return OSR_AFTER_STACK_CHECK; |
| 4928 } | 4940 } |
| 4929 | 4941 |
| 4930 | 4942 |
| 4931 } } // namespace v8::internal | 4943 } } // namespace v8::internal |
| 4932 | 4944 |
| 4933 #endif // V8_TARGET_ARCH_ARM | 4945 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |