Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(434)

Side by Side Diff: src/a64/code-stubs-a64.cc

Issue 148933002: A64: Call ProfileEntryHook in JSEntryStub and do not use real aborts in ProfileEntryHook. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Fix name Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/a64/macro-assembler-a64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2514 matching lines...) Expand 10 before | Expand all | Expand 10 after
2525 // Special handling of out-of-memory exceptions: Pass the failure result, 2525 // Special handling of out-of-memory exceptions: Pass the failure result,
2526 // rather than the exception descriptor. 2526 // rather than the exception descriptor.
2527 JumpIfOOM(masm, result, x10, throw_out_of_memory); 2527 JumpIfOOM(masm, result, x10, throw_out_of_memory);
2528 2528
2529 // Retrieve the pending exception. 2529 // Retrieve the pending exception.
2530 const Register& exception = result; 2530 const Register& exception = result;
2531 const Register& exception_address = x11; 2531 const Register& exception_address = x11;
2532 __ Mov(exception_address, 2532 __ Mov(exception_address,
2533 Operand(ExternalReference(Isolate::kPendingExceptionAddress, 2533 Operand(ExternalReference(Isolate::kPendingExceptionAddress,
2534 isolate))); 2534 isolate)));
2535 __ Ldr(exception, MemOperand(exception_address)); 2535 __ Ldr(exception, MemOperand(exception_address)q);
2536 2536
2537 // See if we just retrieved an OOM exception. 2537 // See if we just retrieved an OOM exception.
2538 JumpIfOOM(masm, exception, x10, throw_out_of_memory); 2538 JumpIfOOM(masm, exception, x10, throw_out_of_memory);
2539 2539
2540 // Clear the pending exception. 2540 // Clear the pending exception.
2541 __ Mov(x10, Operand(isolate->factory()->the_hole_value())); 2541 __ Mov(x10, Operand(isolate->factory()->the_hole_value()));
2542 __ Str(x10, MemOperand(exception_address)); 2542 __ Str(x10, MemOperand(exception_address));
2543 2543
2544 // x0 exception The exception descriptor. 2544 // x0 exception The exception descriptor.
2545 // x21 argv 2545 // x21 argv
(...skipping 12 matching lines...) Expand all
2558 // The result (x0) is passed through as the next PerformGC parameter. 2558 // The result (x0) is passed through as the next PerformGC parameter.
2559 } 2559 }
2560 2560
2561 2561
2562 void CEntryStub::Generate(MacroAssembler* masm) { 2562 void CEntryStub::Generate(MacroAssembler* masm) {
2563 // The Abort mechanism relies on CallRuntime, which in turn relies on 2563 // The Abort mechanism relies on CallRuntime, which in turn relies on
2564 // CEntryStub, so until this stub has been generated, we have to use a 2564 // CEntryStub, so until this stub has been generated, we have to use a
2565 // fall-back Abort mechanism. 2565 // fall-back Abort mechanism.
2566 // 2566 //
2567 // Note that this stub must be generated before any use of Abort. 2567 // Note that this stub must be generated before any use of Abort.
2568 masm->set_use_real_aborts(false); 2568 MacroAssembler::NoUseRealAbortsScope no_use_real_aborts(masm);
2569 2569
2570 ASM_LOCATION("CEntryStub::Generate entry"); 2570 ASM_LOCATION("CEntryStub::Generate entry");
2571 ProfileEntryHookStub::MaybeCallEntryHook(masm); 2571 ProfileEntryHookStub::MaybeCallEntryHook(masm);
2572 2572
2573 // Register parameters: 2573 // Register parameters:
2574 // x0: argc (including receiver, untagged) 2574 // x0: argc (including receiver, untagged)
2575 // x1: target 2575 // x1: target
2576 // 2576 //
2577 // The stack on entry holds the arguments and the receiver, with the receiver 2577 // The stack on entry holds the arguments and the receiver, with the receiver
2578 // at the highest address: 2578 // at the highest address:
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
2701 __ Mov(argc, 0); 2701 __ Mov(argc, 0);
2702 __ Mov(target, 0); 2702 __ Mov(target, 0);
2703 __ ThrowUncatchable(x0, x10, x11, x12, x13); 2703 __ ThrowUncatchable(x0, x10, x11, x12, x13);
2704 2704
2705 __ Bind(&throw_normal); 2705 __ Bind(&throw_normal);
2706 ASM_LOCATION("Throw normal"); 2706 ASM_LOCATION("Throw normal");
2707 __ Mov(argv, 0); 2707 __ Mov(argv, 0);
2708 __ Mov(argc, 0); 2708 __ Mov(argc, 0);
2709 __ Mov(target, 0); 2709 __ Mov(target, 0);
2710 __ Throw(x0, x10, x11, x12, x13); 2710 __ Throw(x0, x10, x11, x12, x13);
2711
2712 masm->set_use_real_aborts(true);
2713 } 2711 }
2714 2712
2715 2713
2716 // This is the entry point from C++. 5 arguments are provided in x0-x4. 2714 // This is the entry point from C++. 5 arguments are provided in x0-x4.
2717 // See use of the CALL_GENERATED_CODE macro for example in src/execution.cc. 2715 // See use of the CALL_GENERATED_CODE macro for example in src/execution.cc.
2718 // Input: 2716 // Input:
2719 // x0: code entry. 2717 // x0: code entry.
2720 // x1: function. 2718 // x1: function.
2721 // x2: receiver. 2719 // x2: receiver.
2722 // x3: argc. 2720 // x3: argc.
(...skipping 13 matching lines...) Expand all
2736 // Push callee-saved registers and synchronize the system stack pointer (csp) 2734 // Push callee-saved registers and synchronize the system stack pointer (csp)
2737 // and the JavaScript stack pointer (jssp). 2735 // and the JavaScript stack pointer (jssp).
2738 // 2736 //
2739 // We must not write to jssp until after the PushCalleeSavedRegisters() 2737 // We must not write to jssp until after the PushCalleeSavedRegisters()
2740 // call, since jssp is itself a callee-saved register. 2738 // call, since jssp is itself a callee-saved register.
2741 __ SetStackPointer(csp); 2739 __ SetStackPointer(csp);
2742 __ PushCalleeSavedRegisters(); 2740 __ PushCalleeSavedRegisters();
2743 __ Mov(jssp, csp); 2741 __ Mov(jssp, csp);
2744 __ SetStackPointer(jssp); 2742 __ SetStackPointer(jssp);
2745 2743
2744 ProfileEntryHookStub::MaybeCallEntryHook(masm);
ulan 2014/01/28 17:26:54 On ARM this is called before saving registers, but
2745
2746 // Build an entry frame (see layout below). 2746 // Build an entry frame (see layout below).
2747 Isolate* isolate = masm->isolate(); 2747 Isolate* isolate = masm->isolate();
2748 2748
2749 // Build an entry frame. 2749 // Build an entry frame.
2750 int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY; 2750 int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY;
2751 int64_t bad_frame_pointer = -1L; // Bad frame pointer to fail if it is used. 2751 int64_t bad_frame_pointer = -1L; // Bad frame pointer to fail if it is used.
2752 __ Mov(x13, bad_frame_pointer); 2752 __ Mov(x13, bad_frame_pointer);
2753 __ Mov(x12, Operand(Smi::FromInt(marker))); 2753 __ Mov(x12, Operand(Smi::FromInt(marker)));
2754 __ Mov(x11, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate))); 2754 __ Mov(x11, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate)));
2755 __ Ldr(x10, MemOperand(x11)); 2755 __ Ldr(x10, MemOperand(x11));
(...skipping 3692 matching lines...) Expand 10 before | Expand all | Expand 10 after
6448 AllowStubCallsScope allow_stub_calls(masm, true); 6448 AllowStubCallsScope allow_stub_calls(masm, true);
6449 ProfileEntryHookStub stub; 6449 ProfileEntryHookStub stub;
6450 __ Push(lr); 6450 __ Push(lr);
6451 __ CallStub(&stub); 6451 __ CallStub(&stub);
6452 __ Pop(lr); 6452 __ Pop(lr);
6453 } 6453 }
6454 } 6454 }
6455 6455
6456 6456
6457 void ProfileEntryHookStub::Generate(MacroAssembler* masm) { 6457 void ProfileEntryHookStub::Generate(MacroAssembler* masm) {
6458 MacroAssembler::NoUseRealAbortsScope no_use_real_aborts(masm);
ulan 2014/01/28 17:26:54 This stub is called in CEntryStub, which sets no_u
6458 // The entry hook is a "BumpSystemStackPointer" instruction (sub), followed by 6459 // The entry hook is a "BumpSystemStackPointer" instruction (sub), followed by
6459 // a "Push lr" instruction, followed by a call. 6460 // a "Push lr" instruction, followed by a call.
6460 // TODO(jbramley): Verify that this call is always made with relocation. 6461 // TODO(jbramley): Verify that this call is always made with relocation.
6461 static const int kReturnAddressDistanceFromFunctionStart = 6462 static const int kReturnAddressDistanceFromFunctionStart =
6462 Assembler::kCallSizeWithRelocation + (2 * kInstructionSize); 6463 Assembler::kCallSizeWithRelocation + (2 * kInstructionSize);
6463 6464
6464 // Save all kCallerSaved registers (including lr), since this can be called 6465 // Save all kCallerSaved registers (including lr), since this can be called
6465 // from anywhere. 6466 // from anywhere.
6466 // TODO(jbramley): What about FP registers? 6467 // TODO(jbramley): What about FP registers?
6467 __ PushCPURegList(kCallerSaved); 6468 __ PushCPURegList(kCallerSaved);
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
6922 JSFunction::kPrototypeOrInitialMapOffset)); 6923 JSFunction::kPrototypeOrInitialMapOffset));
6923 // Will both indicate a NULL and a Smi. 6924 // Will both indicate a NULL and a Smi.
6924 __ JumpIfSmi(x10, &unexpected_map); 6925 __ JumpIfSmi(x10, &unexpected_map);
6925 __ JumpIfObjectType(x10, x10, x11, MAP_TYPE, &map_ok); 6926 __ JumpIfObjectType(x10, x10, x11, MAP_TYPE, &map_ok);
6926 __ Bind(&unexpected_map); 6927 __ Bind(&unexpected_map);
6927 __ Abort("Unexpected initial map for Array function"); 6928 __ Abort("Unexpected initial map for Array function");
6928 __ Bind(&map_ok); 6929 __ Bind(&map_ok);
6929 6930
6930 // In type_info_cell, we expect either undefined or a valid Cell. 6931 // In type_info_cell, we expect either undefined or a valid Cell.
6931 Label okay_here; 6932 Label okay_here;
6932 Handle<Map> cell_map(masm->isolate()->heap()->global_property_cell_map()); 6933 Handle<Map> cell_map(masm->isolate()->heap()->cell_map());
ulan 2014/01/28 17:26:54 ARM uses cell_map, using global_property_cell_map
6933 __ JumpIfRoot(type_info_cell, Heap::kUndefinedValueRootIndex, &okay_here); 6934 __ JumpIfRoot(type_info_cell, Heap::kUndefinedValueRootIndex, &okay_here);
6934 __ Ldr(x10, FieldMemOperand(type_info_cell, Cell::kMapOffset)); 6935 __ Ldr(x10, FieldMemOperand(type_info_cell, Cell::kMapOffset));
6935 __ Cmp(x10, Operand(cell_map)); 6936 __ Cmp(x10, Operand(cell_map));
6936 __ Assert(eq, "Expected property cell in type_info_cell"); 6937 __ Assert(eq, "Expected property cell in type_info_cell");
6937 __ Bind(&okay_here); 6938 __ Bind(&okay_here);
6938 } 6939 }
6939 6940
6940 Register kind = x3; 6941 Register kind = x3;
6941 Label no_info, switch_ready; 6942 Label no_info, switch_ready;
6942 // Get the elements kind and case on that. 6943 // Get the elements kind and case on that.
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
7080 __ Bind(&fast_elements_case); 7081 __ Bind(&fast_elements_case);
7081 GenerateCase(masm, FAST_ELEMENTS); 7082 GenerateCase(masm, FAST_ELEMENTS);
7082 } 7083 }
7083 7084
7084 7085
7085 #undef __ 7086 #undef __
7086 7087
7087 } } // namespace v8::internal 7088 } } // namespace v8::internal
7088 7089
7089 #endif // V8_TARGET_ARCH_A64 7090 #endif // V8_TARGET_ARCH_A64
OLDNEW
« no previous file with comments | « no previous file | src/a64/macro-assembler-a64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698