Commit 97621e7e authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

ARM: Implement lithium codegen for DoTypeof, DoTypeofIs and DoSmiUntag

Review URL: http://codereview.chromium.org/6174001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6227 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ba4f9fae
......@@ -1877,7 +1877,7 @@ LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) {
LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) {
LInstruction* result = new LTypeof(Use(instr->value()));
LInstruction* result = new LTypeof(UseRegisterAtStart(instr->value()));
return MarkAsCall(DefineFixed(result, r0), instr);
}
......
......@@ -2087,7 +2087,13 @@ void LCodeGen::DoSmiTag(LSmiTag* instr) {
void LCodeGen::DoSmiUntag(LSmiUntag* instr) {
Abort("DoSmiUntag unimplemented.");
LOperand* input = instr->input();
ASSERT(input->IsRegister() && input->Equals(instr->result()));
if (instr->needs_check()) {
__ tst(ToRegister(input), Operand(kSmiTagMask));
DeoptimizeIf(ne, instr->environment());
}
__ SmiUntag(ToRegister(input));
}
......@@ -2461,12 +2467,27 @@ void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) {
void LCodeGen::DoTypeof(LTypeof* instr) {
Abort("DoTypeof unimplemented.");
Register input = ToRegister(instr->input());
__ push(input);
CallRuntime(Runtime::kTypeof, 1, instr);
}
void LCodeGen::DoTypeofIs(LTypeofIs* instr) {
Abort("DoTypeofIs unimplemented.");
Register input = ToRegister(instr->input());
Register result = ToRegister(instr->result());
Label true_label;
Label false_label;
Label done;
Condition final_branch_condition = EmitTypeofIs(&true_label,
&false_label,
input,
instr->type_literal());
__ LoadRoot(result, Heap::kTrueValueRootIndex, final_branch_condition);
__ LoadRoot(result, Heap::kFalseValueRootIndex,
NegateCondition(final_branch_condition));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment