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

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

Issue 2607563002: [builtins] FastNewClosureStub becomes a builtin. (Closed)
Patch Set: Renames. Created 3 years, 11 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
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | src/interpreter/interpreter.cc » ('j') | 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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/full-codegen/full-codegen.h" 5 #include "src/full-codegen/full-codegen.h"
6 6
7 #include "src/ast/ast-numbering.h" 7 #include "src/ast/ast-numbering.h"
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/ast/prettyprinter.h" 9 #include "src/ast/prettyprinter.h"
10 #include "src/ast/scopes.h" 10 #include "src/ast/scopes.h"
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after
1023 } 1023 }
1024 1024
1025 void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info, 1025 void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info,
1026 bool pretenure) { 1026 bool pretenure) {
1027 // If we're running with the --always-opt or the --prepare-always-opt 1027 // If we're running with the --always-opt or the --prepare-always-opt
1028 // flag, we need to use the runtime function so that the new function 1028 // flag, we need to use the runtime function so that the new function
1029 // we are creating here gets a chance to have its code optimized and 1029 // we are creating here gets a chance to have its code optimized and
1030 // doesn't just get a copy of the existing unoptimized code. 1030 // doesn't just get a copy of the existing unoptimized code.
1031 if (!FLAG_always_opt && !FLAG_prepare_always_opt && !pretenure && 1031 if (!FLAG_always_opt && !FLAG_prepare_always_opt && !pretenure &&
1032 scope()->is_function_scope()) { 1032 scope()->is_function_scope()) {
1033 FastNewClosureStub stub(isolate()); 1033 Callable callable = CodeFactory::FastNewClosure(isolate());
1034 __ Move(stub.GetCallInterfaceDescriptor().GetRegisterParameter(0), info); 1034 __ Move(callable.descriptor().GetRegisterParameter(0), info);
1035 __ CallStub(&stub); 1035 __ Call(callable.code(), RelocInfo::CODE_TARGET);
1036 } else { 1036 } else {
1037 __ Push(info); 1037 __ Push(info);
1038 __ CallRuntime(pretenure ? Runtime::kNewClosure_Tenured 1038 __ CallRuntime(pretenure ? Runtime::kNewClosure_Tenured
1039 : Runtime::kNewClosure); 1039 : Runtime::kNewClosure);
1040 } 1040 }
1041 context()->Plug(result_register()); 1041 context()->Plug(result_register());
1042 } 1042 }
1043 1043
1044 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { 1044 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
1045 SetExpressionPosition(prop); 1045 SetExpressionPosition(prop);
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
1608 return info_->has_simple_parameters(); 1608 return info_->has_simple_parameters();
1609 } 1609 }
1610 1610
1611 FunctionLiteral* FullCodeGenerator::literal() const { return info_->literal(); } 1611 FunctionLiteral* FullCodeGenerator::literal() const { return info_->literal(); }
1612 1612
1613 #undef __ 1613 #undef __
1614 1614
1615 1615
1616 } // namespace internal 1616 } // namespace internal
1617 } // namespace v8 1617 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | src/interpreter/interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698