Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Side by Side Diff: src/hydrogen.cc

Issue 12613004: To fully support hydrogen code stubs which accept a variable number of arguments, (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 3824 matching lines...) Expand 10 before | Expand all | Expand 10 after
3835 3835
3836 HValue* context = environment()->LookupContext(); 3836 HValue* context = environment()->LookupContext();
3837 AddInstruction( 3837 AddInstruction(
3838 new(zone()) HStackCheck(context, HStackCheck::kFunctionEntry)); 3838 new(zone()) HStackCheck(context, HStackCheck::kFunctionEntry));
3839 3839
3840 VisitStatements(info()->function()->body()); 3840 VisitStatements(info()->function()->body());
3841 if (HasStackOverflow()) return false; 3841 if (HasStackOverflow()) return false;
3842 3842
3843 if (current_block() != NULL) { 3843 if (current_block() != NULL) {
3844 HReturn* instr = new(zone()) HReturn(graph()->GetConstantUndefined(), 3844 HReturn* instr = new(zone()) HReturn(graph()->GetConstantUndefined(),
3845 context); 3845 context,
3846 info()->num_parameters());
danno 2013/03/07 15:11:14 Create a HConstant with this value
mvstanton 2013/03/07 16:48:49 Done.
3846 current_block()->FinishExit(instr); 3847 current_block()->FinishExit(instr);
3847 set_current_block(NULL); 3848 set_current_block(NULL);
3848 } 3849 }
3849 3850
3850 // If the checksum of the number of type info changes is the same as the 3851 // If the checksum of the number of type info changes is the same as the
3851 // last time this function was compiled, then this recompile is likely not 3852 // last time this function was compiled, then this recompile is likely not
3852 // due to missing/inadequate type feedback, but rather too aggressive 3853 // due to missing/inadequate type feedback, but rather too aggressive
3853 // optimization. Disable optimistic LICM in that case. 3854 // optimization. Disable optimistic LICM in that case.
3854 Handle<Code> unoptimized_code(info()->shared_info()->code()); 3855 Handle<Code> unoptimized_code(info()->shared_info()->code());
3855 ASSERT(unoptimized_code->kind() == Code::FUNCTION); 3856 ASSERT(unoptimized_code->kind() == Code::FUNCTION);
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
4721 ASSERT(current_block() != NULL); 4722 ASSERT(current_block() != NULL);
4722 ASSERT(current_block()->HasPredecessor()); 4723 ASSERT(current_block()->HasPredecessor());
4723 FunctionState* state = function_state(); 4724 FunctionState* state = function_state();
4724 AstContext* context = call_context(); 4725 AstContext* context = call_context();
4725 if (context == NULL) { 4726 if (context == NULL) {
4726 // Not an inlined return, so an actual one. 4727 // Not an inlined return, so an actual one.
4727 CHECK_ALIVE(VisitForValue(stmt->expression())); 4728 CHECK_ALIVE(VisitForValue(stmt->expression()));
4728 HValue* result = environment()->Pop(); 4729 HValue* result = environment()->Pop();
4729 current_block()->FinishExit(new(zone()) HReturn( 4730 current_block()->FinishExit(new(zone()) HReturn(
4730 result, 4731 result,
4731 environment()->LookupContext())); 4732 environment()->LookupContext(),
4733 info()->num_parameters()));
danno 2013/03/07 15:11:14 Create a HConstant with this value
mvstanton 2013/03/07 16:48:49 Done.
4732 } else if (state->inlining_kind() == CONSTRUCT_CALL_RETURN) { 4734 } else if (state->inlining_kind() == CONSTRUCT_CALL_RETURN) {
4733 // Return from an inlined construct call. In a test context the return value 4735 // Return from an inlined construct call. In a test context the return value
4734 // will always evaluate to true, in a value context the return value needs 4736 // will always evaluate to true, in a value context the return value needs
4735 // to be a JSObject. 4737 // to be a JSObject.
4736 if (context->IsTest()) { 4738 if (context->IsTest()) {
4737 TestContext* test = TestContext::cast(context); 4739 TestContext* test = TestContext::cast(context);
4738 CHECK_ALIVE(VisitForEffect(stmt->expression())); 4740 CHECK_ALIVE(VisitForEffect(stmt->expression()));
4739 current_block()->Goto(test->if_true(), state); 4741 current_block()->Goto(test->if_true(), state);
4740 } else if (context->IsEffect()) { 4742 } else if (context->IsEffect()) {
4741 CHECK_ALIVE(VisitForEffect(stmt->expression())); 4743 CHECK_ALIVE(VisitForEffect(stmt->expression()));
(...skipping 6121 matching lines...) Expand 10 before | Expand all | Expand 10 after
10863 } 10865 }
10864 } 10866 }
10865 10867
10866 #ifdef DEBUG 10868 #ifdef DEBUG
10867 if (graph_ != NULL) graph_->Verify(false); // No full verify. 10869 if (graph_ != NULL) graph_->Verify(false); // No full verify.
10868 if (allocator_ != NULL) allocator_->Verify(); 10870 if (allocator_ != NULL) allocator_->Verify();
10869 #endif 10871 #endif
10870 } 10872 }
10871 10873
10872 } } // namespace v8::internal 10874 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698