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

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

Issue 254783003: Convert function.name to API-style accessor and make CallApiGetterStub serializable. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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/mips/code-stubs-mips.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 2284 matching lines...) Expand 10 before | Expand all | Expand 10 after
2295 void MacroAssembler::PrepareCallApiFunction(int argc) { 2295 void MacroAssembler::PrepareCallApiFunction(int argc) {
2296 EnterApiExitFrame(argc); 2296 EnterApiExitFrame(argc);
2297 if (emit_debug_code()) { 2297 if (emit_debug_code()) {
2298 mov(esi, Immediate(BitCast<int32_t>(kZapValue))); 2298 mov(esi, Immediate(BitCast<int32_t>(kZapValue)));
2299 } 2299 }
2300 } 2300 }
2301 2301
2302 2302
2303 void MacroAssembler::CallApiFunctionAndReturn( 2303 void MacroAssembler::CallApiFunctionAndReturn(
2304 Register function_address, 2304 Register function_address,
2305 Address thunk_address, 2305 ExternalReference thunk_ref,
2306 Operand thunk_last_arg, 2306 Operand thunk_last_arg,
2307 int stack_space, 2307 int stack_space,
2308 Operand return_value_operand, 2308 Operand return_value_operand,
2309 Operand* context_restore_operand) { 2309 Operand* context_restore_operand) {
2310 ExternalReference next_address = 2310 ExternalReference next_address =
2311 ExternalReference::handle_scope_next_address(isolate()); 2311 ExternalReference::handle_scope_next_address(isolate());
2312 ExternalReference limit_address = 2312 ExternalReference limit_address =
2313 ExternalReference::handle_scope_limit_address(isolate()); 2313 ExternalReference::handle_scope_limit_address(isolate());
2314 ExternalReference level_address = 2314 ExternalReference level_address =
2315 ExternalReference::handle_scope_level_address(isolate()); 2315 ExternalReference::handle_scope_level_address(isolate());
(...skipping 10 matching lines...) Expand all
2326 PrepareCallCFunction(1, eax); 2326 PrepareCallCFunction(1, eax);
2327 mov(Operand(esp, 0), 2327 mov(Operand(esp, 0),
2328 Immediate(ExternalReference::isolate_address(isolate()))); 2328 Immediate(ExternalReference::isolate_address(isolate())));
2329 CallCFunction(ExternalReference::log_enter_external_function(isolate()), 1); 2329 CallCFunction(ExternalReference::log_enter_external_function(isolate()), 1);
2330 PopSafepointRegisters(); 2330 PopSafepointRegisters();
2331 } 2331 }
2332 2332
2333 2333
2334 Label profiler_disabled; 2334 Label profiler_disabled;
2335 Label end_profiler_check; 2335 Label end_profiler_check;
2336 bool* is_profiling_flag = 2336 mov(eax, Immediate(ExternalReference::is_profiling_address(isolate())));
2337 isolate()->cpu_profiler()->is_profiling_address();
2338 STATIC_ASSERT(sizeof(*is_profiling_flag) == 1);
2339 mov(eax, Immediate(reinterpret_cast<Address>(is_profiling_flag)));
2340 cmpb(Operand(eax, 0), 0); 2337 cmpb(Operand(eax, 0), 0);
2341 j(zero, &profiler_disabled); 2338 j(zero, &profiler_disabled);
2342 2339
2343 // Additional parameter is the address of the actual getter function. 2340 // Additional parameter is the address of the actual getter function.
2344 mov(thunk_last_arg, function_address); 2341 mov(thunk_last_arg, function_address);
2345 // Call the api function. 2342 // Call the api function.
2346 call(thunk_address, RelocInfo::RUNTIME_ENTRY); 2343 mov(eax, Immediate(thunk_ref));
2344 call(eax);
2347 jmp(&end_profiler_check); 2345 jmp(&end_profiler_check);
2348 2346
2349 bind(&profiler_disabled); 2347 bind(&profiler_disabled);
2350 // Call the api function. 2348 // Call the api function.
2351 call(function_address); 2349 call(function_address);
2352 bind(&end_profiler_check); 2350 bind(&end_profiler_check);
2353 2351
2354 if (FLAG_log_timer_events) { 2352 if (FLAG_log_timer_events) {
2355 FrameScope frame(this, StackFrame::MANUAL); 2353 FrameScope frame(this, StackFrame::MANUAL);
2356 PushSafepointRegisters(); 2354 PushSafepointRegisters();
(...skipping 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after
3650 if (ms.shift() > 0) sar(edx, ms.shift()); 3648 if (ms.shift() > 0) sar(edx, ms.shift());
3651 mov(eax, dividend); 3649 mov(eax, dividend);
3652 shr(eax, 31); 3650 shr(eax, 31);
3653 add(edx, eax); 3651 add(edx, eax);
3654 } 3652 }
3655 3653
3656 3654
3657 } } // namespace v8::internal 3655 } } // namespace v8::internal
3658 3656
3659 #endif // V8_TARGET_ARCH_IA32 3657 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698