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 <limits> | 5 #include <limits> |
6 | 6 |
7 #include "src/compiler/change-lowering.h" | 7 #include "src/compiler/change-lowering.h" |
8 #include "src/compiler/control-builders.h" | 8 #include "src/compiler/control-builders.h" |
9 #include "src/compiler/generic-node-inl.h" | 9 #include "src/compiler/generic-node-inl.h" |
10 #include "src/compiler/js-graph.h" | 10 #include "src/compiler/js-graph.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // TODO(titzer): we need to wrap the code in a JSFunction and call it via | 48 // TODO(titzer): we need to wrap the code in a JSFunction and call it via |
49 // Execution::Call() so that the GC knows about the frame, can walk it, | 49 // Execution::Call() so that the GC knows about the frame, can walk it, |
50 // relocate the code object if necessary, etc. | 50 // relocate the code object if necessary, etc. |
51 // This is pretty ugly and at the least should be moved up to helpers. | 51 // This is pretty ugly and at the least should be moved up to helpers. |
52 if (function.is_null()) { | 52 if (function.is_null()) { |
53 function = | 53 function = |
54 v8::Utils::OpenHandle(*v8::Handle<v8::Function>::Cast(CompileRun( | 54 v8::Utils::OpenHandle(*v8::Handle<v8::Function>::Cast(CompileRun( |
55 "(function() { 'use strict'; return 2.7123; })"))); | 55 "(function() { 'use strict'; return 2.7123; })"))); |
56 CompilationInfoWithZone info(function); | 56 CompilationInfoWithZone info(function); |
57 CHECK(Parser::Parse(&info)); | 57 CHECK(Parser::Parse(&info)); |
58 StrictMode strict_mode = info.function()->strict_mode(); | |
59 info.SetStrictMode(strict_mode); | |
60 info.SetOptimizing(BailoutId::None(), Handle<Code>(function->code())); | 58 info.SetOptimizing(BailoutId::None(), Handle<Code>(function->code())); |
61 CHECK(Rewriter::Rewrite(&info)); | 59 CHECK(Rewriter::Rewrite(&info)); |
62 CHECK(Scope::Analyze(&info)); | 60 CHECK(Scope::Analyze(&info)); |
63 CHECK_NE(NULL, info.scope()); | 61 CHECK_NE(NULL, info.scope()); |
64 Handle<ScopeInfo> scope_info = | 62 Handle<ScopeInfo> scope_info = |
65 ScopeInfo::Create(info.scope(), info.zone()); | 63 ScopeInfo::Create(info.scope(), info.zone()); |
66 info.shared_info()->set_scope_info(*scope_info); | 64 info.shared_info()->set_scope_info(*scope_info); |
67 Pipeline pipeline(&info); | 65 Pipeline pipeline(&info); |
68 Linkage linkage(&info); | 66 Linkage linkage(&info); |
69 Handle<Code> code = | 67 Handle<Code> code = |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 | 404 |
407 input = *i; | 405 input = *i; |
408 Object* result = t.CallWithPotentialGC<Object>(); | 406 Object* result = t.CallWithPotentialGC<Object>(); |
409 t.CheckNumber(input, result); | 407 t.CheckNumber(input, result); |
410 } | 408 } |
411 } | 409 } |
412 } | 410 } |
413 } | 411 } |
414 | 412 |
415 #endif // V8_TURBOFAN_BACKEND | 413 #endif // V8_TURBOFAN_BACKEND |
OLD | NEW |