Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(518)

Side by Side Diff: src/compiler.cc

Issue 1972593002: [wasm] Add flag to validate asm.js modules. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Turn off flag. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ast/scopes.cc ('k') | src/flag-definitions.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 12 matching lines...) Expand all
23 #include "src/interpreter/interpreter.h" 23 #include "src/interpreter/interpreter.h"
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/profiler/cpu-profiler.h" 30 #include "src/profiler/cpu-profiler.h"
31 #include "src/runtime-profiler.h" 31 #include "src/runtime-profiler.h"
32 #include "src/snapshot/code-serializer.h" 32 #include "src/snapshot/code-serializer.h"
33 #include "src/typing-asm.h"
33 #include "src/vm-state-inl.h" 34 #include "src/vm-state-inl.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(); \
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 size += code->CodeSize(); 457 size += code->CodeSize();
457 size += code->relocation_info()->Size(); 458 size += code->relocation_info()->Size();
458 size += code->deoptimization_data()->Size(); 459 size += code->deoptimization_data()->Size();
459 size += code->handler_table()->Size(); 460 size += code->handler_table()->Size();
460 } 461 }
461 return size; 462 return size;
462 } 463 }
463 464
464 bool GenerateUnoptimizedCode(CompilationInfo* info) { 465 bool GenerateUnoptimizedCode(CompilationInfo* info) {
465 bool success; 466 bool success;
466 EnsureFeedbackVector(info); 467 EnsureFeedbackVector(info);
bradnelson 2016/05/12 09:03:59 I've been thrashing about a bit attempting to craf
468 if (FLAG_validate_asm && info->scope()->asm_module()) {
469 AsmTyper typer(info->isolate(), info->zone(), *(info->script()),
470 info->literal());
471 if (FLAG_enable_simd_asmjs) {
472 typer.set_allow_simd(true);
473 }
474 if (!typer.Validate()) {
475 DCHECK(!info->isolate()->has_pending_exception());
bradnelson 2016/05/12 09:03:59 My intention was that in the failure case the Typi
476 PrintF("Validation of asm.js module failed: %s", typer.error_message());
477 }
478 }
467 if (FLAG_ignition && UseIgnition(info)) { 479 if (FLAG_ignition && UseIgnition(info)) {
468 success = interpreter::Interpreter::MakeBytecode(info); 480 success = interpreter::Interpreter::MakeBytecode(info);
469 } else { 481 } else {
470 success = FullCodeGenerator::MakeCode(info); 482 success = FullCodeGenerator::MakeCode(info);
471 } 483 }
472 if (success) { 484 if (success) {
473 Isolate* isolate = info->isolate(); 485 Isolate* isolate = info->isolate();
474 Counters* counters = isolate->counters(); 486 Counters* counters = isolate->counters();
475 // TODO(4280): Rename counters from "baseline" to "unoptimized" eventually. 487 // TODO(4280): Rename counters from "baseline" to "unoptimized" eventually.
476 counters->total_baseline_code_size()->Increment(CodeAndMetadataSize(info)); 488 counters->total_baseline_code_size()->Increment(CodeAndMetadataSize(info));
(...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after
1739 MaybeHandle<Code> code; 1751 MaybeHandle<Code> code;
1740 if (cached.code != nullptr) code = handle(cached.code); 1752 if (cached.code != nullptr) code = handle(cached.code);
1741 Handle<Context> native_context(function->context()->native_context()); 1753 Handle<Context> native_context(function->context()->native_context());
1742 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, 1754 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code,
1743 literals, BailoutId::None()); 1755 literals, BailoutId::None());
1744 } 1756 }
1745 } 1757 }
1746 1758
1747 } // namespace internal 1759 } // namespace internal
1748 } // namespace v8 1760 } // namespace v8
OLDNEW
« no previous file with comments | « src/ast/scopes.cc ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698