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

Side by Side Diff: src/x64/full-codegen-x64.cc

Issue 9752002: This patch is an effort to simplify cascading jumps to return label in such case: Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 8 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
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2132 matching lines...) Expand 10 before | Expand all | Expand 10 after
2143 2143
2144 // Push the start position of the scope the calls resides in. 2144 // Push the start position of the scope the calls resides in.
2145 __ Push(Smi::FromInt(scope()->start_position())); 2145 __ Push(Smi::FromInt(scope()->start_position()));
2146 2146
2147 // Do the runtime call. 2147 // Do the runtime call.
2148 __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 5); 2148 __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 5);
2149 } 2149 }
2150 2150
2151 2151
2152 void FullCodeGenerator::VisitCall(Call* expr) { 2152 void FullCodeGenerator::VisitCall(Call* expr) {
2153 ImmediateReturnDisabled disable(this);
2153 #ifdef DEBUG 2154 #ifdef DEBUG
2154 // We want to verify that RecordJSReturnSite gets called on all paths 2155 // We want to verify that RecordJSReturnSite gets called on all paths
2155 // through this function. Avoid early returns. 2156 // through this function. Avoid early returns.
2156 expr->return_is_recorded_ = false; 2157 expr->return_is_recorded_ = false;
2157 #endif 2158 #endif
2158 2159
2159 Comment cmnt(masm_, "[ Call"); 2160 Comment cmnt(masm_, "[ Call");
2160 Expression* callee = expr->expression(); 2161 Expression* callee = expr->expression();
2161 VariableProxy* proxy = callee->AsVariableProxy(); 2162 VariableProxy* proxy = callee->AsVariableProxy();
2162 Property* property = callee->AsProperty(); 2163 Property* property = callee->AsProperty();
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
2260 } 2261 }
2261 2262
2262 #ifdef DEBUG 2263 #ifdef DEBUG
2263 // RecordJSReturnSite should have been called. 2264 // RecordJSReturnSite should have been called.
2264 ASSERT(expr->return_is_recorded_); 2265 ASSERT(expr->return_is_recorded_);
2265 #endif 2266 #endif
2266 } 2267 }
2267 2268
2268 2269
2269 void FullCodeGenerator::VisitCallNew(CallNew* expr) { 2270 void FullCodeGenerator::VisitCallNew(CallNew* expr) {
2271 ImmediateReturnDisabled disable(this);
2270 Comment cmnt(masm_, "[ CallNew"); 2272 Comment cmnt(masm_, "[ CallNew");
2271 // According to ECMA-262, section 11.2.2, page 44, the function 2273 // According to ECMA-262, section 11.2.2, page 44, the function
2272 // expression in new calls must be evaluated before the 2274 // expression in new calls must be evaluated before the
2273 // arguments. 2275 // arguments.
2274 2276
2275 // Push constructor on the stack. If it's not a function it's used as 2277 // Push constructor on the stack. If it's not a function it's used as
2276 // receiver for CALL_NON_FUNCTION, otherwise the value on the stack is 2278 // receiver for CALL_NON_FUNCTION, otherwise the value on the stack is
2277 // ignored. 2279 // ignored.
2278 VisitForStackValue(expr->expression()); 2280 VisitForStackValue(expr->expression());
2279 2281
(...skipping 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after
3702 3704
3703 __ bind(&return_result); 3705 __ bind(&return_result);
3704 // Drop temp values from the stack, and restore context register. 3706 // Drop temp values from the stack, and restore context register.
3705 __ addq(rsp, Immediate(3 * kPointerSize)); 3707 __ addq(rsp, Immediate(3 * kPointerSize));
3706 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); 3708 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
3707 context()->Plug(rax); 3709 context()->Plug(rax);
3708 } 3710 }
3709 3711
3710 3712
3711 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { 3713 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
3714 ImmediateReturnDisabled disable(this);
3712 Handle<String> name = expr->name(); 3715 Handle<String> name = expr->name();
3713 if (name->length() > 0 && name->Get(0) == '_') { 3716 if (name->length() > 0 && name->Get(0) == '_') {
3714 Comment cmnt(masm_, "[ InlineRuntimeCall"); 3717 Comment cmnt(masm_, "[ InlineRuntimeCall");
3715 EmitInlineRuntimeCall(expr); 3718 EmitInlineRuntimeCall(expr);
3716 return; 3719 return;
3717 } 3720 }
3718 3721
3719 Comment cmnt(masm_, "[ CallRuntime"); 3722 Comment cmnt(masm_, "[ CallRuntime");
3720 ZoneList<Expression*>* args = expr->arguments(); 3723 ZoneList<Expression*>* args = expr->arguments();
3721 3724
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
4429 *context_length = 0; 4432 *context_length = 0;
4430 return previous_; 4433 return previous_;
4431 } 4434 }
4432 4435
4433 4436
4434 #undef __ 4437 #undef __
4435 4438
4436 } } // namespace v8::internal 4439 } } // namespace v8::internal
4437 4440
4438 #endif // V8_TARGET_ARCH_X64 4441 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698