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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/ast.h" | 7 #include "src/ast.h" |
8 #include "src/ast-numbering.h" | 8 #include "src/ast-numbering.h" |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1449 | 1449 |
1450 | 1450 |
1451 void FullCodeGenerator::VisitNativeFunctionLiteral( | 1451 void FullCodeGenerator::VisitNativeFunctionLiteral( |
1452 NativeFunctionLiteral* expr) { | 1452 NativeFunctionLiteral* expr) { |
1453 Comment cmnt(masm_, "[ NativeFunctionLiteral"); | 1453 Comment cmnt(masm_, "[ NativeFunctionLiteral"); |
1454 | 1454 |
1455 v8::Isolate* v8_isolate = reinterpret_cast<v8::Isolate*>(isolate()); | 1455 v8::Isolate* v8_isolate = reinterpret_cast<v8::Isolate*>(isolate()); |
1456 | 1456 |
1457 // Compute the function template for the native function. | 1457 // Compute the function template for the native function. |
1458 Handle<String> name = expr->name(); | 1458 Handle<String> name = expr->name(); |
1459 v8::Handle<v8::FunctionTemplate> fun_template = | 1459 v8::Local<v8::FunctionTemplate> fun_template = |
1460 expr->extension()->GetNativeFunctionTemplate(v8_isolate, | 1460 expr->extension()->GetNativeFunctionTemplate(v8_isolate, |
1461 v8::Utils::ToLocal(name)); | 1461 v8::Utils::ToLocal(name)); |
1462 DCHECK(!fun_template.IsEmpty()); | 1462 DCHECK(!fun_template.IsEmpty()); |
1463 | 1463 |
1464 // Instantiate the function and create a shared function info from it. | 1464 // Instantiate the function and create a shared function info from it. |
1465 Handle<JSFunction> fun = Utils::OpenHandle( | 1465 Handle<JSFunction> fun = Utils::OpenHandle( |
1466 *fun_template->GetFunction(v8_isolate->GetCurrentContext()) | 1466 *fun_template->GetFunction(v8_isolate->GetCurrentContext()) |
1467 .ToLocalChecked()); | 1467 .ToLocalChecked()); |
1468 const int literals = fun->NumberOfLiterals(); | 1468 const int literals = fun->NumberOfLiterals(); |
1469 Handle<Code> code = Handle<Code>(fun->shared()->code()); | 1469 Handle<Code> code = Handle<Code>(fun->shared()->code()); |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1708 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); | 1708 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); |
1709 codegen_->scope_ = saved_scope_; | 1709 codegen_->scope_ = saved_scope_; |
1710 } | 1710 } |
1711 | 1711 |
1712 | 1712 |
1713 #undef __ | 1713 #undef __ |
1714 | 1714 |
1715 | 1715 |
1716 } // namespace internal | 1716 } // namespace internal |
1717 } // namespace v8 | 1717 } // namespace v8 |
OLD | NEW |