equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. |
3 * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. |
3 * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. |
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5 * |
5 * |
6 * This code is free software; you can redistribute it and/or modify it |
6 * This code is free software; you can redistribute it and/or modify it |
7 * under the terms of the GNU General Public License version 2 only, as |
7 * under the terms of the GNU General Public License version 2 only, as |
404 |
404 |
405 // If the result was an oop then unbox it and store it in |
405 // If the result was an oop then unbox it and store it in |
406 // oop_temp where the garbage collector can see it before |
406 // oop_temp where the garbage collector can see it before |
407 // we release the handle it might be protected by. |
407 // we release the handle it might be protected by. |
408 if (handler->result_type() == &ffi_type_pointer) { |
408 if (handler->result_type() == &ffi_type_pointer) { |
409 if (result[0] == 0) { |
409 if (result[0]) |
|
410 istate->set_oop_temp(*(oop *) result[0]); |
|
411 else |
410 istate->set_oop_temp(NULL); |
412 istate->set_oop_temp(NULL); |
411 } else { |
|
412 jobject handle = reinterpret_cast<jobject>(result[0]); |
|
413 istate->set_oop_temp(JNIHandles::resolve(handle)); |
|
414 } |
|
415 } |
413 } |
416 |
414 |
417 // Reset handle block |
415 // Reset handle block |
418 thread->active_handles()->clear(); |
416 thread->active_handles()->clear(); |
419 |
417 |