| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 4617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4628 HHasInstanceTypeAndBranch* typecheck = | 4628 HHasInstanceTypeAndBranch* typecheck = |
| 4629 new(zone()) HHasInstanceTypeAndBranch(return_value, | 4629 new(zone()) HHasInstanceTypeAndBranch(return_value, |
| 4630 FIRST_SPEC_OBJECT_TYPE, | 4630 FIRST_SPEC_OBJECT_TYPE, |
| 4631 LAST_SPEC_OBJECT_TYPE); | 4631 LAST_SPEC_OBJECT_TYPE); |
| 4632 HBasicBlock* if_spec_object = graph()->CreateBasicBlock(); | 4632 HBasicBlock* if_spec_object = graph()->CreateBasicBlock(); |
| 4633 HBasicBlock* not_spec_object = graph()->CreateBasicBlock(); | 4633 HBasicBlock* not_spec_object = graph()->CreateBasicBlock(); |
| 4634 typecheck->SetSuccessorAt(0, if_spec_object); | 4634 typecheck->SetSuccessorAt(0, if_spec_object); |
| 4635 typecheck->SetSuccessorAt(1, not_spec_object); | 4635 typecheck->SetSuccessorAt(1, not_spec_object); |
| 4636 current_block()->Finish(typecheck); | 4636 current_block()->Finish(typecheck); |
| 4637 if_spec_object->AddLeaveInlined(return_value, state); | 4637 if_spec_object->AddLeaveInlined(return_value, state); |
| 4638 not_spec_object->AddLeaveInlined(receiver, state); | 4638 if (!FLAG_harmony_symbols) { |
| 4639 not_spec_object->AddLeaveInlined(receiver, state); |
| 4640 } else { |
| 4641 HHasInstanceTypeAndBranch* symbolcheck = |
| 4642 new(zone()) HHasInstanceTypeAndBranch(return_value, SYMBOL_TYPE); |
| 4643 HBasicBlock* is_symbol = graph()->CreateBasicBlock(); |
| 4644 HBasicBlock* not_symbol = graph()->CreateBasicBlock(); |
| 4645 symbolcheck->SetSuccessorAt(0, is_symbol); |
| 4646 symbolcheck->SetSuccessorAt(1, not_symbol); |
| 4647 not_spec_object->Finish(symbolcheck); |
| 4648 is_symbol->AddLeaveInlined(return_value, state); |
| 4649 not_symbol->AddLeaveInlined(receiver, state); |
| 4650 } |
| 4639 } | 4651 } |
| 4640 } else if (state->inlining_kind() == SETTER_CALL_RETURN) { | 4652 } else if (state->inlining_kind() == SETTER_CALL_RETURN) { |
| 4641 // Return from an inlined setter call. The returned value is never used, the | 4653 // Return from an inlined setter call. The returned value is never used, the |
| 4642 // value of an assignment is always the value of the RHS of the assignment. | 4654 // value of an assignment is always the value of the RHS of the assignment. |
| 4643 CHECK_ALIVE(VisitForEffect(stmt->expression())); | 4655 CHECK_ALIVE(VisitForEffect(stmt->expression())); |
| 4644 if (context->IsTest()) { | 4656 if (context->IsTest()) { |
| 4645 HValue* rhs = environment()->arguments_environment()->Lookup(1); | 4657 HValue* rhs = environment()->arguments_environment()->Lookup(1); |
| 4646 context->ReturnValue(rhs); | 4658 context->ReturnValue(rhs); |
| 4647 } else if (context->IsEffect()) { | 4659 } else if (context->IsEffect()) { |
| 4648 current_block()->Goto(function_return(), state); | 4660 current_block()->Goto(function_return(), state); |
| (...skipping 4832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9481 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 9493 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 9482 HValue* value = Pop(); | 9494 HValue* value = Pop(); |
| 9483 HHasInstanceTypeAndBranch* result = | 9495 HHasInstanceTypeAndBranch* result = |
| 9484 new(zone()) HHasInstanceTypeAndBranch(value, | 9496 new(zone()) HHasInstanceTypeAndBranch(value, |
| 9485 FIRST_SPEC_OBJECT_TYPE, | 9497 FIRST_SPEC_OBJECT_TYPE, |
| 9486 LAST_SPEC_OBJECT_TYPE); | 9498 LAST_SPEC_OBJECT_TYPE); |
| 9487 return ast_context()->ReturnControl(result, call->id()); | 9499 return ast_context()->ReturnControl(result, call->id()); |
| 9488 } | 9500 } |
| 9489 | 9501 |
| 9490 | 9502 |
| 9503 void HOptimizedGraphBuilder::GenerateIsSymbol(CallRuntime* call) { |
| 9504 ASSERT(call->arguments()->length() == 1); |
| 9505 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 9506 HValue* value = Pop(); |
| 9507 HHasInstanceTypeAndBranch* result = |
| 9508 new(zone()) HHasInstanceTypeAndBranch(value, SYMBOL_TYPE); |
| 9509 return ast_context()->ReturnControl(result, call->id()); |
| 9510 } |
| 9511 |
| 9512 |
| 9491 void HOptimizedGraphBuilder::GenerateIsFunction(CallRuntime* call) { | 9513 void HOptimizedGraphBuilder::GenerateIsFunction(CallRuntime* call) { |
| 9492 ASSERT(call->arguments()->length() == 1); | 9514 ASSERT(call->arguments()->length() == 1); |
| 9493 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 9515 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 9494 HValue* value = Pop(); | 9516 HValue* value = Pop(); |
| 9495 HHasInstanceTypeAndBranch* result = | 9517 HHasInstanceTypeAndBranch* result = |
| 9496 new(zone()) HHasInstanceTypeAndBranch(value, JS_FUNCTION_TYPE); | 9518 new(zone()) HHasInstanceTypeAndBranch(value, JS_FUNCTION_TYPE); |
| 9497 return ast_context()->ReturnControl(result, call->id()); | 9519 return ast_context()->ReturnControl(result, call->id()); |
| 9498 } | 9520 } |
| 9499 | 9521 |
| 9500 | 9522 |
| (...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10623 } | 10645 } |
| 10624 } | 10646 } |
| 10625 | 10647 |
| 10626 #ifdef DEBUG | 10648 #ifdef DEBUG |
| 10627 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 10649 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
| 10628 if (allocator_ != NULL) allocator_->Verify(); | 10650 if (allocator_ != NULL) allocator_->Verify(); |
| 10629 #endif | 10651 #endif |
| 10630 } | 10652 } |
| 10631 | 10653 |
| 10632 } } // namespace v8::internal | 10654 } } // namespace v8::internal |
| OLD | NEW |