< prev index next >

src/share/vm/utilities/xmlstream.cpp

Print this page
rev 7613 : imported patch vmassert
rev 7616 : [mq]: copyrights
   1 /*
   2  * Copyright (c) 2002, 2014, 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  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "code/nmethod.hpp"
  27 #include "memory/allocation.hpp"
  28 #include "memory/allocation.inline.hpp"
  29 #include "oops/methodData.hpp"
  30 #include "oops/method.hpp"
  31 #include "oops/oop.inline.hpp"
  32 #include "runtime/deoptimization.hpp"
  33 #include "runtime/vmThread.hpp"
  34 #include "utilities/xmlstream.hpp"




  35 
  36 void xmlStream::initialize(outputStream* out) {
  37   _out = out;
  38   _last_flush = 0;
  39   _markup_state = BODY;
  40   _text_init._outer_xmlStream = this;
  41   _text = &_text_init;
  42 
  43 #ifdef ASSERT
  44   _element_depth = 0;
  45   int   init_len = 100;
  46   char* init_buf = NEW_C_HEAP_ARRAY(char, init_len, mtInternal);
  47   _element_close_stack_low  = init_buf;
  48   _element_close_stack_high = init_buf + init_len;
  49   _element_close_stack_ptr  = init_buf + init_len - 1;
  50   _element_close_stack_ptr[0] = '\0';
  51 #endif
  52 
  53   // Make sure each log uses the same base for time stamps.
  54   if (is_open()) {


   1 /*
   2  * Copyright (c) 2002, 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  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "code/nmethod.hpp"
  27 #include "memory/allocation.hpp"
  28 #include "memory/allocation.inline.hpp"
  29 #include "oops/methodData.hpp"
  30 #include "oops/method.hpp"
  31 #include "oops/oop.inline.hpp"
  32 #include "runtime/deoptimization.hpp"
  33 #include "runtime/vmThread.hpp"
  34 #include "utilities/xmlstream.hpp"
  35 
  36 // Do not assert this condition if there's already another error reported.
  37 #define assert_if_no_error(cond, msg) \
  38   vmassert((cond) || is_error_reported(), msg)
  39 
  40 void xmlStream::initialize(outputStream* out) {
  41   _out = out;
  42   _last_flush = 0;
  43   _markup_state = BODY;
  44   _text_init._outer_xmlStream = this;
  45   _text = &_text_init;
  46 
  47 #ifdef ASSERT
  48   _element_depth = 0;
  49   int   init_len = 100;
  50   char* init_buf = NEW_C_HEAP_ARRAY(char, init_len, mtInternal);
  51   _element_close_stack_low  = init_buf;
  52   _element_close_stack_high = init_buf + init_len;
  53   _element_close_stack_ptr  = init_buf + init_len - 1;
  54   _element_close_stack_ptr[0] = '\0';
  55 #endif
  56 
  57   // Make sure each log uses the same base for time stamps.
  58   if (is_open()) {


< prev index next >