| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/interpreter/bytecode-generator.h" | 5 #include "src/interpreter/bytecode-generator.h" |
| 6 | 6 |
| 7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
| 8 #include "src/interpreter/control-flow-builders.h" | 8 #include "src/interpreter/control-flow-builders.h" |
| 9 #include "src/objects.h" | 9 #include "src/objects.h" |
| 10 #include "src/parser.h" | 10 #include "src/parser.h" |
| (...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 964 void BytecodeGenerator::VisitDebuggerStatement(DebuggerStatement* stmt) { | 964 void BytecodeGenerator::VisitDebuggerStatement(DebuggerStatement* stmt) { |
| 965 UNIMPLEMENTED(); | 965 UNIMPLEMENTED(); |
| 966 } | 966 } |
| 967 | 967 |
| 968 | 968 |
| 969 void BytecodeGenerator::VisitFunctionLiteral(FunctionLiteral* expr) { | 969 void BytecodeGenerator::VisitFunctionLiteral(FunctionLiteral* expr) { |
| 970 // Find or build a shared function info. | 970 // Find or build a shared function info. |
| 971 Handle<SharedFunctionInfo> shared_info = | 971 Handle<SharedFunctionInfo> shared_info = |
| 972 Compiler::GetSharedFunctionInfo(expr, info()->script(), info()); | 972 Compiler::GetSharedFunctionInfo(expr, info()->script(), info()); |
| 973 CHECK(!shared_info.is_null()); // TODO(rmcilroy): Set stack overflow? | 973 CHECK(!shared_info.is_null()); // TODO(rmcilroy): Set stack overflow? |
| 974 | 974 builder()->CreateClosure(shared_info, |
| 975 builder() | 975 expr->pretenure() ? TENURED : NOT_TENURED); |
| 976 ->LoadLiteral(shared_info) | |
| 977 .CreateClosure(expr->pretenure() ? TENURED : NOT_TENURED); | |
| 978 execution_result()->SetResultInAccumulator(); | 976 execution_result()->SetResultInAccumulator(); |
| 979 } | 977 } |
| 980 | 978 |
| 981 | 979 |
| 982 void BytecodeGenerator::VisitClassLiteral(ClassLiteral* expr) { | 980 void BytecodeGenerator::VisitClassLiteral(ClassLiteral* expr) { |
| 983 UNIMPLEMENTED(); | 981 UNIMPLEMENTED(); |
| 984 } | 982 } |
| 985 | 983 |
| 986 | 984 |
| 987 void BytecodeGenerator::VisitNativeFunctionLiteral( | 985 void BytecodeGenerator::VisitNativeFunctionLiteral( |
| (...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2227 } | 2225 } |
| 2228 | 2226 |
| 2229 | 2227 |
| 2230 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 2228 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
| 2231 return info()->feedback_vector()->GetIndex(slot); | 2229 return info()->feedback_vector()->GetIndex(slot); |
| 2232 } | 2230 } |
| 2233 | 2231 |
| 2234 } // namespace interpreter | 2232 } // namespace interpreter |
| 2235 } // namespace internal | 2233 } // namespace internal |
| 2236 } // namespace v8 | 2234 } // namespace v8 |
| OLD | NEW |