Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 00c8e1b590f958c2fbfce050175b565e0ba9af1b..cd536885ae03898c86cf165ffde57e34b7bcb19c 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -4635,7 +4635,19 @@ void HOptimizedGraphBuilder::VisitReturnStatement(ReturnStatement* stmt) { |
typecheck->SetSuccessorAt(1, not_spec_object); |
current_block()->Finish(typecheck); |
if_spec_object->AddLeaveInlined(return_value, state); |
- not_spec_object->AddLeaveInlined(receiver, state); |
+ if (!FLAG_harmony_symbols) { |
+ not_spec_object->AddLeaveInlined(receiver, state); |
+ } else { |
+ HHasInstanceTypeAndBranch* symbolcheck = |
+ new(zone()) HHasInstanceTypeAndBranch(return_value, SYMBOL_TYPE); |
+ HBasicBlock* is_symbol = graph()->CreateBasicBlock(); |
+ HBasicBlock* not_symbol = graph()->CreateBasicBlock(); |
+ symbolcheck->SetSuccessorAt(0, is_symbol); |
+ symbolcheck->SetSuccessorAt(1, not_symbol); |
+ not_spec_object->Finish(symbolcheck); |
+ is_symbol->AddLeaveInlined(return_value, state); |
+ not_symbol->AddLeaveInlined(receiver, state); |
+ } |
} |
} else if (state->inlining_kind() == SETTER_CALL_RETURN) { |
// Return from an inlined setter call. The returned value is never used, the |
@@ -9488,6 +9500,16 @@ void HOptimizedGraphBuilder::GenerateIsSpecObject(CallRuntime* call) { |
} |
+void HOptimizedGraphBuilder::GenerateIsSymbol(CallRuntime* call) { |
+ ASSERT(call->arguments()->length() == 1); |
+ CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
+ HValue* value = Pop(); |
+ HHasInstanceTypeAndBranch* result = |
+ new(zone()) HHasInstanceTypeAndBranch(value, SYMBOL_TYPE); |
+ return ast_context()->ReturnControl(result, call->id()); |
+} |
+ |
+ |
void HOptimizedGraphBuilder::GenerateIsFunction(CallRuntime* call) { |
ASSERT(call->arguments()->length() == 1); |
CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |