1 /*
2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
344
345 #ifdef SPARC
346 if (InteriorEntryAlignment % relocInfo::addr_unit() != 0) {
347 CommandLineError::print(verbose,
348 "InteriorEntryAlignment (" INTX_FORMAT ") must be "
349 "multiple of NOP size\n");
350 return Flag::VIOLATES_CONSTRAINT;
351 }
352 #endif
353
354 if (!is_power_of_2(value)) {
355 CommandLineError::print(verbose,
356 "InteriorEntryAlignment (" INTX_FORMAT ") must be "
357 "a power of two\n", InteriorEntryAlignment);
358 return Flag::VIOLATES_CONSTRAINT;
359 }
360
361 int minimum_alignment = 16;
362 #if defined(SPARC) || (defined(X86) && !defined(AMD64))
363 minimum_alignment = 4;
364 #endif
365
366 if (InteriorEntryAlignment < minimum_alignment) {
367 CommandLineError::print(verbose,
368 "InteriorEntryAlignment (" INTX_FORMAT ") must be "
369 "greater than or equal to %d\n",
370 InteriorEntryAlignment, minimum_alignment);
371 return Flag::VIOLATES_CONSTRAINT;
372 }
373
374 return Flag::SUCCESS;
375 }
376
377 Flag::Error NodeLimitFudgeFactorConstraintFunc(intx value, bool verbose) {
378 if (value < MaxNodeLimit * 2 / 100 || value > MaxNodeLimit * 40 / 100) {
379 CommandLineError::print(verbose,
380 "NodeLimitFudgeFactor must be between 2%% and 40%% "
381 "of MaxNodeLimit (" INTX_FORMAT ")\n",
382 MaxNodeLimit);
383 return Flag::VIOLATES_CONSTRAINT;
|
1 /*
2 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
344
345 #ifdef SPARC
346 if (InteriorEntryAlignment % relocInfo::addr_unit() != 0) {
347 CommandLineError::print(verbose,
348 "InteriorEntryAlignment (" INTX_FORMAT ") must be "
349 "multiple of NOP size\n");
350 return Flag::VIOLATES_CONSTRAINT;
351 }
352 #endif
353
354 if (!is_power_of_2(value)) {
355 CommandLineError::print(verbose,
356 "InteriorEntryAlignment (" INTX_FORMAT ") must be "
357 "a power of two\n", InteriorEntryAlignment);
358 return Flag::VIOLATES_CONSTRAINT;
359 }
360
361 int minimum_alignment = 16;
362 #if defined(SPARC) || (defined(X86) && !defined(AMD64))
363 minimum_alignment = 4;
364 #elif defined(S390)
365 minimum_alignment = 2;
366 #endif
367
368 if (InteriorEntryAlignment < minimum_alignment) {
369 CommandLineError::print(verbose,
370 "InteriorEntryAlignment (" INTX_FORMAT ") must be "
371 "greater than or equal to %d\n",
372 InteriorEntryAlignment, minimum_alignment);
373 return Flag::VIOLATES_CONSTRAINT;
374 }
375
376 return Flag::SUCCESS;
377 }
378
379 Flag::Error NodeLimitFudgeFactorConstraintFunc(intx value, bool verbose) {
380 if (value < MaxNodeLimit * 2 / 100 || value > MaxNodeLimit * 40 / 100) {
381 CommandLineError::print(verbose,
382 "NodeLimitFudgeFactor must be between 2%% and 40%% "
383 "of MaxNodeLimit (" INTX_FORMAT ")\n",
384 MaxNodeLimit);
385 return Flag::VIOLATES_CONSTRAINT;
|