Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
564fe4e3
Kaydet (Commit)
564fe4e3
authored
Eki 27, 2014
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Clean up JNI_CreateJavaVM option code
Change-Id: I1902c73a72f29e948e479a2ae4776f2dff77b2b5
üst
0b3f0f0b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
36 deletions
+34
-36
sunjavaplugin.cxx
jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+34
-36
No files found.
jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
Dosyayı görüntüle @
564fe4e3
...
@@ -655,60 +655,58 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
...
@@ -655,60 +655,58 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
// Valgrind typically emits many false errors when executing JIT'ed JVM
// Valgrind typically emits many false errors when executing JIT'ed JVM
// code, so force the JVM into interpreted mode:
// code, so force the JVM into interpreted mode:
bool
f
orceInterpreted
=
FORCE_INTERPRETED
>
0
;
bool
addF
orceInterpreted
=
FORCE_INTERPRETED
>
0
;
// Some testing with Java 1.4 showed that JavaVMOption.optionString has to
// Some testing with Java 1.4 showed that JavaVMOption.optionString has to
// be encoded with the system encoding (i.e., osl_getThreadTextEncoding):
// be encoded with the system encoding (i.e., osl_getThreadTextEncoding):
JavaVMInitArgs
vm_args
;
JavaVMInitArgs
vm_args
;
sal_Int32
nOptions
=
1
+
cOptions
+
(
forceInterpreted
?
1
:
0
);
struct
Option
{
//TODO: check for overflow
Option
(
OString
const
&
theOptionString
,
void
*
theExtraInfo
)
:
boost
::
scoped_array
<
JavaVMOption
>
sarOptions
(
new
JavaVMOption
[
nOptions
]);
optionString
(
theOptionString
),
extraInfo
(
theExtraInfo
)
JavaVMOption
*
options
=
sarOptions
.
get
();
{}
OString
optionString
;
void
*
extraInfo
;
};
std
::
vector
<
Option
>
options
;
// We set an abort handler which is called when the VM calls _exit during
// We set an abort handler which is called when the VM calls _exit during
// JNI_CreateJavaVM. This happens when the LD_LIBRARY_PATH does not contain
// JNI_CreateJavaVM. This happens when the LD_LIBRARY_PATH does not contain
// all some directories of the Java installation. This is necessary for
// all some directories of the Java installation. This is necessary for
// all versions below 1.5.1
// all versions below 1.5.1
int
n
=
0
;
options
.
push_back
(
Option
(
"abort"
,
reinterpret_cast
<
void
*>
(
abort_handler
)));
options
[
n
].
optionString
=
(
char
*
)
"abort"
;
options
[
n
].
extraInfo
=
reinterpret_cast
<
void
*>
(
abort_handler
);
++
n
;
OString
sClassPathOption
;
for
(
int
i
=
0
;
i
<
cOptions
;
i
++
)
for
(
int
i
=
0
;
i
<
cOptions
;
i
++
)
{
{
OString
opt
(
arOptions
[
i
].
optionString
);
#ifdef UNX
#ifdef UNX
// Until java 1.5 we need to put a plugin.jar or javaplugin.jar (<1.4.2)
// Until java 1.5 we need to put a plugin.jar or javaplugin.jar (<1.4.2)
// in the class path in order to have applet support.
// in the class path in order to have applet support:
OString
sClassPath
=
arOptions
[
i
].
optionString
;
if
(
opt
.
startsWith
(
"-Djava.class.path="
))
if
(
sClassPath
.
startsWith
(
"-Djava.class.path="
))
{
{
OString
sAddPath
=
getPluginJarPath
(
pInfo
->
sVendor
,
pInfo
->
sLocation
,
pInfo
->
sVersion
);
OString
sAddPath
=
getPluginJarPath
(
pInfo
->
sVendor
,
pInfo
->
sLocation
,
pInfo
->
sVersion
);
if
(
!
sAddPath
.
isEmpty
())
if
(
!
sAddPath
.
isEmpty
())
sClassPathOption
=
sClassPath
+
OString
(
SAL_PATHSEPARATOR
)
opt
+=
OString
(
SAL_PATHSEPARATOR
)
+
sAddPath
;
+
sAddPath
;
else
sClassPathOption
=
sClassPath
;
options
[
n
].
optionString
=
(
char
*
)
sClassPathOption
.
getStr
();
options
[
n
].
extraInfo
=
arOptions
[
i
].
extraInfo
;
}
}
else
{
#endif
#endif
options
[
n
].
optionString
=
arOptions
[
i
].
optionString
;
if
(
opt
==
"-Xint"
)
{
options
[
n
].
extraInfo
=
arOptions
[
i
].
extraInfo
;
addForceInterpreted
=
false
;
#ifdef UNX
}
}
#endif
options
.
push_back
(
Option
(
opt
,
arOptions
[
i
].
extraInfo
));
#if OSL_DEBUG_LEVEL >= 2
JFW_TRACE2
(
"VM option: "
<<
options
[
n
].
optionString
);
#endif
++
n
;
}
}
if
(
forceInterpreted
)
{
if
(
addForceInterpreted
)
{
options
[
n
].
optionString
=
const_cast
<
char
*>
(
"-Xint"
);
options
.
push_back
(
Option
(
"-Xint"
,
nullptr
));
options
[
n
].
extraInfo
=
0
;
}
++
n
;
boost
::
scoped_array
<
JavaVMOption
>
sarOptions
(
new
JavaVMOption
[
options
.
size
()]);
for
(
std
::
vector
<
Option
>::
size_type
i
=
0
;
i
!=
options
.
size
();
++
i
)
{
SAL_INFO
(
"jfw"
,
"VM option
\"
"
<<
options
[
i
].
optionString
<<
"
\"
"
<<
options
[
i
].
extraInfo
);
sarOptions
[
i
].
optionString
=
const_cast
<
char
*>
(
options
[
i
].
optionString
.
getStr
());
sarOptions
[
i
].
extraInfo
=
options
[
i
].
extraInfo
;
}
}
#ifdef MACOSX
#ifdef MACOSX
...
@@ -716,8 +714,8 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
...
@@ -716,8 +714,8 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
#else
#else
vm_args
.
version
=
JNI_VERSION_1_2
;
vm_args
.
version
=
JNI_VERSION_1_2
;
#endif
#endif
vm_args
.
options
=
options
;
vm_args
.
options
=
sarOptions
.
get
()
;
vm_args
.
nOptions
=
nOptions
;
vm_args
.
nOptions
=
options
.
size
();
//TODO overflow
vm_args
.
ignoreUnrecognized
=
JNI_TRUE
;
vm_args
.
ignoreUnrecognized
=
JNI_TRUE
;
/* We set a global flag which is used by the abort handler in order to
/* We set a global flag which is used by the abort handler in order to
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment