/* * Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. *
*/
private: bool _modified[number_of_flags]; // Records what options where set by a directive public: #define flag_store_definition(name, type, dvalue, cc_flag) type name##Option;
compilerdirectives_common_flags(flag_store_definition)
compilerdirectives_c2_flags(flag_store_definition)
compilerdirectives_c1_flags(flag_store_definition)
// Casting to get the same function signature for all setters. Used from parser. #define set_function_definition(name, type, dvalue, cc_flag) void set_##name(void* value) { type val = *(type*)value; name##Option = val; _modified[name##Index] = true; }
compilerdirectives_common_flags(set_function_definition)
compilerdirectives_c2_flags(set_function_definition)
compilerdirectives_c1_flags(set_function_definition)
// Iterator of ControlIntrinsic=+_id1,-_id2,+_id3,... // // If disable_all is set, it accepts DisableIntrinsic and all intrinsic Ids // appear in the list are disabled. Arguments don't have +/- prefix. eg. // DisableIntrinsic=_id1,_id2,_id3,... class ControlIntrinsicIter { private: bool _enabled; char* _token; char* _saved_ptr; char* _list; constbool _disableIntrinsic; void next_token();
class ControlIntrinsicValidator { private: bool _valid; char* _bad;
public:
ControlIntrinsicValidator(ccstrlist option, bool disable_all) : _valid(true), _bad(nullptr) { for (ControlIntrinsicIter iter(option, disable_all); *iter != NULL && _valid; ++iter) { if (vmIntrinsics::_none == vmIntrinsics::find_id(*iter)) { const size_t len = MIN2<size_t>(strlen(*iter), 63) + 1; // cap len to a value we know is enough for all intrinsic names
_bad = NEW_C_HEAP_ARRAY(char, len, mtCompiler); // strncpy always writes len characters. If the source string is shorter, the function fills the remaining bytes with NULLs.
strncpy(_bad, *iter, len);
_valid = false;
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.