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

Side by Side Diff: src/compiler.cc

Issue 2263493002: Don't create ScopeInfo if there already is one. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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 | no next file » | 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 #include <memory> 8 #include <memory>
9 9
10 #include "src/asmjs/asm-js.h" 10 #include "src/asmjs/asm-js.h"
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 !GenerateUnoptimizedCode(info)) { 507 !GenerateUnoptimizedCode(info)) {
508 Isolate* isolate = info->isolate(); 508 Isolate* isolate = info->isolate();
509 if (!isolate->has_pending_exception()) isolate->StackOverflow(); 509 if (!isolate->has_pending_exception()) isolate->StackOverflow();
510 return false; 510 return false;
511 } 511 }
512 return true; 512 return true;
513 } 513 }
514 514
515 void InstallSharedScopeInfo(CompilationInfo* info, 515 void InstallSharedScopeInfo(CompilationInfo* info,
516 Handle<SharedFunctionInfo> shared) { 516 Handle<SharedFunctionInfo> shared) {
517 Handle<ScopeInfo> scope_info = 517 Handle<ScopeInfo> scope_info = info->scope()->GetScopeInfo(info->isolate());
518 ScopeInfo::Create(info->isolate(), info->zone(), info->scope());
519 shared->set_scope_info(*scope_info); 518 shared->set_scope_info(*scope_info);
520 } 519 }
521 520
522 void InstallSharedCompilationResult(CompilationInfo* info, 521 void InstallSharedCompilationResult(CompilationInfo* info,
523 Handle<SharedFunctionInfo> shared) { 522 Handle<SharedFunctionInfo> shared) {
524 // TODO(mstarzinger): Compiling for debug code might be used to reveal inner 523 // TODO(mstarzinger): Compiling for debug code might be used to reveal inner
525 // functions via {FindSharedFunctionInfoInScript}, in which case we end up 524 // functions via {FindSharedFunctionInfoInScript}, in which case we end up
526 // regenerating existing bytecode. Fix this! 525 // regenerating existing bytecode. Fix this!
527 if (info->is_debug() && info->has_bytecode_array()) { 526 if (info->is_debug() && info->has_bytecode_array()) {
528 shared->ClearBytecodeArray(); 527 shared->ClearBytecodeArray();
(...skipping 1435 matching lines...) Expand 10 before | Expand all | Expand 10 after
1964 DCHECK(shared->is_compiled()); 1963 DCHECK(shared->is_compiled());
1965 function->set_literals(cached.literals); 1964 function->set_literals(cached.literals);
1966 } else if (shared->is_compiled()) { 1965 } else if (shared->is_compiled()) {
1967 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. 1966 // TODO(mvstanton): pass pretenure flag to EnsureLiterals.
1968 JSFunction::EnsureLiterals(function); 1967 JSFunction::EnsureLiterals(function);
1969 } 1968 }
1970 } 1969 }
1971 1970
1972 } // namespace internal 1971 } // namespace internal
1973 } // namespace v8 1972 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698