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 HHasInstanceTypeAndBranch* symbolcheck = |
Michael Starzinger
2013/02/26 20:41:49
For the inlining in Crankshaft we only need this p
rossberg
2013/02/27 13:12:23
Done.
| |
4639 new(zone()) HHasInstanceTypeAndBranch(return_value, SYMBOL_TYPE); | |
4640 HBasicBlock* is_symbol = graph()->CreateBasicBlock(); | |
4641 HBasicBlock* not_symbol = graph()->CreateBasicBlock(); | |
4642 symbolcheck->SetSuccessorAt(0, is_symbol); | |
4643 symbolcheck->SetSuccessorAt(1, not_symbol); | |
4644 not_spec_object->Finish(symbolcheck); | |
4645 is_symbol->AddLeaveInlined(return_value, state); | |
4646 not_symbol->AddLeaveInlined(receiver, state); | |
4639 } | 4647 } |
4640 } else if (state->inlining_kind() == SETTER_CALL_RETURN) { | 4648 } else if (state->inlining_kind() == SETTER_CALL_RETURN) { |
4641 // Return from an inlined setter call. The returned value is never used, the | 4649 // 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. | 4650 // value of an assignment is always the value of the RHS of the assignment. |
4643 CHECK_ALIVE(VisitForEffect(stmt->expression())); | 4651 CHECK_ALIVE(VisitForEffect(stmt->expression())); |
4644 if (context->IsTest()) { | 4652 if (context->IsTest()) { |
4645 HValue* rhs = environment()->arguments_environment()->Lookup(1); | 4653 HValue* rhs = environment()->arguments_environment()->Lookup(1); |
4646 context->ReturnValue(rhs); | 4654 context->ReturnValue(rhs); |
4647 } else if (context->IsEffect()) { | 4655 } else if (context->IsEffect()) { |
4648 current_block()->Goto(function_return(), state); | 4656 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))); | 9489 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
9482 HValue* value = Pop(); | 9490 HValue* value = Pop(); |
9483 HHasInstanceTypeAndBranch* result = | 9491 HHasInstanceTypeAndBranch* result = |
9484 new(zone()) HHasInstanceTypeAndBranch(value, | 9492 new(zone()) HHasInstanceTypeAndBranch(value, |
9485 FIRST_SPEC_OBJECT_TYPE, | 9493 FIRST_SPEC_OBJECT_TYPE, |
9486 LAST_SPEC_OBJECT_TYPE); | 9494 LAST_SPEC_OBJECT_TYPE); |
9487 return ast_context()->ReturnControl(result, call->id()); | 9495 return ast_context()->ReturnControl(result, call->id()); |
9488 } | 9496 } |
9489 | 9497 |
9490 | 9498 |
9499 void HOptimizedGraphBuilder::GenerateIsSymbol(CallRuntime* call) { | |
9500 ASSERT(call->arguments()->length() == 1); | |
9501 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | |
9502 HValue* value = Pop(); | |
9503 HHasInstanceTypeAndBranch* result = | |
9504 new(zone()) HHasInstanceTypeAndBranch(value, SYMBOL_TYPE); | |
9505 return ast_context()->ReturnControl(result, call->id()); | |
9506 } | |
9507 | |
9508 | |
9491 void HOptimizedGraphBuilder::GenerateIsFunction(CallRuntime* call) { | 9509 void HOptimizedGraphBuilder::GenerateIsFunction(CallRuntime* call) { |
9492 ASSERT(call->arguments()->length() == 1); | 9510 ASSERT(call->arguments()->length() == 1); |
9493 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 9511 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
9494 HValue* value = Pop(); | 9512 HValue* value = Pop(); |
9495 HHasInstanceTypeAndBranch* result = | 9513 HHasInstanceTypeAndBranch* result = |
9496 new(zone()) HHasInstanceTypeAndBranch(value, JS_FUNCTION_TYPE); | 9514 new(zone()) HHasInstanceTypeAndBranch(value, JS_FUNCTION_TYPE); |
9497 return ast_context()->ReturnControl(result, call->id()); | 9515 return ast_context()->ReturnControl(result, call->id()); |
9498 } | 9516 } |
9499 | 9517 |
9500 | 9518 |
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10623 } | 10641 } |
10624 } | 10642 } |
10625 | 10643 |
10626 #ifdef DEBUG | 10644 #ifdef DEBUG |
10627 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 10645 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
10628 if (allocator_ != NULL) allocator_->Verify(); | 10646 if (allocator_ != NULL) allocator_->Verify(); |
10629 #endif | 10647 #endif |
10630 } | 10648 } |
10631 | 10649 |
10632 } } // namespace v8::internal | 10650 } } // namespace v8::internal |
OLD | NEW |