changeset 8672:e4e58811ed1b

8187629: NMT: Memory miscounting in compiler (C2) Summary: Fixed memory counting in compiler (C2) Reviewed-by: adinn, cjplummer, kvn
author zgu
date Tue, 28 Nov 2017 11:34:15 -0500
parents db49d511817a
children 940519c00887
files src/share/vm/memory/resourceArea.hpp src/share/vm/opto/chaitin.cpp src/share/vm/opto/matcher.cpp
diffstat 3 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/memory/resourceArea.hpp	Mon Jul 24 15:19:46 2017 -0400
+++ b/src/share/vm/memory/resourceArea.hpp	Tue Nov 28 11:34:15 2017 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -49,11 +49,11 @@
   debug_only(static int _warned;)       // to suppress multiple warnings
 
 public:
-  ResourceArea() : Arena(mtThread) {
+  ResourceArea(MEMFLAGS flags = mtThread) : Arena(flags) {
     debug_only(_nesting = 0;)
   }
 
-  ResourceArea(size_t init_size) : Arena(mtThread, init_size) {
+  ResourceArea(size_t init_size, MEMFLAGS flags = mtThread) : Arena(flags, init_size) {
     debug_only(_nesting = 0;);
   }
 
--- a/src/share/vm/opto/chaitin.cpp	Mon Jul 24 15:19:46 2017 -0400
+++ b/src/share/vm/opto/chaitin.cpp	Tue Nov 28 11:34:15 2017 -0500
@@ -338,8 +338,8 @@
   _alternate = 0;
   _matcher._allocation_started = true;
 
-  ResourceArea split_arena;     // Arena for Split local resources
-  ResourceArea live_arena;      // Arena for liveness & IFG info
+  ResourceArea split_arena(mtCompiler);     // Arena for Split local resources
+  ResourceArea live_arena(mtCompiler);      // Arena for liveness & IFG info
   ResourceMark rm(&live_arena);
 
   // Need live-ness for the IFG; need the IFG for coalescing.  If the
--- a/src/share/vm/opto/matcher.cpp	Mon Jul 24 15:19:46 2017 -0400
+++ b/src/share/vm/opto/matcher.cpp	Tue Nov 28 11:34:15 2017 -0500
@@ -79,7 +79,7 @@
   _register_save_type(register_save_type),
   _ruleName(ruleName),
   _allocation_started(false),
-  _states_arena(Chunk::medium_size),
+  _states_arena(Chunk::medium_size, mtCompiler),
   _visited(&_states_arena),
   _shared(&_states_arena),
   _dontcare(&_states_arena) {