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/compiler.h" | 5 #include "src/compiler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "src/asmjs/asm-js.h" | 9 #include "src/asmjs/asm-js.h" |
10 #include "src/asmjs/typing-asm.h" | 10 #include "src/asmjs/typing-asm.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 DCHECK(DeclareGlobalsLanguageMode::is_valid(parse_info()->language_mode())); | 221 DCHECK(DeclareGlobalsLanguageMode::is_valid(parse_info()->language_mode())); |
222 return DeclareGlobalsEvalFlag::encode(parse_info()->is_eval()) | | 222 return DeclareGlobalsEvalFlag::encode(parse_info()->is_eval()) | |
223 DeclareGlobalsNativeFlag::encode(parse_info()->is_native()) | | 223 DeclareGlobalsNativeFlag::encode(parse_info()->is_native()) | |
224 DeclareGlobalsLanguageMode::encode(parse_info()->language_mode()); | 224 DeclareGlobalsLanguageMode::encode(parse_info()->language_mode()); |
225 } | 225 } |
226 | 226 |
227 bool CompilationInfo::ExpectsJSReceiverAsReceiver() { | 227 bool CompilationInfo::ExpectsJSReceiverAsReceiver() { |
228 return is_sloppy(parse_info()->language_mode()) && !parse_info()->is_native(); | 228 return is_sloppy(parse_info()->language_mode()) && !parse_info()->is_native(); |
229 } | 229 } |
230 | 230 |
231 #if DEBUG | |
232 void CompilationInfo::PrintAstForTesting() { | |
233 PrintF("--- Source from AST ---\n%s\n", | |
234 PrettyPrinter(isolate()).PrintProgram(literal())); | |
235 } | |
236 #endif | |
237 | |
238 // ---------------------------------------------------------------------------- | 231 // ---------------------------------------------------------------------------- |
239 // Implementation of CompilationJob | 232 // Implementation of CompilationJob |
240 | 233 |
241 CompilationJob::Status CompilationJob::CreateGraph() { | 234 CompilationJob::Status CompilationJob::CreateGraph() { |
242 DisallowJavascriptExecution no_js(isolate()); | 235 DisallowJavascriptExecution no_js(isolate()); |
243 DCHECK(info()->IsOptimizing()); | 236 DCHECK(info()->IsOptimizing()); |
244 | 237 |
245 if (FLAG_trace_opt) { | 238 if (FLAG_trace_opt) { |
246 OFStream os(stdout); | 239 OFStream os(stdout); |
247 os << "[compiling method " << Brief(*info()->closure()) << " using " | 240 os << "[compiling method " << Brief(*info()->closure()) << " using " |
(...skipping 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1825 DCHECK(shared->is_compiled()); | 1818 DCHECK(shared->is_compiled()); |
1826 function->set_literals(cached.literals); | 1819 function->set_literals(cached.literals); |
1827 } else if (shared->is_compiled()) { | 1820 } else if (shared->is_compiled()) { |
1828 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1821 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
1829 JSFunction::EnsureLiterals(function); | 1822 JSFunction::EnsureLiterals(function); |
1830 } | 1823 } |
1831 } | 1824 } |
1832 | 1825 |
1833 } // namespace internal | 1826 } // namespace internal |
1834 } // namespace v8 | 1827 } // namespace v8 |
OLD | NEW |