< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java

Print this page


   1 /*
   2  * Copyright (c) 2012, 2018, 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  */


 658         }
 659         throw GraalError.shouldNotReachHere("BenchmarkCounters are not enabled!");
 660     }
 661 
 662     @Override
 663     public LIRInstruction createMultiBenchmarkCounter(String[] names, String[] groups, Value[] increments) {
 664         if (BenchmarkCounters.enabled) {
 665             return new AMD64HotSpotCounterOp(names, groups, increments, getProviders().getRegisters(), config, getOrInitRescueSlot());
 666         }
 667         throw GraalError.shouldNotReachHere("BenchmarkCounters are not enabled!");
 668     }
 669 
 670     @Override
 671     public void emitPrefetchAllocate(Value address) {
 672         append(new AMD64PrefetchOp(asAddressValue(address), config.allocatePrefetchInstr));
 673     }
 674 
 675     @Override
 676     protected StrategySwitchOp createStrategySwitchOp(SwitchStrategy strategy, LabelRef[] keyTargets, LabelRef defaultTarget, Variable key, AllocatableValue temp) {
 677         return new AMD64HotSpotStrategySwitchOp(strategy, keyTargets, defaultTarget, key, temp);




























 678     }
 679 }
   1 /*
   2  * Copyright (c) 2012, 2019, 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  */


 658         }
 659         throw GraalError.shouldNotReachHere("BenchmarkCounters are not enabled!");
 660     }
 661 
 662     @Override
 663     public LIRInstruction createMultiBenchmarkCounter(String[] names, String[] groups, Value[] increments) {
 664         if (BenchmarkCounters.enabled) {
 665             return new AMD64HotSpotCounterOp(names, groups, increments, getProviders().getRegisters(), config, getOrInitRescueSlot());
 666         }
 667         throw GraalError.shouldNotReachHere("BenchmarkCounters are not enabled!");
 668     }
 669 
 670     @Override
 671     public void emitPrefetchAllocate(Value address) {
 672         append(new AMD64PrefetchOp(asAddressValue(address), config.allocatePrefetchInstr));
 673     }
 674 
 675     @Override
 676     protected StrategySwitchOp createStrategySwitchOp(SwitchStrategy strategy, LabelRef[] keyTargets, LabelRef defaultTarget, Variable key, AllocatableValue temp) {
 677         return new AMD64HotSpotStrategySwitchOp(strategy, keyTargets, defaultTarget, key, temp);
 678     }
 679 
 680     @Override
 681     public ForeignCallLinkage lookupArrayEqualsStub(JavaKind kind, int constantLength) {
 682         if (constantLength >= 0 && constantLength * kind.getByteCount() < 2 * getMaxVectorSize()) {
 683             // Yield constant-length arrays comparison assembly
 684             return null;
 685         }
 686         switch (kind) {
 687             case Boolean:
 688                 return getForeignCalls().lookupForeignCall(AMD64ArrayEqualsStub.STUB_BOOLEAN_ARRAY_EQUALS);
 689             case Byte:
 690                 return getForeignCalls().lookupForeignCall(AMD64ArrayEqualsStub.STUB_BYTE_ARRAY_EQUALS);
 691             case Char:
 692                 return getForeignCalls().lookupForeignCall(AMD64ArrayEqualsStub.STUB_CHAR_ARRAY_EQUALS);
 693             case Short:
 694                 return getForeignCalls().lookupForeignCall(AMD64ArrayEqualsStub.STUB_SHORT_ARRAY_EQUALS);
 695             case Int:
 696                 return getForeignCalls().lookupForeignCall(AMD64ArrayEqualsStub.STUB_INT_ARRAY_EQUALS);
 697             case Long:
 698                 return getForeignCalls().lookupForeignCall(AMD64ArrayEqualsStub.STUB_LONG_ARRAY_EQUALS);
 699             case Float:
 700                 return getForeignCalls().lookupForeignCall(AMD64ArrayEqualsStub.STUB_FLOAT_ARRAY_EQUALS);
 701             case Double:
 702                 return getForeignCalls().lookupForeignCall(AMD64ArrayEqualsStub.STUB_DOUBLE_ARRAY_EQUALS);
 703             default:
 704                 return null;
 705         }
 706     }
 707 }
< prev index next >