OLD | NEW |
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 Loading... |
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, | |
1978 int stack_space, | 1976 int stack_space, |
1979 bool returns_handle, | 1977 bool returns_handle, |
1980 int return_value_offset) { | 1978 int return_value_offset) { |
1981 ExternalReference next_address = | 1979 ExternalReference next_address = |
1982 ExternalReference::handle_scope_next_address(isolate()); | 1980 ExternalReference::handle_scope_next_address(isolate()); |
1983 ExternalReference limit_address = | 1981 ExternalReference limit_address = |
1984 ExternalReference::handle_scope_limit_address(isolate()); | 1982 ExternalReference::handle_scope_limit_address(isolate()); |
1985 ExternalReference level_address = | 1983 ExternalReference level_address = |
1986 ExternalReference::handle_scope_level_address(isolate()); | 1984 ExternalReference::handle_scope_level_address(isolate()); |
1987 | 1985 |
1988 // Allocate HandleScope in callee-save registers. | 1986 // Allocate HandleScope in callee-save registers. |
1989 mov(ebx, Operand::StaticVariable(next_address)); | 1987 mov(ebx, Operand::StaticVariable(next_address)); |
1990 mov(edi, Operand::StaticVariable(limit_address)); | 1988 mov(edi, Operand::StaticVariable(limit_address)); |
1991 add(Operand::StaticVariable(level_address), Immediate(1)); | 1989 add(Operand::StaticVariable(level_address), Immediate(1)); |
1992 | 1990 |
1993 if (FLAG_log_timer_events) { | 1991 if (FLAG_log_timer_events) { |
1994 FrameScope frame(this, StackFrame::MANUAL); | 1992 FrameScope frame(this, StackFrame::MANUAL); |
1995 PushSafepointRegisters(); | 1993 PushSafepointRegisters(); |
1996 PrepareCallCFunction(1, eax); | 1994 PrepareCallCFunction(1, eax); |
1997 mov(Operand(esp, 0), | 1995 mov(Operand(esp, 0), |
1998 Immediate(ExternalReference::isolate_address(isolate()))); | 1996 Immediate(ExternalReference::isolate_address(isolate()))); |
1999 CallCFunction(ExternalReference::log_enter_external_function(isolate()), 1); | 1997 CallCFunction(ExternalReference::log_enter_external_function(isolate()), 1); |
2000 PopSafepointRegisters(); | 1998 PopSafepointRegisters(); |
2001 } | 1999 } |
2002 | 2000 |
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); | |
2020 // Call the api function. | 2001 // Call the api function. |
2021 call(function_address, RelocInfo::RUNTIME_ENTRY); | 2002 call(function_address, RelocInfo::RUNTIME_ENTRY); |
2022 bind(&end_profiler_check); | |
2023 | 2003 |
2024 if (FLAG_log_timer_events) { | 2004 if (FLAG_log_timer_events) { |
2025 FrameScope frame(this, StackFrame::MANUAL); | 2005 FrameScope frame(this, StackFrame::MANUAL); |
2026 PushSafepointRegisters(); | 2006 PushSafepointRegisters(); |
2027 PrepareCallCFunction(1, eax); | 2007 PrepareCallCFunction(1, eax); |
2028 mov(Operand(esp, 0), | 2008 mov(Operand(esp, 0), |
2029 Immediate(ExternalReference::isolate_address(isolate()))); | 2009 Immediate(ExternalReference::isolate_address(isolate()))); |
2030 CallCFunction(ExternalReference::log_leave_external_function(isolate()), 1); | 2010 CallCFunction(ExternalReference::log_leave_external_function(isolate()), 1); |
2031 PopSafepointRegisters(); | 2011 PopSafepointRegisters(); |
2032 } | 2012 } |
(...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3168 j(greater, &no_info_available); | 3148 j(greater, &no_info_available); |
3169 cmp(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), | 3149 cmp(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), |
3170 Immediate(Handle<Map>(isolate()->heap()->allocation_site_info_map()))); | 3150 Immediate(Handle<Map>(isolate()->heap()->allocation_site_info_map()))); |
3171 bind(&no_info_available); | 3151 bind(&no_info_available); |
3172 } | 3152 } |
3173 | 3153 |
3174 | 3154 |
3175 } } // namespace v8::internal | 3155 } } // namespace v8::internal |
3176 | 3156 |
3177 #endif // V8_TARGET_ARCH_IA32 | 3157 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |