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

Side by Side Diff: src/compiler.cc

Issue 1102523003: Implement a 'trial parse' step, that will abort pre-parsing excessively (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Improve comments + naming. (Marja's feedback.) Created 5 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 | « no previous file | src/parser.h » ('j') | src/preparser.cc » ('J')
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-numbering.h" 9 #include "src/ast-numbering.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after
1363 // In that case the vector will be replaced the next time MakeCode is 1363 // In that case the vector will be replaced the next time MakeCode is
1364 // called. 1364 // called.
1365 info.EnsureFeedbackVector(); 1365 info.EnsureFeedbackVector();
1366 scope_info = Handle<ScopeInfo>(ScopeInfo::Empty(isolate)); 1366 scope_info = Handle<ScopeInfo>(ScopeInfo::Empty(isolate));
1367 } else if (Renumber(info.parse_info()) && 1367 } else if (Renumber(info.parse_info()) &&
1368 FullCodeGenerator::MakeCode(&info)) { 1368 FullCodeGenerator::MakeCode(&info)) {
1369 // MakeCode will ensure that the feedback vector is present and 1369 // MakeCode will ensure that the feedback vector is present and
1370 // appropriately sized. 1370 // appropriately sized.
1371 DCHECK(!info.code().is_null()); 1371 DCHECK(!info.code().is_null());
1372 scope_info = ScopeInfo::Create(info.isolate(), info.zone(), info.scope()); 1372 scope_info = ScopeInfo::Create(info.isolate(), info.zone(), info.scope());
1373 if (literal->should_eager_compile()) {
1374 info.code()->MarkToBeExecutedOnce(isolate);
1375 }
1373 } else { 1376 } else {
1374 return Handle<SharedFunctionInfo>::null(); 1377 return Handle<SharedFunctionInfo>::null();
1375 } 1378 }
1376 1379
1377 // Create a shared function info object. 1380 // Create a shared function info object.
1378 Handle<SharedFunctionInfo> result = factory->NewSharedFunctionInfo( 1381 Handle<SharedFunctionInfo> result = factory->NewSharedFunctionInfo(
1379 literal->name(), literal->materialized_literal_count(), literal->kind(), 1382 literal->name(), literal->materialized_literal_count(), literal->kind(),
1380 info.code(), scope_info, info.feedback_vector()); 1383 info.code(), scope_info, info.feedback_vector());
1381 1384
1382 SharedFunctionInfo::InitFromFunctionLiteral(result, literal); 1385 SharedFunctionInfo::InitFromFunctionLiteral(result, literal);
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1545 } 1548 }
1546 1549
1547 1550
1548 #if DEBUG 1551 #if DEBUG
1549 void CompilationInfo::PrintAstForTesting() { 1552 void CompilationInfo::PrintAstForTesting() {
1550 PrintF("--- Source from AST ---\n%s\n", 1553 PrintF("--- Source from AST ---\n%s\n",
1551 PrettyPrinter(isolate(), zone()).PrintProgram(function())); 1554 PrettyPrinter(isolate(), zone()).PrintProgram(function()));
1552 } 1555 }
1553 #endif 1556 #endif
1554 } } // namespace v8::internal 1557 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/parser.h » ('j') | src/preparser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698