src/hotspot/share/code/oopRecorder.cpp
changeset 48831 05894c073b7e
parent 47216 71c04702a3d5
child 49192 6734eeef4283
equal deleted inserted replaced
48830:11920d5d14a8 48831:05894c073b7e
     1 /*
     1 /*
     2  * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   170     _values.sort(sort_by_address);
   170     _values.sort(sort_by_address);
   171   }
   171   }
   172 }
   172 }
   173 
   173 
   174 int ObjectLookup::sort_by_address(oop a, oop b) {
   174 int ObjectLookup::sort_by_address(oop a, oop b) {
   175   if (b > a) return 1;
   175   // oopDesc::compare returns the opposite of what this function returned
   176   if (a > b) return -1;
   176   return -(oopDesc::compare(a, b));
   177   return 0;
       
   178 }
   177 }
   179 
   178 
   180 int ObjectLookup::sort_by_address(ObjectEntry* a, ObjectEntry* b) {
   179 int ObjectLookup::sort_by_address(ObjectEntry* a, ObjectEntry* b) {
   181   return sort_by_address(a->oop_value(), b->oop_value());
   180   return sort_by_address(a->oop_value(), b->oop_value());
   182 }
   181 }