Skip to content
Permalink
Browse files
Merge branch 'master' into truffle-head
  • Loading branch information
chrisseaton committed Dec 23, 2014
2 parents 8f74f30 + 4b3b272 commit 03a8a55113291be13e4f3284a6d67bed9e32d291
Showing 271 changed files with 4,522 additions and 1,543 deletions.
@@ -98,6 +98,3 @@ core/.classpath
core/.gitignore
core/.project
core/.settings

# Truffle benchmark stuff
reference.txt
@@ -37,6 +37,7 @@ env:
- PHASE='-Prake -Dtask=spec:profiler'
- PHASE='-Ptruffle-specs-language'
- PHASE='-Ptruffle-specs-core'
- PHASE='-Ptruffle-specs-rubysl'

matrix:
include:
@@ -66,6 +67,7 @@ matrix:
- env: PHASE='-Pcomplete'
- env: PHASE='-Prake -Dtask=spec:jrubyc'
- env: PHASE='-Prake -Dtask=spec:profiler'
- env: PHASE='-Ptruffle-specs-rubysl'

branches:
only:
@@ -583,4 +583,9 @@ public T visitZSuperNode(ZSuperNode node) {
return defaultVisit(node);
}

@Override
public T visitOther(Node node) {
return defaultVisit(node);
}

}
@@ -146,4 +146,5 @@
public T visitYieldNode(YieldNode iVisited);
public T visitZArrayNode(ZArrayNode iVisited);
public T visitZSuperNode(ZSuperNode iVisited);
public T visitOther(Node iVisited);
}
@@ -987,7 +987,7 @@ public Operand buildCall(CallNode callNode, IRScope s) {
List<Operand> args = setupCallArgs(callArgsNode, s);
Operand block = setupCallClosure(callNode.getIterNode(), s);
Variable callResult = s.createTemporaryVariable();
CallInstr callInstr = CallInstr.create(callResult, callNode.getName(), receiver, args.toArray(new Operand[args.size()]), block);
CallInstr callInstr = (CallInstr)CallInstr.create(callResult, callNode.getName(), receiver, args.toArray(new Operand[args.size()]), block).specializeForInterpretation();

// This is to support the ugly Proc.new with no block, which must see caller's frame
if (
@@ -2204,7 +2204,7 @@ public Operand buildFCall(FCallNode fcallNode, IRScope s) {
List<Operand> args = setupCallArgs(callArgsNode, s);
Operand block = setupCallClosure(fcallNode.getIterNode(), s);
Variable callResult = s.createTemporaryVariable();
CallInstr callInstr = CallInstr.create(CallType.FUNCTIONAL, callResult, fcallNode.getName(), s.getSelf(), args.toArray(new Operand[args.size()]), block);
CallInstr callInstr = (CallInstr)CallInstr.create(CallType.FUNCTIONAL, callResult, fcallNode.getName(), s.getSelf(), args.toArray(new Operand[args.size()]), block).specializeForInterpretation();
receiveBreakException(s, block, callInstr);
return callResult;
}
@@ -2917,8 +2917,8 @@ public Operand buildPostExe(PostExeNode postExeNode, IRScope s) {
closureBuilder.addInstr(endClosure, new CopyInstr(endClosure.getCurrentModuleVariable(), new ScopeModule(0)));
closureBuilder.build(postExeNode.getBodyNode(), endClosure);

// Record to IRScope so JIT can pre-compile all potentially activated END blocks.
topLevel.recordEndBlock(endClosure);
// END does not have either explicit or implicit return, so we add one
closureBuilder.addInstr(endClosure, new ReturnInstr(new Nil()));

// Add an instruction in 's' to record the end block in the 'topLevel' scope.
// SSS FIXME: IR support for end-blocks that access vars in non-toplevel-scopes
@@ -2939,6 +2939,9 @@ public Operand buildPreExe(PreExeNode preExeNode, IRScope s) {
closureBuilder.addInstr(beginClosure, new CopyInstr(beginClosure.getCurrentModuleVariable(), new ScopeModule(0)));
closureBuilder.build(preExeNode.getBodyNode(), beginClosure);

// BEGIN does not have either explicit or implicit return, so we add one
closureBuilder.addInstr(beginClosure, new ReturnInstr(new Nil()));

// Record the begin block at IR build time
s.getTopLevelScope().recordBeginBlock(beginClosure);
return manager.getNil();
@@ -3378,7 +3381,7 @@ public Operand buildVAlias(VAliasNode valiasNode, IRScope s) {

public Operand buildVCall(VCallNode node, IRScope s) {
Variable callResult = s.createTemporaryVariable();
Instr callInstr = CallInstr.create(CallType.VARIABLE, callResult, node.getName(), s.getSelf(), NO_ARGS, null);
Instr callInstr = CallInstr.create(CallType.VARIABLE, callResult, node.getName(), s.getSelf(), NO_ARGS, null).specializeForInterpretation();
addInstr(s, callInstr);
return callResult;
}
@@ -13,7 +13,6 @@

public class IREvalScript extends IRClosure {
private List<IRClosure> beginBlocks;
private List<IRClosure> endBlocks;
private EvalType evalType;

public IREvalScript(IRManager manager, IRScope lexicalParent, String fileName,
@@ -68,22 +67,10 @@ public void recordBeginBlock(IRClosure beginBlockClosure) {
beginBlocks.add(beginBlockClosure);
}

/* Record an end block -- not all scope implementations can handle them */
@Override
public void recordEndBlock(IRClosure endBlockClosure) {
if (endBlocks == null) endBlocks = new ArrayList<>();
endBlockClosure.setBeginEndBlock();
endBlocks.add(endBlockClosure);
}

public List<IRClosure> getBeginBlocks() {
return beginBlocks;
}

public List<IRClosure> getEndBlocks() {
return endBlocks;
}

@Override
public LocalVariable getNewFlipStateVariable() {
String flipVarName = "%flip_" + allocateNextPrefixedName("%flip");
@@ -101,4 +88,4 @@ public boolean isScriptScope() {
public boolean isFlipScope() {
return true;
}
}
}