| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 2548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2559 // The result (x0) is passed through as the next PerformGC parameter. | 2559 // The result (x0) is passed through as the next PerformGC parameter. |
| 2560 } | 2560 } |
| 2561 | 2561 |
| 2562 | 2562 |
| 2563 void CEntryStub::Generate(MacroAssembler* masm) { | 2563 void CEntryStub::Generate(MacroAssembler* masm) { |
| 2564 // The Abort mechanism relies on CallRuntime, which in turn relies on | 2564 // The Abort mechanism relies on CallRuntime, which in turn relies on |
| 2565 // CEntryStub, so until this stub has been generated, we have to use a | 2565 // CEntryStub, so until this stub has been generated, we have to use a |
| 2566 // fall-back Abort mechanism. | 2566 // fall-back Abort mechanism. |
| 2567 // | 2567 // |
| 2568 // Note that this stub must be generated before any use of Abort. | 2568 // Note that this stub must be generated before any use of Abort. |
| 2569 masm->set_use_real_aborts(false); | 2569 MacroAssembler::NoUseRealAbortsScope no_use_real_aborts(masm); |
| 2570 | 2570 |
| 2571 ASM_LOCATION("CEntryStub::Generate entry"); | 2571 ASM_LOCATION("CEntryStub::Generate entry"); |
| 2572 ProfileEntryHookStub::MaybeCallEntryHook(masm); | 2572 ProfileEntryHookStub::MaybeCallEntryHook(masm); |
| 2573 | 2573 |
| 2574 // Register parameters: | 2574 // Register parameters: |
| 2575 // x0: argc (including receiver, untagged) | 2575 // x0: argc (including receiver, untagged) |
| 2576 // x1: target | 2576 // x1: target |
| 2577 // | 2577 // |
| 2578 // The stack on entry holds the arguments and the receiver, with the receiver | 2578 // The stack on entry holds the arguments and the receiver, with the receiver |
| 2579 // at the highest address: | 2579 // at the highest address: |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2702 __ Mov(argc, 0); | 2702 __ Mov(argc, 0); |
| 2703 __ Mov(target, 0); | 2703 __ Mov(target, 0); |
| 2704 __ ThrowUncatchable(x0, x10, x11, x12, x13); | 2704 __ ThrowUncatchable(x0, x10, x11, x12, x13); |
| 2705 | 2705 |
| 2706 __ Bind(&throw_normal); | 2706 __ Bind(&throw_normal); |
| 2707 ASM_LOCATION("Throw normal"); | 2707 ASM_LOCATION("Throw normal"); |
| 2708 __ Mov(argv, 0); | 2708 __ Mov(argv, 0); |
| 2709 __ Mov(argc, 0); | 2709 __ Mov(argc, 0); |
| 2710 __ Mov(target, 0); | 2710 __ Mov(target, 0); |
| 2711 __ Throw(x0, x10, x11, x12, x13); | 2711 __ Throw(x0, x10, x11, x12, x13); |
| 2712 | |
| 2713 masm->set_use_real_aborts(true); | |
| 2714 } | 2712 } |
| 2715 | 2713 |
| 2716 | 2714 |
| 2717 // This is the entry point from C++. 5 arguments are provided in x0-x4. | 2715 // This is the entry point from C++. 5 arguments are provided in x0-x4. |
| 2718 // See use of the CALL_GENERATED_CODE macro for example in src/execution.cc. | 2716 // See use of the CALL_GENERATED_CODE macro for example in src/execution.cc. |
| 2719 // Input: | 2717 // Input: |
| 2720 // x0: code entry. | 2718 // x0: code entry. |
| 2721 // x1: function. | 2719 // x1: function. |
| 2722 // x2: receiver. | 2720 // x2: receiver. |
| 2723 // x3: argc. | 2721 // x3: argc. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 2737 // Push callee-saved registers and synchronize the system stack pointer (csp) | 2735 // Push callee-saved registers and synchronize the system stack pointer (csp) |
| 2738 // and the JavaScript stack pointer (jssp). | 2736 // and the JavaScript stack pointer (jssp). |
| 2739 // | 2737 // |
| 2740 // We must not write to jssp until after the PushCalleeSavedRegisters() | 2738 // We must not write to jssp until after the PushCalleeSavedRegisters() |
| 2741 // call, since jssp is itself a callee-saved register. | 2739 // call, since jssp is itself a callee-saved register. |
| 2742 __ SetStackPointer(csp); | 2740 __ SetStackPointer(csp); |
| 2743 __ PushCalleeSavedRegisters(); | 2741 __ PushCalleeSavedRegisters(); |
| 2744 __ Mov(jssp, csp); | 2742 __ Mov(jssp, csp); |
| 2745 __ SetStackPointer(jssp); | 2743 __ SetStackPointer(jssp); |
| 2746 | 2744 |
| 2745 ProfileEntryHookStub::MaybeCallEntryHook(masm); |
| 2746 |
| 2747 // Build an entry frame (see layout below). | 2747 // Build an entry frame (see layout below). |
| 2748 Isolate* isolate = masm->isolate(); | 2748 Isolate* isolate = masm->isolate(); |
| 2749 | 2749 |
| 2750 // Build an entry frame. | 2750 // Build an entry frame. |
| 2751 int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY; | 2751 int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY; |
| 2752 int64_t bad_frame_pointer = -1L; // Bad frame pointer to fail if it is used. | 2752 int64_t bad_frame_pointer = -1L; // Bad frame pointer to fail if it is used. |
| 2753 __ Mov(x13, bad_frame_pointer); | 2753 __ Mov(x13, bad_frame_pointer); |
| 2754 __ Mov(x12, Operand(Smi::FromInt(marker))); | 2754 __ Mov(x12, Operand(Smi::FromInt(marker))); |
| 2755 __ Mov(x11, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate))); | 2755 __ Mov(x11, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate))); |
| 2756 __ Ldr(x10, MemOperand(x11)); | 2756 __ Ldr(x10, MemOperand(x11)); |
| (...skipping 3692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6449 AllowStubCallsScope allow_stub_calls(masm, true); | 6449 AllowStubCallsScope allow_stub_calls(masm, true); |
| 6450 ProfileEntryHookStub stub; | 6450 ProfileEntryHookStub stub; |
| 6451 __ Push(lr); | 6451 __ Push(lr); |
| 6452 __ CallStub(&stub); | 6452 __ CallStub(&stub); |
| 6453 __ Pop(lr); | 6453 __ Pop(lr); |
| 6454 } | 6454 } |
| 6455 } | 6455 } |
| 6456 | 6456 |
| 6457 | 6457 |
| 6458 void ProfileEntryHookStub::Generate(MacroAssembler* masm) { | 6458 void ProfileEntryHookStub::Generate(MacroAssembler* masm) { |
| 6459 MacroAssembler::NoUseRealAbortsScope no_use_real_aborts(masm); |
| 6459 // The entry hook is a "BumpSystemStackPointer" instruction (sub), followed by | 6460 // The entry hook is a "BumpSystemStackPointer" instruction (sub), followed by |
| 6460 // a "Push lr" instruction, followed by a call. | 6461 // a "Push lr" instruction, followed by a call. |
| 6461 // TODO(jbramley): Verify that this call is always made with relocation. | 6462 // TODO(jbramley): Verify that this call is always made with relocation. |
| 6462 static const int kReturnAddressDistanceFromFunctionStart = | 6463 static const int kReturnAddressDistanceFromFunctionStart = |
| 6463 Assembler::kCallSizeWithRelocation + (2 * kInstructionSize); | 6464 Assembler::kCallSizeWithRelocation + (2 * kInstructionSize); |
| 6464 | 6465 |
| 6465 // Save all kCallerSaved registers (including lr), since this can be called | 6466 // Save all kCallerSaved registers (including lr), since this can be called |
| 6466 // from anywhere. | 6467 // from anywhere. |
| 6467 // TODO(jbramley): What about FP registers? | 6468 // TODO(jbramley): What about FP registers? |
| 6468 __ PushCPURegList(kCallerSaved); | 6469 __ PushCPURegList(kCallerSaved); |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6923 JSFunction::kPrototypeOrInitialMapOffset)); | 6924 JSFunction::kPrototypeOrInitialMapOffset)); |
| 6924 // Will both indicate a NULL and a Smi. | 6925 // Will both indicate a NULL and a Smi. |
| 6925 __ JumpIfSmi(x10, &unexpected_map); | 6926 __ JumpIfSmi(x10, &unexpected_map); |
| 6926 __ JumpIfObjectType(x10, x10, x11, MAP_TYPE, &map_ok); | 6927 __ JumpIfObjectType(x10, x10, x11, MAP_TYPE, &map_ok); |
| 6927 __ Bind(&unexpected_map); | 6928 __ Bind(&unexpected_map); |
| 6928 __ Abort("Unexpected initial map for Array function"); | 6929 __ Abort("Unexpected initial map for Array function"); |
| 6929 __ Bind(&map_ok); | 6930 __ Bind(&map_ok); |
| 6930 | 6931 |
| 6931 // In type_info_cell, we expect either undefined or a valid Cell. | 6932 // In type_info_cell, we expect either undefined or a valid Cell. |
| 6932 Label okay_here; | 6933 Label okay_here; |
| 6933 Handle<Map> cell_map(masm->isolate()->heap()->global_property_cell_map()); | 6934 Handle<Map> cell_map = masm->isolate()->factory()->cell_map(); |
| 6934 __ JumpIfRoot(type_info_cell, Heap::kUndefinedValueRootIndex, &okay_here); | 6935 __ JumpIfRoot(type_info_cell, Heap::kUndefinedValueRootIndex, &okay_here); |
| 6935 __ Ldr(x10, FieldMemOperand(type_info_cell, Cell::kMapOffset)); | 6936 __ Ldr(x10, FieldMemOperand(type_info_cell, Cell::kMapOffset)); |
| 6936 __ Cmp(x10, Operand(cell_map)); | 6937 __ Cmp(x10, Operand(cell_map)); |
| 6937 __ Assert(eq, "Expected property cell in type_info_cell"); | 6938 __ Assert(eq, "Expected property cell in type_info_cell"); |
| 6938 __ Bind(&okay_here); | 6939 __ Bind(&okay_here); |
| 6939 } | 6940 } |
| 6940 | 6941 |
| 6941 Register kind = x3; | 6942 Register kind = x3; |
| 6942 Label no_info, switch_ready; | 6943 Label no_info, switch_ready; |
| 6943 // Get the elements kind and case on that. | 6944 // Get the elements kind and case on that. |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7081 __ Bind(&fast_elements_case); | 7082 __ Bind(&fast_elements_case); |
| 7082 GenerateCase(masm, FAST_ELEMENTS); | 7083 GenerateCase(masm, FAST_ELEMENTS); |
| 7083 } | 7084 } |
| 7084 | 7085 |
| 7085 | 7086 |
| 7086 #undef __ | 7087 #undef __ |
| 7087 | 7088 |
| 7088 } } // namespace v8::internal | 7089 } } // namespace v8::internal |
| 7089 | 7090 |
| 7090 #endif // V8_TARGET_ARCH_A64 | 7091 #endif // V8_TARGET_ARCH_A64 |
| OLD | NEW |