Index: src/x64/full-codegen-x64.cc |
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc |
index d4ed767ecad286cf2a0548f3e7b766cf6f5dbc8e..4817e502ebb7cd1edb06391b5e119f9ffe321c8c 100644 |
--- a/src/x64/full-codegen-x64.cc |
+++ b/src/x64/full-codegen-x64.cc |
@@ -3330,6 +3330,31 @@ void FullCodeGenerator::EmitIsRegExp(CallRuntime* expr) { |
} |
+void FullCodeGenerator::EmitIsJSProxy(CallRuntime* expr) { |
+ ZoneList<Expression*>* 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(rax, if_false); |
+ Register map = rbx; |
+ __ movp(map, FieldOperand(rax, HeapObject::kMapOffset)); |
+ __ CmpInstanceType(map, FIRST_JS_PROXY_TYPE); |
+ __ j(less, if_false); |
+ __ CmpInstanceType(map, LAST_JS_PROXY_TYPE); |
+ PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
+ Split(less_equal, if_true, if_false, fall_through); |
+ |
+ context()->Plug(if_true, if_false); |
+} |
+ |
void FullCodeGenerator::EmitIsConstructCall(CallRuntime* expr) { |
DCHECK(expr->arguments()->length() == 0); |