changed synchronized from extension method to normal one

This commit is contained in:
Alex Tkachman
2012-01-24 14:48:09 +02:00
parent e61a9f62ba
commit 8176487c93
5 changed files with 9 additions and 10 deletions
@@ -96,7 +96,7 @@ public class IntrinsicMethods {
declareOverload(myStdLib.getLibraryScope().getFunctions("plus"), 1, STRING_PLUS);
declareOverload(myStdLib.getLibraryScope().getFunctions("Array"), 1, new NewArray());
declareOverload(myStdLib.getLibraryScope().getFunctions("sure"), 0, new Sure());
declareOverload(myStdLib.getLibraryScope().getFunctions("synchronized"), 1, new StupidSync());
declareOverload(myStdLib.getLibraryScope().getFunctions("synchronized"), 2, new StupidSync());
declareOverload(myStdLib.getLibraryScope().getFunctions("iterator"), 0, new IteratorIterator());
declareIntrinsicFunction("ByteIterator", "next", 0, ITERATOR_NEXT);
@@ -17,8 +17,7 @@ import java.util.List;
public class StupidSync implements IntrinsicMethod {
@Override
public StackValue generate(ExpressionCodegen codegen, InstructionAdapter v, Type expectedType, @Nullable PsiElement element, @Nullable List<JetExpression> arguments, StackValue receiver) {
receiver.put(receiver.type, v);
codegen.pushMethodArguments((JetCallExpression)element, Arrays.asList(JetTypeMapper.TYPE_FUNCTION0));
codegen.pushMethodArguments((JetCallExpression)element, Arrays.asList(JetTypeMapper.TYPE_OBJECT, JetTypeMapper.TYPE_FUNCTION0));
v.invokestatic("jet/runtime/Intrinsics", "stupidSync", "(Ljava/lang/Object;Ljet/Function0;)Ljava/lang/Object;");
StackValue.onStack(JetTypeMapper.TYPE_OBJECT).put(expectedType, v);
return StackValue.onStack(expectedType);