From 2ee54e249ad21c74f29a161e248bebe7d22fddf1 Mon Sep 17 00:00:00 2001 From: Igor Murashkin Date: Thu, 18 Jun 2015 10:05:11 -0700 Subject: runtime: Partially implement box-lambda and unbox-lambda experimental opcodes These opcodes are not yet fully specified, and *will* change before they become shippable. Do not write production code against experimental opcodes. -- Implement partial interpreter support for new dex instructions box/unbox-lambda. * box-lambda will take a closure and convert it into an Object * unbox-lambda will take an Object and convert it to a closure (Currently does not implement object identity or variable capture). All new opcodes are disabled by default, use runtime option -Xexperimental-lambdas to enable them. Change-Id: I3c15ccf8a26ccecd1d35808a8c1b4149220f6019 --- compiler/dex/quick/quick_compiler.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'compiler/dex/quick/quick_compiler.cc') diff --git a/compiler/dex/quick/quick_compiler.cc b/compiler/dex/quick/quick_compiler.cc index 97703a5ff1..2523a83c39 100644 --- a/compiler/dex/quick/quick_compiler.cc +++ b/compiler/dex/quick/quick_compiler.cc @@ -382,8 +382,8 @@ static int kAllOpcodes[] = { Instruction::UNUSED_F5, Instruction::CREATE_LAMBDA, Instruction::UNUSED_F7, - Instruction::UNUSED_F8, - Instruction::UNUSED_F9, + Instruction::BOX_LAMBDA, + Instruction::UNBOX_LAMBDA, Instruction::UNUSED_FA, Instruction::UNUSED_FB, Instruction::UNUSED_FC, @@ -425,6 +425,8 @@ static int kInvokeOpcodes[] = { static const int kUnsupportedLambdaOpcodes[] = { Instruction::INVOKE_LAMBDA, Instruction::CREATE_LAMBDA, + Instruction::BOX_LAMBDA, + Instruction::UNBOX_LAMBDA, }; // Unsupported opcodes. Null can be used when everything is supported. Size of the lists is -- cgit v1.2.3-59-g8ed1b