| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |