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

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

Issue 10704189: Revert 12069: Implements a new API to set a function entry hook for profiling (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 5 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 | « src/api.cc ('k') | src/arm/full-codegen-arm.cc » ('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 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 7495 matching lines...) Expand 10 before | Expand all | Expand 10 after
7506 __ Ret(); 7506 __ Ret();
7507 7507
7508 // Array literal has ElementsKind of FAST_DOUBLE_ELEMENTS. 7508 // Array literal has ElementsKind of FAST_DOUBLE_ELEMENTS.
7509 __ bind(&double_elements); 7509 __ bind(&double_elements);
7510 __ ldr(r5, FieldMemOperand(r1, JSObject::kElementsOffset)); 7510 __ ldr(r5, FieldMemOperand(r1, JSObject::kElementsOffset));
7511 __ StoreNumberToDoubleElements(r0, r3, r1, r5, r6, r7, r9, r2, 7511 __ StoreNumberToDoubleElements(r0, r3, r1, r5, r6, r7, r9, r2,
7512 &slow_elements); 7512 &slow_elements);
7513 __ Ret(); 7513 __ Ret();
7514 } 7514 }
7515 7515
7516
7517 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
7518 if (entry_hook_ != NULL) {
7519 ProfileEntryHookStub stub;
7520 __ push(lr);
7521 __ CallStub(&stub);
7522 __ pop(lr);
7523 }
7524 }
7525
7526
7527 void ProfileEntryHookStub::Generate(MacroAssembler* masm) {
7528 // The entry hook is a "push lr" instruction, followed by a call.
7529 const int32_t kReturnAddressDistanceFromFunctionStart =
7530 Assembler::kCallTargetAddressOffset + Assembler::kInstrSize;
7531
7532 // Save live volatile registers.
7533 __ Push(lr, r5, r1);
7534 const int32_t kNumSavedRegs = 3;
7535
7536 // Compute the function's address for the first argument.
7537 __ sub(r0, lr, Operand(kReturnAddressDistanceFromFunctionStart));
7538
7539 // The caller's return address is above the saved temporaries.
7540 // Grab that for the second argument to the hook.
7541 __ add(r1, sp, Operand(kNumSavedRegs * kPointerSize));
7542
7543 // Align the stack if necessary.
7544 int frame_alignment = masm->ActivationFrameAlignment();
7545 if (frame_alignment > kPointerSize) {
7546 __ mov(r5, sp);
7547 ASSERT(IsPowerOf2(frame_alignment));
7548 __ and_(sp, sp, Operand(-frame_alignment));
7549 }
7550
7551 #if defined(V8_HOST_ARCH_ARM)
7552 __ mov(ip, Operand(reinterpret_cast<int32_t>(&entry_hook_)));
7553 __ ldr(ip, MemOperand(ip));
7554 #else
7555 // Under the simulator we need to indirect the entry hook through a
7556 // trampoline function at a known address.
7557 ApiFunction dispatcher(reinterpret_cast<Address>(EntryHookTrampoline));
7558 __ mov(ip, Operand(ExternalReference(&dispatcher,
7559 ExternalReference::BUILTIN_CALL,
7560 masm->isolate())));
7561 #endif
7562 __ Call(ip);
7563
7564 // Restore the stack pointer if needed.
7565 if (frame_alignment > kPointerSize) {
7566 __ mov(sp, r5);
7567 }
7568
7569 __ Pop(lr, r5, r1);
7570 __ Ret();
7571 }
7572
7573 #undef __ 7516 #undef __
7574 7517
7575 } } // namespace v8::internal 7518 } } // namespace v8::internal
7576 7519
7577 #endif // V8_TARGET_ARCH_ARM 7520 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698