OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/compiler/access-builder.h" | 5 #include "src/compiler/access-builder.h" |
6 #include "src/compiler/ast-graph-builder.h" | 6 #include "src/compiler/ast-graph-builder.h" |
7 #include "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
8 #include "src/compiler/generic-node-inl.h" | 8 #include "src/compiler/generic-node-inl.h" |
9 #include "src/compiler/graph-inl.h" | 9 #include "src/compiler/graph-inl.h" |
10 #include "src/compiler/graph-visualizer.h" | 10 #include "src/compiler/graph-visualizer.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 void JSInliner::Inline() { | 47 void JSInliner::Inline() { |
48 InlinerVisitor visitor(this); | 48 InlinerVisitor visitor(this); |
49 jsgraph_->graph()->VisitNodeInputsFromEnd(&visitor); | 49 jsgraph_->graph()->VisitNodeInputsFromEnd(&visitor); |
50 } | 50 } |
51 | 51 |
52 | 52 |
53 // TODO(sigurds) Find a home for this function and reuse it everywhere (esp. in | 53 // TODO(sigurds) Find a home for this function and reuse it everywhere (esp. in |
54 // test cases, where similar code is currently duplicated). | 54 // test cases, where similar code is currently duplicated). |
55 static void Parse(Handle<JSFunction> function, CompilationInfoWithZone* info) { | 55 static void Parse(Handle<JSFunction> function, CompilationInfoWithZone* info) { |
56 CHECK(Parser::Parse(info)); | 56 CHECK(Parser::Parse(info)); |
57 StrictMode strict_mode = info->function()->strict_mode(); | |
58 info->SetStrictMode(strict_mode); | |
59 info->SetOptimizing(BailoutId::None(), Handle<Code>(function->code())); | 57 info->SetOptimizing(BailoutId::None(), Handle<Code>(function->code())); |
60 CHECK(Rewriter::Rewrite(info)); | 58 CHECK(Rewriter::Rewrite(info)); |
61 CHECK(Scope::Analyze(info)); | 59 CHECK(Scope::Analyze(info)); |
62 CHECK_NE(NULL, info->scope()); | 60 CHECK_NE(NULL, info->scope()); |
63 Handle<ScopeInfo> scope_info = ScopeInfo::Create(info->scope(), info->zone()); | 61 Handle<ScopeInfo> scope_info = ScopeInfo::Create(info->scope(), info->zone()); |
64 info->shared_info()->set_scope_info(*scope_info); | 62 info->shared_info()->set_scope_info(*scope_info); |
65 } | 63 } |
66 | 64 |
67 | 65 |
68 // A facade on a JSFunction's graph to facilitate inlining. It assumes the | 66 // A facade on a JSFunction's graph to facilitate inlining. It assumes the |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 | 351 |
354 CopyVisitor visitor(&graph, jsgraph_->graph(), info.zone()); | 352 CopyVisitor visitor(&graph, jsgraph_->graph(), info.zone()); |
355 visitor.CopyGraph(); | 353 visitor.CopyGraph(); |
356 | 354 |
357 Inlinee inlinee(visitor.GetCopy(graph.start()), visitor.GetCopy(graph.end())); | 355 Inlinee inlinee(visitor.GetCopy(graph.start()), visitor.GetCopy(graph.end())); |
358 inlinee.InlineAtCall(jsgraph_, call); | 356 inlinee.InlineAtCall(jsgraph_, call); |
359 } | 357 } |
360 } | 358 } |
361 } | 359 } |
362 } // namespace v8::internal::compiler | 360 } // namespace v8::internal::compiler |
OLD | NEW |