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

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

Issue 1423723002: Map v8::Function to JSReceiver + IsCallable (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 2 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/factory.cc ('k') | src/isolate.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.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 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after
1356 v8::Isolate* v8_isolate = reinterpret_cast<v8::Isolate*>(isolate()); 1356 v8::Isolate* v8_isolate = reinterpret_cast<v8::Isolate*>(isolate());
1357 1357
1358 // Compute the function template for the native function. 1358 // Compute the function template for the native function.
1359 Handle<String> name = expr->name(); 1359 Handle<String> name = expr->name();
1360 v8::Local<v8::FunctionTemplate> fun_template = 1360 v8::Local<v8::FunctionTemplate> fun_template =
1361 expr->extension()->GetNativeFunctionTemplate(v8_isolate, 1361 expr->extension()->GetNativeFunctionTemplate(v8_isolate,
1362 v8::Utils::ToLocal(name)); 1362 v8::Utils::ToLocal(name));
1363 DCHECK(!fun_template.IsEmpty()); 1363 DCHECK(!fun_template.IsEmpty());
1364 1364
1365 // Instantiate the function and create a shared function info from it. 1365 // Instantiate the function and create a shared function info from it.
1366 Handle<JSFunction> fun = Utils::OpenHandle( 1366 Handle<JSFunction> fun = Handle<JSFunction>::cast(Utils::OpenHandle(
1367 *fun_template->GetFunction(v8_isolate->GetCurrentContext()) 1367 *fun_template->GetFunction(v8_isolate->GetCurrentContext())
1368 .ToLocalChecked()); 1368 .ToLocalChecked()));
1369 const int literals = fun->NumberOfLiterals(); 1369 const int literals = fun->NumberOfLiterals();
1370 Handle<Code> code = Handle<Code>(fun->shared()->code()); 1370 Handle<Code> code = Handle<Code>(fun->shared()->code());
1371 Handle<Code> construct_stub = Handle<Code>(fun->shared()->construct_stub()); 1371 Handle<Code> construct_stub = Handle<Code>(fun->shared()->construct_stub());
1372 Handle<SharedFunctionInfo> shared = 1372 Handle<SharedFunctionInfo> shared =
1373 isolate()->factory()->NewSharedFunctionInfo( 1373 isolate()->factory()->NewSharedFunctionInfo(
1374 name, literals, FunctionKind::kNormalFunction, code, 1374 name, literals, FunctionKind::kNormalFunction, code,
1375 Handle<ScopeInfo>(fun->shared()->scope_info()), 1375 Handle<ScopeInfo>(fun->shared()->scope_info()),
1376 Handle<TypeFeedbackVector>(fun->shared()->feedback_vector())); 1376 Handle<TypeFeedbackVector>(fun->shared()->feedback_vector()));
1377 shared->set_construct_stub(*construct_stub); 1377 shared->set_construct_stub(*construct_stub);
1378 1378
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
1673 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() || 1673 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() ||
1674 var->initializer_position() >= proxy->position(); 1674 var->initializer_position() >= proxy->position();
1675 } 1675 }
1676 1676
1677 1677
1678 #undef __ 1678 #undef __
1679 1679
1680 1680
1681 } // namespace internal 1681 } // namespace internal
1682 } // namespace v8 1682 } // namespace v8
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698