[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-zero-dev
Subject:    Zero ICache fixes
From:       gbenson () redhat ! com (Gary Benson)
Date:       2009-09-04 9:54:35
Message-ID: 20090904095435.GA3312 () redhat ! com
[Download RAW message or body]

Hi all,

This commit rearranges the instruction cache code in Zero to
remove a conditional that the HotSpot engineers didn't like.

Cheers,
Gary

-- 
http://gbenson.net/
-------------- next part --------------
diff -r cc4f8460a676 ChangeLog
--- a/ChangeLog	Thu Sep 03 11:23:31 2009 -0400
+++ b/ChangeLog	Fri Sep 04 05:43:02 2009 -0400
@@ -1,3 +1,16 @@
+2009-09-04  Gary Benson  <gbenson at redhat.com>
+
+	* ports/hotspot/src/cpu/zero/vm/icache_zero.hpp
+	(ICache::initialize): New method.
+	(ICache::invalidate_word): Likewise.
+	(ICache::invalidate_range): Likewise.
+
+	* ports/hotspot/src/cpu/zero/vm/icache_zero.cpp
+	(ICacheStubGenerator::generate_icache_flush): Replaced with stub.
+
+	* patches/icedtea-zero.patch
+	(AbstractICache::invalidate_range): Removed #ifdef ZERO.
+
 2009-09-03  Gary Benson  <gbenson at redhat.com>
 
 	* ports/hotspot/src/cpu/zero/vm/assembler_zero.cpp: Reformatted
diff -r cc4f8460a676 patches/icedtea-zero.patch
--- a/patches/icedtea-zero.patch	Thu Sep 03 11:23:31 2009 -0400
+++ b/patches/icedtea-zero.patch	Fri Sep 04 05:43:02 2009 -0400
@@ -100,24 +100,6 @@
    tty->print_cr("self_link: " INTPTR_FORMAT, (uintptr_t) this->_self_link);
  }
  
---- openjdk/hotspot/src/share/vm/runtime/icache.cpp.orig	2008-07-27 08:37:02.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/runtime/icache.cpp	2008-07-27 08:38:13.000000000 +0000
-@@ -78,6 +78,7 @@
- }
- 
- void AbstractICache::invalidate_range(address start, int nbytes) {
-+#ifndef ZERO
-   static bool firstTime = true;
-   if (firstTime) {
-     guarantee(start == CAST_FROM_FN_PTR(address, _flush_icache_stub),
-@@ -97,6 +98,7 @@
-   }
-   call_flush_stub(start, round_to(nbytes, ICache::line_size) >>
- 		         ICache::log2_line_size);
-+#endif
- }
- 
- // For init.cpp
 --- openjdk/hotspot/src/share/vm/runtime/mutex.hpp.orig	2008-07-27 08:37:02.000000000 +0000
 +++ openjdk/hotspot/src/share/vm/runtime/mutex.hpp	2008-07-27 08:38:13.000000000 +0000
 @@ -61,18 +61,10 @@
diff -r cc4f8460a676 ports/hotspot/src/cpu/zero/vm/icache_zero.cpp
--- a/ports/hotspot/src/cpu/zero/vm/icache_zero.cpp	Thu Sep 03 11:23:31 2009 -0400
+++ b/ports/hotspot/src/cpu/zero/vm/icache_zero.cpp	Fri Sep 04 05:43:02 2009 -0400
@@ -1,6 +1,6 @@
 /*
  * Copyright 2003-2005 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2007 Red Hat, Inc.
+ * Copyright 2007, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,11 +26,7 @@
 #include "incls/_precompiled.incl"
 #include "incls/_icache_zero.cpp.incl"
 
-
 void ICacheStubGenerator::generate_icache_flush(
   ICache::flush_icache_stub_t* flush_icache_stub) {
-
-  StubCodeMark mark(this, "ICache", "flush_icache_stub");
-
-  *flush_icache_stub = (ICache::flush_icache_stub_t) UnimplementedStub();
+  Unimplemented();
 }
diff -r cc4f8460a676 ports/hotspot/src/cpu/zero/vm/icache_zero.hpp
--- a/ports/hotspot/src/cpu/zero/vm/icache_zero.hpp	Thu Sep 03 11:23:31 2009 -0400
+++ b/ports/hotspot/src/cpu/zero/vm/icache_zero.hpp	Fri Sep 04 05:43:02 2009 -0400
@@ -1,6 +1,6 @@
 /*
  * Copyright 2003-2004 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2007 Red Hat, Inc.
+ * Copyright 2007, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,12 @@
 
 // Interface for updating the instruction cache.  Whenever the VM
 // modifies code, part of the processor instruction cache potentially
-// has to be flushed.
+// has to be flushed.  This implementation is empty: Zero never deals
+// with code, and LLVM handles cache flushing for Shark.
 
 class ICache : public AbstractICache {
-  // Use default implementation
+ public:
+  static void initialize() {}
+  static void invalidate_word(address addr) {}
+  static void invalidate_range(address start, int nbytes) {}
 };

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic