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

Side by Side Diff: src/ia32/full-codegen-ia32.cc

Issue 10706002: 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: Sketch ARM code stub. 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
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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 SetFunctionPosition(function()); 123 SetFunctionPosition(function());
124 Comment cmnt(masm_, "[ function compiled by full code generator"); 124 Comment cmnt(masm_, "[ function compiled by full code generator");
125 125
126 #ifdef DEBUG 126 #ifdef DEBUG
127 if (strlen(FLAG_stop_at) > 0 && 127 if (strlen(FLAG_stop_at) > 0 &&
128 info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) { 128 info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
129 __ int3(); 129 __ int3();
130 } 130 }
131 #endif 131 #endif
132 132
133 const FunctionEntryHook* hook_location = V8::GetFunctionEntryHookLocation();
134 if (*hook_location != NULL) {
135 ProfileEntryHookStub stub;
136 __ CallStub(&stub);
137 }
138
133 // Strict mode functions and builtins need to replace the receiver 139 // Strict mode functions and builtins need to replace the receiver
134 // with undefined when called as functions (without an explicit 140 // with undefined when called as functions (without an explicit
135 // receiver object). ecx is zero for method calls and non-zero for 141 // receiver object). ecx is zero for method calls and non-zero for
136 // function calls. 142 // function calls.
137 if (!info->is_classic_mode() || info->is_native()) { 143 if (!info->is_classic_mode() || info->is_native()) {
138 Label ok; 144 Label ok;
139 __ test(ecx, ecx); 145 __ test(ecx, ecx);
140 __ j(zero, &ok, Label::kNear); 146 __ j(zero, &ok, Label::kNear);
141 // +1 for return address. 147 // +1 for return address.
142 int receiver_offset = (info->scope()->num_parameters() + 1) * kPointerSize; 148 int receiver_offset = (info->scope()->num_parameters() + 1) * kPointerSize;
(...skipping 4400 matching lines...) Expand 10 before | Expand all | Expand 10 after
4543 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), esi); 4549 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), esi);
4544 } 4550 }
4545 __ PopTryHandler(); 4551 __ PopTryHandler();
4546 __ call(finally_entry_); 4552 __ call(finally_entry_);
4547 4553
4548 *stack_depth = 0; 4554 *stack_depth = 0;
4549 *context_length = 0; 4555 *context_length = 0;
4550 return previous_; 4556 return previous_;
4551 } 4557 }
4552 4558
4553
4554 #undef __ 4559 #undef __
4555 4560
4556 } } // namespace v8::internal 4561 } } // namespace v8::internal
4557 4562
4558 #endif // V8_TARGET_ARCH_IA32 4563 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698