From e6a73c1eb58f868313a84959e443c3a451689290 Mon Sep 17 00:00:00 2001 From: "balazs.kilvady@imgtec.com" Date: Wed, 15 Oct 2014 17:14:17 +0000 Subject: [PATCH] MIPS: Implement inline %_IsJSProxy() for full codegen and Hydrogen. Port r24636 Original commit message: Saving a runtime call for many builtin functions. BUG= R=paul.lind@imgtec.com Review URL: https://codereview.chromium.org/661503002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24645 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/mips/full-codegen-mips.cc | 26 ++++++++++++++++++++++++++ src/mips64/full-codegen-mips64.cc | 26 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc index 82ce5e23e8..6f7166b97d 100644 --- a/src/mips/full-codegen-mips.cc +++ b/src/mips/full-codegen-mips.cc @@ -3417,6 +3417,32 @@ void FullCodeGenerator::EmitIsRegExp(CallRuntime* expr) { } +void FullCodeGenerator::EmitIsJSProxy(CallRuntime* expr) { + ZoneList* args = expr->arguments(); + DCHECK(args->length() == 1); + + VisitForAccumulatorValue(args->at(0)); + + Label materialize_true, materialize_false; + Label* if_true = NULL; + Label* if_false = NULL; + Label* fall_through = NULL; + context()->PrepareTest(&materialize_true, &materialize_false, &if_true, + &if_false, &fall_through); + + __ JumpIfSmi(v0, if_false); + Register map = a1; + Register type_reg = a2; + __ GetObjectType(v0, map, type_reg); + __ Subu(type_reg, type_reg, Operand(FIRST_JS_PROXY_TYPE)); + PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); + Split(ls, type_reg, Operand(LAST_JS_PROXY_TYPE - FIRST_JS_PROXY_TYPE), + if_true, if_false, fall_through); + + context()->Plug(if_true, if_false); +} + + void FullCodeGenerator::EmitIsConstructCall(CallRuntime* expr) { DCHECK(expr->arguments()->length() == 0); diff --git a/src/mips64/full-codegen-mips64.cc b/src/mips64/full-codegen-mips64.cc index 099e4313de..79eec06c40 100644 --- a/src/mips64/full-codegen-mips64.cc +++ b/src/mips64/full-codegen-mips64.cc @@ -3416,6 +3416,32 @@ void FullCodeGenerator::EmitIsRegExp(CallRuntime* expr) { } +void FullCodeGenerator::EmitIsJSProxy(CallRuntime* expr) { + ZoneList* args = expr->arguments(); + DCHECK(args->length() == 1); + + VisitForAccumulatorValue(args->at(0)); + + Label materialize_true, materialize_false; + Label* if_true = NULL; + Label* if_false = NULL; + Label* fall_through = NULL; + context()->PrepareTest(&materialize_true, &materialize_false, &if_true, + &if_false, &fall_through); + + __ JumpIfSmi(v0, if_false); + Register map = a1; + Register type_reg = a2; + __ GetObjectType(v0, map, type_reg); + __ Subu(type_reg, type_reg, Operand(FIRST_JS_PROXY_TYPE)); + PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); + Split(ls, type_reg, Operand(LAST_JS_PROXY_TYPE - FIRST_JS_PROXY_TYPE), + if_true, if_false, fall_through); + + context()->Plug(if_true, if_false); +} + + void FullCodeGenerator::EmitIsConstructCall(CallRuntime* expr) { DCHECK(expr->arguments()->length() == 0);