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

Side by Side Diff: src/compiler.cc

Issue 2398023002: [wasm] asm.js - Parse and convert asm.js to wasm a function at a time. (Closed)
Patch Set: revised Created 4 years 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
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 #include <memory> 8 #include <memory>
9 9
10 #include "src/asmjs/asm-js.h" 10 #include "src/asmjs/asm-js.h"
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 } 1041 }
1042 1042
1043 bool Compiler::ParseAndAnalyze(ParseInfo* info) { 1043 bool Compiler::ParseAndAnalyze(ParseInfo* info) {
1044 if (!Parser::ParseStatic(info)) return false; 1044 if (!Parser::ParseStatic(info)) return false;
1045 if (!Compiler::Analyze(info)) return false; 1045 if (!Compiler::Analyze(info)) return false;
1046 DCHECK_NOT_NULL(info->literal()); 1046 DCHECK_NOT_NULL(info->literal());
1047 DCHECK_NOT_NULL(info->scope()); 1047 DCHECK_NOT_NULL(info->scope());
1048 return true; 1048 return true;
1049 } 1049 }
1050 1050
1051 Handle<SharedFunctionInfo> Compiler::NewSharedFunctionInfoFromLiteral(
1052 Isolate* isolate, FunctionLiteral* literal, Handle<Script> script) {
1053 return NewSharedFunctionInfoForLiteral(isolate, literal, script);
1054 }
1055
1051 bool Compiler::Compile(Handle<JSFunction> function, ClearExceptionFlag flag) { 1056 bool Compiler::Compile(Handle<JSFunction> function, ClearExceptionFlag flag) {
1052 if (function->is_compiled()) return true; 1057 if (function->is_compiled()) return true;
1053 Isolate* isolate = function->GetIsolate(); 1058 Isolate* isolate = function->GetIsolate();
1054 DCHECK(AllowCompilation::IsAllowed(isolate)); 1059 DCHECK(AllowCompilation::IsAllowed(isolate));
1055 1060
1056 // Start a compilation. 1061 // Start a compilation.
1057 Handle<Code> code; 1062 Handle<Code> code;
1058 if (!GetLazyCode(function).ToHandle(&code)) { 1063 if (!GetLazyCode(function).ToHandle(&code)) {
1059 if (flag == CLEAR_EXCEPTION) { 1064 if (flag == CLEAR_EXCEPTION) {
1060 isolate->clear_pending_exception(); 1065 isolate->clear_pending_exception();
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
1726 DCHECK(shared->is_compiled()); 1731 DCHECK(shared->is_compiled());
1727 function->set_literals(cached.literals); 1732 function->set_literals(cached.literals);
1728 } else if (shared->is_compiled()) { 1733 } else if (shared->is_compiled()) {
1729 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. 1734 // TODO(mvstanton): pass pretenure flag to EnsureLiterals.
1730 JSFunction::EnsureLiterals(function); 1735 JSFunction::EnsureLiterals(function);
1731 } 1736 }
1732 } 1737 }
1733 1738
1734 } // namespace internal 1739 } // namespace internal
1735 } // namespace v8 1740 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698