From 4ed87548d07a4010424e48773c97fae42073a2f5 Mon Sep 17 00:00:00 2001 From: zgu Date: Tue, 28 Nov 2017 11:34:15 -0500 Subject: [PATCH] 8187629: NMT: Memory miscounting in compiler (C2) Summary: Fixed memory counting in compiler (C2) Reviewed-by: adinn, cjplummer, kvn --- src/share/vm/memory/resourceArea.hpp | 6 +++--- src/share/vm/opto/chaitin.cpp | 4 ++-- src/share/vm/opto/matcher.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/share/vm/memory/resourceArea.hpp b/src/share/vm/memory/resourceArea.hpp index 567b5fc3a..d0f2db649 100644 --- a/src/share/vm/memory/resourceArea.hpp +++ b/src/share/vm/memory/resourceArea.hpp @@ -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 @@ class ResourceArea: public Arena { 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;); } diff --git a/src/share/vm/opto/chaitin.cpp b/src/share/vm/opto/chaitin.cpp index 59306506b..29a0a3936 100644 --- a/src/share/vm/opto/chaitin.cpp +++ b/src/share/vm/opto/chaitin.cpp @@ -338,8 +338,8 @@ void PhaseChaitin::Register_Allocate() { _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 diff --git a/src/share/vm/opto/matcher.cpp b/src/share/vm/opto/matcher.cpp index d6ee92f48..47a2227ee 100644 --- a/src/share/vm/opto/matcher.cpp +++ b/src/share/vm/opto/matcher.cpp @@ -79,7 +79,7 @@ Matcher::Matcher() _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) { -- GitLab