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

Side by Side Diff: src/ia32/macro-assembler-ia32.cc

Issue 16286016: Notify CPU profiler when calling native getters (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Removed check that pthread_kill always succeeds Created 7 years, 6 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/ia32/macro-assembler-ia32.h ('k') | src/ia32/stub-cache-ia32.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 1955 matching lines...) Expand 10 before | Expand all | Expand 10 after
1966 lea(esi, Operand(esp, (argc + 1) * kPointerSize)); 1966 lea(esi, Operand(esp, (argc + 1) * kPointerSize));
1967 mov(Operand(esp, 0 * kPointerSize), esi); 1967 mov(Operand(esp, 0 * kPointerSize), esi);
1968 if (emit_debug_code()) { 1968 if (emit_debug_code()) {
1969 mov(Operand(esi, 0), Immediate(0)); 1969 mov(Operand(esi, 0), Immediate(0));
1970 } 1970 }
1971 } 1971 }
1972 } 1972 }
1973 1973
1974 1974
1975 void MacroAssembler::CallApiFunctionAndReturn(Address function_address, 1975 void MacroAssembler::CallApiFunctionAndReturn(Address function_address,
1976 Address thunk_address,
1977 Operand thunk_last_arg,
1976 int stack_space, 1978 int stack_space,
1977 bool returns_handle, 1979 bool returns_handle,
1978 int return_value_offset) { 1980 int return_value_offset) {
1979 ExternalReference next_address = 1981 ExternalReference next_address =
1980 ExternalReference::handle_scope_next_address(isolate()); 1982 ExternalReference::handle_scope_next_address(isolate());
1981 ExternalReference limit_address = 1983 ExternalReference limit_address =
1982 ExternalReference::handle_scope_limit_address(isolate()); 1984 ExternalReference::handle_scope_limit_address(isolate());
1983 ExternalReference level_address = 1985 ExternalReference level_address =
1984 ExternalReference::handle_scope_level_address(isolate()); 1986 ExternalReference::handle_scope_level_address(isolate());
1985 1987
1986 // Allocate HandleScope in callee-save registers. 1988 // Allocate HandleScope in callee-save registers.
1987 mov(ebx, Operand::StaticVariable(next_address)); 1989 mov(ebx, Operand::StaticVariable(next_address));
1988 mov(edi, Operand::StaticVariable(limit_address)); 1990 mov(edi, Operand::StaticVariable(limit_address));
1989 add(Operand::StaticVariable(level_address), Immediate(1)); 1991 add(Operand::StaticVariable(level_address), Immediate(1));
1990 1992
1991 if (FLAG_log_timer_events) { 1993 if (FLAG_log_timer_events) {
1992 FrameScope frame(this, StackFrame::MANUAL); 1994 FrameScope frame(this, StackFrame::MANUAL);
1993 PushSafepointRegisters(); 1995 PushSafepointRegisters();
1994 PrepareCallCFunction(1, eax); 1996 PrepareCallCFunction(1, eax);
1995 mov(Operand(esp, 0), 1997 mov(Operand(esp, 0),
1996 Immediate(ExternalReference::isolate_address(isolate()))); 1998 Immediate(ExternalReference::isolate_address(isolate())));
1997 CallCFunction(ExternalReference::log_enter_external_function(isolate()), 1); 1999 CallCFunction(ExternalReference::log_enter_external_function(isolate()), 1);
1998 PopSafepointRegisters(); 2000 PopSafepointRegisters();
1999 } 2001 }
2000 2002
2003
2004 Label profiler_disabled;
2005 Label end_profiler_check;
2006 bool* is_profiling_flag =
2007 isolate()->cpu_profiler()->is_profiling_address();
2008 STATIC_ASSERT(sizeof(*is_profiling_flag) == 1);
2009 mov(eax, Immediate(reinterpret_cast<Address>(is_profiling_flag)));
2010 cmpb(Operand(eax, 0), 0);
2011 j(zero, &profiler_disabled);
2012
2013 // Additional parameter is the address of the actual getter function.
2014 mov(thunk_last_arg, Immediate(function_address));
2015 // Call the api function.
2016 call(thunk_address, RelocInfo::RUNTIME_ENTRY);
2017 jmp(&end_profiler_check);
2018
2019 bind(&profiler_disabled);
2001 // Call the api function. 2020 // Call the api function.
2002 call(function_address, RelocInfo::RUNTIME_ENTRY); 2021 call(function_address, RelocInfo::RUNTIME_ENTRY);
2022 bind(&end_profiler_check);
2003 2023
2004 if (FLAG_log_timer_events) { 2024 if (FLAG_log_timer_events) {
2005 FrameScope frame(this, StackFrame::MANUAL); 2025 FrameScope frame(this, StackFrame::MANUAL);
2006 PushSafepointRegisters(); 2026 PushSafepointRegisters();
2007 PrepareCallCFunction(1, eax); 2027 PrepareCallCFunction(1, eax);
2008 mov(Operand(esp, 0), 2028 mov(Operand(esp, 0),
2009 Immediate(ExternalReference::isolate_address(isolate()))); 2029 Immediate(ExternalReference::isolate_address(isolate())));
2010 CallCFunction(ExternalReference::log_leave_external_function(isolate()), 1); 2030 CallCFunction(ExternalReference::log_leave_external_function(isolate()), 1);
2011 PopSafepointRegisters(); 2031 PopSafepointRegisters();
2012 } 2032 }
(...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after
3148 j(greater, &no_info_available); 3168 j(greater, &no_info_available);
3149 cmp(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), 3169 cmp(MemOperand(scratch_reg, -AllocationSiteInfo::kSize),
3150 Immediate(Handle<Map>(isolate()->heap()->allocation_site_info_map()))); 3170 Immediate(Handle<Map>(isolate()->heap()->allocation_site_info_map())));
3151 bind(&no_info_available); 3171 bind(&no_info_available);
3152 } 3172 }
3153 3173
3154 3174
3155 } } // namespace v8::internal 3175 } } // namespace v8::internal
3156 3176
3157 #endif // V8_TARGET_ARCH_IA32 3177 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/ia32/stub-cache-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698