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

Side by Side Diff: src/ia32/lithium-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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 bool LCodeGen::GeneratePrologue() { 135 bool LCodeGen::GeneratePrologue() {
136 ASSERT(is_generating()); 136 ASSERT(is_generating());
137 137
138 #ifdef DEBUG 138 #ifdef DEBUG
139 if (strlen(FLAG_stop_at) > 0 && 139 if (strlen(FLAG_stop_at) > 0 &&
140 info_->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) { 140 info_->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
141 __ int3(); 141 __ int3();
142 } 142 }
143 #endif 143 #endif
144 144
145 const FunctionEntryHook* hook_location = V8::GetFunctionEntryHookLocation();
146 if (*hook_location != NULL) {
147 ProfileEntryHookStub stub;
148 __ CallStub(&stub);
149 }
150
145 // Strict mode functions and builtins need to replace the receiver 151 // Strict mode functions and builtins need to replace the receiver
146 // with undefined when called as functions (without an explicit 152 // with undefined when called as functions (without an explicit
147 // receiver object). ecx is zero for method calls and non-zero for 153 // receiver object). ecx is zero for method calls and non-zero for
148 // function calls. 154 // function calls.
149 if (!info_->is_classic_mode() || info_->is_native()) { 155 if (!info_->is_classic_mode() || info_->is_native()) {
150 Label ok; 156 Label ok;
151 __ test(ecx, Operand(ecx)); 157 __ test(ecx, Operand(ecx));
152 __ j(zero, &ok, Label::kNear); 158 __ j(zero, &ok, Label::kNear);
153 // +1 for return address. 159 // +1 for return address.
154 int receiver_offset = (scope()->num_parameters() + 1) * kPointerSize; 160 int receiver_offset = (scope()->num_parameters() + 1) * kPointerSize;
(...skipping 5177 matching lines...) Expand 10 before | Expand all | Expand 10 after
5332 FixedArray::kHeaderSize - kPointerSize)); 5338 FixedArray::kHeaderSize - kPointerSize));
5333 __ bind(&done); 5339 __ bind(&done);
5334 } 5340 }
5335 5341
5336 5342
5337 #undef __ 5343 #undef __
5338 5344
5339 } } // namespace v8::internal 5345 } } // namespace v8::internal
5340 5346
5341 #endif // V8_TARGET_ARCH_IA32 5347 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698