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

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: 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 uintptr_t entry_hook = V8::GetFunctionEntryHook();
146 if (entry_hook != 0) {
147 __ call(reinterpret_cast<byte*>(entry_hook), RelocInfo::RUNTIME_ENTRY);
148 }
149
145 // Strict mode functions and builtins need to replace the receiver 150 // Strict mode functions and builtins need to replace the receiver
146 // with undefined when called as functions (without an explicit 151 // with undefined when called as functions (without an explicit
147 // receiver object). ecx is zero for method calls and non-zero for 152 // receiver object). ecx is zero for method calls and non-zero for
148 // function calls. 153 // function calls.
149 if (!info_->is_classic_mode() || info_->is_native()) { 154 if (!info_->is_classic_mode() || info_->is_native()) {
150 Label ok; 155 Label ok;
151 __ test(ecx, Operand(ecx)); 156 __ test(ecx, Operand(ecx));
152 __ j(zero, &ok, Label::kNear); 157 __ j(zero, &ok, Label::kNear);
153 // +1 for return address. 158 // +1 for return address.
154 int receiver_offset = (scope()->num_parameters() + 1) * kPointerSize; 159 int receiver_offset = (scope()->num_parameters() + 1) * kPointerSize;
(...skipping 5181 matching lines...) Expand 10 before | Expand all | Expand 10 after
5336 FixedArray::kHeaderSize - kPointerSize)); 5341 FixedArray::kHeaderSize - kPointerSize));
5337 __ bind(&done); 5342 __ bind(&done);
5338 } 5343 }
5339 5344
5340 5345
5341 #undef __ 5346 #undef __
5342 5347
5343 } } // namespace v8::internal 5348 } } // namespace v8::internal
5344 5349
5345 #endif // V8_TARGET_ARCH_IA32 5350 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698