| 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/ast/ast-numbering.h" | 9 #include "src/ast/ast-numbering.h" |
| 10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "src/isolate-inl.h" | 24 #include "src/isolate-inl.h" |
| 25 #include "src/log-inl.h" | 25 #include "src/log-inl.h" |
| 26 #include "src/messages.h" | 26 #include "src/messages.h" |
| 27 #include "src/parsing/parser.h" | 27 #include "src/parsing/parser.h" |
| 28 #include "src/parsing/rewriter.h" | 28 #include "src/parsing/rewriter.h" |
| 29 #include "src/parsing/scanner-character-streams.h" | 29 #include "src/parsing/scanner-character-streams.h" |
| 30 #include "src/runtime-profiler.h" | 30 #include "src/runtime-profiler.h" |
| 31 #include "src/snapshot/code-serializer.h" | 31 #include "src/snapshot/code-serializer.h" |
| 32 #include "src/typing-asm.h" | 32 #include "src/typing-asm.h" |
| 33 #include "src/vm-state-inl.h" | 33 #include "src/vm-state-inl.h" |
| 34 #include "src/wasm/wasm-js.h" |
| 34 | 35 |
| 35 namespace v8 { | 36 namespace v8 { |
| 36 namespace internal { | 37 namespace internal { |
| 37 | 38 |
| 38 | 39 |
| 39 #define PARSE_INFO_GETTER(type, name) \ | 40 #define PARSE_INFO_GETTER(type, name) \ |
| 40 type CompilationInfo::name() const { \ | 41 type CompilationInfo::name() const { \ |
| 41 CHECK(parse_info()); \ | 42 CHECK(parse_info()); \ |
| 42 return parse_info()->name(); \ | 43 return parse_info()->name(); \ |
| 43 } | 44 } |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 if (info->has_bytecode_array()) { | 470 if (info->has_bytecode_array()) { |
| 470 return info->bytecode_array()->SizeIncludingMetadata(); | 471 return info->bytecode_array()->SizeIncludingMetadata(); |
| 471 } | 472 } |
| 472 return info->code()->SizeIncludingMetadata(); | 473 return info->code()->SizeIncludingMetadata(); |
| 473 } | 474 } |
| 474 | 475 |
| 475 bool GenerateUnoptimizedCode(CompilationInfo* info) { | 476 bool GenerateUnoptimizedCode(CompilationInfo* info) { |
| 476 bool success; | 477 bool success; |
| 477 EnsureFeedbackMetadata(info); | 478 EnsureFeedbackMetadata(info); |
| 478 if (FLAG_validate_asm && info->scope()->asm_module()) { | 479 if (FLAG_validate_asm && info->scope()->asm_module()) { |
| 479 AsmTyper typer(info->isolate(), info->zone(), *(info->script()), | 480 Handle<FixedArray> wasm_data; |
| 480 info->literal()); | 481 if (WasmJs::ConvertAsmToWasm(info->parse_info(), true, &wasm_data)) { |
| 481 if (FLAG_enable_simd_asmjs) { | 482 info->shared_info()->set_asm_wasm_data(*wasm_data); |
| 482 typer.set_allow_simd(true); | 483 info->SetCode(info->isolate()->builtins()->InstantiateAsmJs()); |
| 483 } | 484 return true; |
| 484 if (!typer.Validate()) { | |
| 485 DCHECK(!info->isolate()->has_pending_exception()); | |
| 486 PrintF("Validation of asm.js module failed: %s", typer.error_message()); | |
| 487 } | 485 } |
| 488 } | 486 } |
| 489 if (FLAG_ignition && UseIgnition(info)) { | 487 if (FLAG_ignition && UseIgnition(info)) { |
| 490 success = interpreter::Interpreter::MakeBytecode(info); | 488 success = interpreter::Interpreter::MakeBytecode(info); |
| 491 } else { | 489 } else { |
| 492 success = FullCodeGenerator::MakeCode(info); | 490 success = FullCodeGenerator::MakeCode(info); |
| 493 } | 491 } |
| 494 if (success) { | 492 if (success) { |
| 495 Isolate* isolate = info->isolate(); | 493 Isolate* isolate = info->isolate(); |
| 496 Counters* counters = isolate->counters(); | 494 Counters* counters = isolate->counters(); |
| (...skipping 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1825 DCHECK(shared->is_compiled()); | 1823 DCHECK(shared->is_compiled()); |
| 1826 function->set_literals(cached.literals); | 1824 function->set_literals(cached.literals); |
| 1827 } else if (shared->is_compiled()) { | 1825 } else if (shared->is_compiled()) { |
| 1828 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1826 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
| 1829 JSFunction::EnsureLiterals(function); | 1827 JSFunction::EnsureLiterals(function); |
| 1830 } | 1828 } |
| 1831 } | 1829 } |
| 1832 | 1830 |
| 1833 } // namespace internal | 1831 } // namespace internal |
| 1834 } // namespace v8 | 1832 } // namespace v8 |
| OLD | NEW |