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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
9 #include "src/interpreter/bytecode-register-allocator.h" | 9 #include "src/interpreter/bytecode-register-allocator.h" |
10 #include "src/interpreter/control-flow-builders.h" | 10 #include "src/interpreter/control-flow-builders.h" |
(...skipping 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1206 } | 1206 } |
1207 | 1207 |
1208 | 1208 |
1209 void BytecodeGenerator::VisitClassLiteral(ClassLiteral* expr) { | 1209 void BytecodeGenerator::VisitClassLiteral(ClassLiteral* expr) { |
1210 UNIMPLEMENTED(); | 1210 UNIMPLEMENTED(); |
1211 } | 1211 } |
1212 | 1212 |
1213 | 1213 |
1214 void BytecodeGenerator::VisitNativeFunctionLiteral( | 1214 void BytecodeGenerator::VisitNativeFunctionLiteral( |
1215 NativeFunctionLiteral* expr) { | 1215 NativeFunctionLiteral* expr) { |
1216 UNIMPLEMENTED(); | 1216 // Find or build a shared function info for the native function template. |
| 1217 Handle<SharedFunctionInfo> shared_info = |
| 1218 Compiler::GetSharedFunctionInfoForNative(expr->extension(), expr->name()); |
| 1219 builder()->CreateClosure(shared_info, NOT_TENURED); |
| 1220 execution_result()->SetResultInAccumulator(); |
1217 } | 1221 } |
1218 | 1222 |
1219 | 1223 |
1220 void BytecodeGenerator::VisitDoExpression(DoExpression* expr) { | 1224 void BytecodeGenerator::VisitDoExpression(DoExpression* expr) { |
1221 UNIMPLEMENTED(); | 1225 UNIMPLEMENTED(); |
1222 } | 1226 } |
1223 | 1227 |
1224 | 1228 |
1225 void BytecodeGenerator::VisitConditional(Conditional* expr) { | 1229 void BytecodeGenerator::VisitConditional(Conditional* expr) { |
1226 // TODO(rmcilroy): Spot easy cases where there code would not need to | 1230 // TODO(rmcilroy): Spot easy cases where there code would not need to |
(...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2501 } | 2505 } |
2502 | 2506 |
2503 | 2507 |
2504 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 2508 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
2505 return info()->feedback_vector()->GetIndex(slot); | 2509 return info()->feedback_vector()->GetIndex(slot); |
2506 } | 2510 } |
2507 | 2511 |
2508 } // namespace interpreter | 2512 } // namespace interpreter |
2509 } // namespace internal | 2513 } // namespace internal |
2510 } // namespace v8 | 2514 } // namespace v8 |
OLD | NEW |