Skip to content

Commit

Permalink
Simplify logic in LLVMAMD64ReadRegisterNode
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Mar 20, 2020
1 parent a618935 commit 88c9f31
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2019, Oracle and/or its affiliates.
* Copyright (c) 2017, 2020, Oracle and/or its affiliates.
*
* All rights reserved.
*
Expand Down Expand Up @@ -29,11 +29,9 @@
*/
package com.oracle.truffle.llvm.runtime.nodes.asm.support;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.dsl.NodeField;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.FrameSlot;
import com.oracle.truffle.api.frame.FrameSlotKind;
import com.oracle.truffle.api.frame.FrameSlotTypeException;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.llvm.runtime.nodes.api.LLVMExpressionNode;
Expand All @@ -49,12 +47,7 @@ protected long readI64(VirtualFrame frame) throws FrameSlotTypeException {

@Specialization(replaces = {"readI64"}, rewriteOn = FrameSlotTypeException.class)
protected Object readAddress(VirtualFrame frame) throws FrameSlotTypeException {
if (frame.getFrameDescriptor().getFrameSlotKind(getSlot()) == FrameSlotKind.Object) {
return frame.getObject(getSlot());
} else {
CompilerDirectives.transferToInterpreter();
throw new FrameSlotTypeException();
}
return frame.getObject(getSlot());
}

@Specialization(replaces = {"readI64", "readAddress"})
Expand Down

0 comments on commit 88c9f31

Please sign in to comment.