Index: src/ia32/full-codegen-ia32.cc |
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc |
index c554248cf4b45e9636178eae9e60c5ed265721d7..8a216ffc70b1e3b68965297d45fcb48872784c94 100644 |
--- a/src/ia32/full-codegen-ia32.cc |
+++ b/src/ia32/full-codegen-ia32.cc |
@@ -2549,6 +2549,7 @@ void FullCodeGenerator::EmitIsObject(CallRuntime* expr) { |
void FullCodeGenerator::EmitIsSpecObject(CallRuntime* expr) { |
+ // TODO(rossberg): incorporate symbols. |
ZoneList<Expression*>* args = expr->arguments(); |
ASSERT(args->length() == 1); |
@@ -2684,6 +2685,28 @@ void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf( |
} |
+void FullCodeGenerator::EmitIsSymbol(CallRuntime* expr) { |
+ ZoneList<Expression*>* args = expr->arguments(); |
+ ASSERT(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(eax, if_false); |
+ __ CmpObjectType(eax, SYMBOL_TYPE, ebx); |
+ PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
+ Split(equal, if_true, if_false, fall_through); |
+ |
+ context()->Plug(if_true, if_false); |
+} |
+ |
+ |
void FullCodeGenerator::EmitIsFunction(CallRuntime* expr) { |
ZoneList<Expression*>* args = expr->arguments(); |
ASSERT(args->length() == 1); |
@@ -4263,6 +4286,10 @@ void FullCodeGenerator::EmitLiteralCompareTypeof(Expression* expr, |
__ cmp(eax, isolate()->factory()->null_value()); |
__ j(equal, if_true); |
} |
+ if (FLAG_harmony_symbols) { |
+ __ CmpObjectType(eax, SYMBOL_TYPE, edx); |
+ __ j(equal, if_true); |
+ } |
__ CmpObjectType(eax, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, edx); |
__ j(below, if_false); |
__ CmpInstanceType(edx, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |