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

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

Issue 23588002: cleanup api callbacks now that handles are never returned directly (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: nits Created 7 years, 3 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/arm/macro-assembler-arm.h ('k') | src/arm/simulator-arm.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 2267 matching lines...) Expand 10 before | Expand all | Expand 10 after
2278 static int AddressOffset(ExternalReference ref0, ExternalReference ref1) { 2278 static int AddressOffset(ExternalReference ref0, ExternalReference ref1) {
2279 return ref0.address() - ref1.address(); 2279 return ref0.address() - ref1.address();
2280 } 2280 }
2281 2281
2282 2282
2283 void MacroAssembler::CallApiFunctionAndReturn(ExternalReference function, 2283 void MacroAssembler::CallApiFunctionAndReturn(ExternalReference function,
2284 Address function_address, 2284 Address function_address,
2285 ExternalReference thunk_ref, 2285 ExternalReference thunk_ref,
2286 Register thunk_last_arg, 2286 Register thunk_last_arg,
2287 int stack_space, 2287 int stack_space,
2288 bool returns_handle,
2289 int return_value_offset) { 2288 int return_value_offset) {
2290 ExternalReference next_address = 2289 ExternalReference next_address =
2291 ExternalReference::handle_scope_next_address(isolate()); 2290 ExternalReference::handle_scope_next_address(isolate());
2292 const int kNextOffset = 0; 2291 const int kNextOffset = 0;
2293 const int kLimitOffset = AddressOffset( 2292 const int kLimitOffset = AddressOffset(
2294 ExternalReference::handle_scope_limit_address(isolate()), 2293 ExternalReference::handle_scope_limit_address(isolate()),
2295 next_address); 2294 next_address);
2296 const int kLevelOffset = AddressOffset( 2295 const int kLevelOffset = AddressOffset(
2297 ExternalReference::handle_scope_level_address(isolate()), 2296 ExternalReference::handle_scope_level_address(isolate()),
2298 next_address); 2297 next_address);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
2347 mov(r0, Operand(ExternalReference::isolate_address(isolate()))); 2346 mov(r0, Operand(ExternalReference::isolate_address(isolate())));
2348 CallCFunction(ExternalReference::log_leave_external_function(isolate()), 1); 2347 CallCFunction(ExternalReference::log_leave_external_function(isolate()), 1);
2349 PopSafepointRegisters(); 2348 PopSafepointRegisters();
2350 } 2349 }
2351 2350
2352 Label promote_scheduled_exception; 2351 Label promote_scheduled_exception;
2353 Label delete_allocated_handles; 2352 Label delete_allocated_handles;
2354 Label leave_exit_frame; 2353 Label leave_exit_frame;
2355 Label return_value_loaded; 2354 Label return_value_loaded;
2356 2355
2357 if (returns_handle) {
2358 Label load_return_value;
2359 cmp(r0, Operand::Zero());
2360 b(eq, &load_return_value);
2361 // derefernce returned value
2362 ldr(r0, MemOperand(r0));
2363 b(&return_value_loaded);
2364 bind(&load_return_value);
2365 }
2366 // load value from ReturnValue 2356 // load value from ReturnValue
2367 ldr(r0, MemOperand(fp, return_value_offset*kPointerSize)); 2357 ldr(r0, MemOperand(fp, return_value_offset*kPointerSize));
2368 bind(&return_value_loaded); 2358 bind(&return_value_loaded);
2369 // No more valid handles (the result handle was the last one). Restore 2359 // No more valid handles (the result handle was the last one). Restore
2370 // previous handle scope. 2360 // previous handle scope.
2371 str(r4, MemOperand(r7, kNextOffset)); 2361 str(r4, MemOperand(r7, kNextOffset));
2372 if (emit_debug_code()) { 2362 if (emit_debug_code()) {
2373 ldr(r1, MemOperand(r7, kLevelOffset)); 2363 ldr(r1, MemOperand(r7, kLevelOffset));
2374 cmp(r1, r6); 2364 cmp(r1, r6);
2375 Check(eq, kUnexpectedLevelAfterReturnFromApiCall); 2365 Check(eq, kUnexpectedLevelAfterReturnFromApiCall);
(...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after
3889 void CodePatcher::EmitCondition(Condition cond) { 3879 void CodePatcher::EmitCondition(Condition cond) {
3890 Instr instr = Assembler::instr_at(masm_.pc_); 3880 Instr instr = Assembler::instr_at(masm_.pc_);
3891 instr = (instr & ~kCondMask) | cond; 3881 instr = (instr & ~kCondMask) | cond;
3892 masm_.emit(instr); 3882 masm_.emit(instr);
3893 } 3883 }
3894 3884
3895 3885
3896 } } // namespace v8::internal 3886 } } // namespace v8::internal
3897 3887
3898 #endif // V8_TARGET_ARCH_ARM 3888 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.h ('k') | src/arm/simulator-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698