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.h" | 7 #include "src/ast/ast.h" |
8 #include "src/ast/ast-numbering.h" | 8 #include "src/ast/ast-numbering.h" |
9 #include "src/ast/prettyprinter.h" | 9 #include "src/ast/prettyprinter.h" |
10 #include "src/ast/scopeinfo.h" | 10 #include "src/ast/scopeinfo.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 namespace internal { | 22 namespace internal { |
23 | 23 |
24 #define __ ACCESS_MASM(masm()) | 24 #define __ ACCESS_MASM(masm()) |
25 | 25 |
26 bool FullCodeGenerator::MakeCode(CompilationInfo* info) { | 26 bool FullCodeGenerator::MakeCode(CompilationInfo* info) { |
27 Isolate* isolate = info->isolate(); | 27 Isolate* isolate = info->isolate(); |
28 | 28 |
29 TimerEventScope<TimerEventCompileFullCode> timer(info->isolate()); | 29 TimerEventScope<TimerEventCompileFullCode> timer(info->isolate()); |
30 | 30 |
31 // Ensure that the feedback vector is large enough. | 31 // Ensure that the feedback vector is large enough. |
32 info->EnsureFeedbackVector(); | 32 info->EnsureFeedbackMetadata(); |
33 | 33 |
34 Handle<Script> script = info->script(); | 34 Handle<Script> script = info->script(); |
35 if (!script->IsUndefined() && !script->source()->IsUndefined()) { | 35 if (!script->IsUndefined() && !script->source()->IsUndefined()) { |
36 int len = String::cast(script->source())->length(); | 36 int len = String::cast(script->source())->length(); |
37 isolate->counters()->total_full_codegen_source_size()->Increment(len); | 37 isolate->counters()->total_full_codegen_source_size()->Increment(len); |
38 } | 38 } |
39 CodeGenerator::MakeCodePrologue(info, "full"); | 39 CodeGenerator::MakeCodePrologue(info, "full"); |
40 const int kInitialBufferSize = 4 * KB; | 40 const int kInitialBufferSize = 4 * KB; |
41 MacroAssembler masm(info->isolate(), NULL, kInitialBufferSize, | 41 MacroAssembler masm(info->isolate(), NULL, kInitialBufferSize, |
42 CodeObjectRequired::kYes); | 42 CodeObjectRequired::kYes); |
(...skipping 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1357 Handle<JSFunction> fun = Handle<JSFunction>::cast(Utils::OpenHandle( | 1357 Handle<JSFunction> fun = Handle<JSFunction>::cast(Utils::OpenHandle( |
1358 *fun_template->GetFunction(v8_isolate->GetCurrentContext()) | 1358 *fun_template->GetFunction(v8_isolate->GetCurrentContext()) |
1359 .ToLocalChecked())); | 1359 .ToLocalChecked())); |
1360 const int literals = fun->NumberOfLiterals(); | 1360 const int literals = fun->NumberOfLiterals(); |
1361 Handle<Code> code = Handle<Code>(fun->shared()->code()); | 1361 Handle<Code> code = Handle<Code>(fun->shared()->code()); |
1362 Handle<Code> construct_stub = Handle<Code>(fun->shared()->construct_stub()); | 1362 Handle<Code> construct_stub = Handle<Code>(fun->shared()->construct_stub()); |
1363 Handle<SharedFunctionInfo> shared = | 1363 Handle<SharedFunctionInfo> shared = |
1364 isolate()->factory()->NewSharedFunctionInfo( | 1364 isolate()->factory()->NewSharedFunctionInfo( |
1365 name, literals, FunctionKind::kNormalFunction, code, | 1365 name, literals, FunctionKind::kNormalFunction, code, |
1366 Handle<ScopeInfo>(fun->shared()->scope_info()), | 1366 Handle<ScopeInfo>(fun->shared()->scope_info()), |
1367 Handle<TypeFeedbackVector>(fun->shared()->feedback_vector())); | 1367 Handle<TypeFeedbackMetadata>(fun->shared()->feedback_metadata())); |
1368 shared->set_construct_stub(*construct_stub); | 1368 shared->set_construct_stub(*construct_stub); |
1369 | 1369 |
1370 // Copy the function data to the shared function info. | 1370 // Copy the function data to the shared function info. |
1371 shared->set_function_data(fun->shared()->function_data()); | 1371 shared->set_function_data(fun->shared()->function_data()); |
1372 int parameters = fun->shared()->internal_formal_parameter_count(); | 1372 int parameters = fun->shared()->internal_formal_parameter_count(); |
1373 shared->set_internal_formal_parameter_count(parameters); | 1373 shared->set_internal_formal_parameter_count(parameters); |
1374 | 1374 |
1375 EmitNewClosure(shared, false); | 1375 EmitNewClosure(shared, false); |
1376 } | 1376 } |
1377 | 1377 |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1730 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() || | 1730 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() || |
1731 var->initializer_position() >= proxy->position(); | 1731 var->initializer_position() >= proxy->position(); |
1732 } | 1732 } |
1733 | 1733 |
1734 | 1734 |
1735 #undef __ | 1735 #undef __ |
1736 | 1736 |
1737 | 1737 |
1738 } // namespace internal | 1738 } // namespace internal |
1739 } // namespace v8 | 1739 } // namespace v8 |
OLD | NEW |