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 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/asmjs/asm-js.h" | 10 #include "src/asmjs/asm-js.h" |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 } | 519 } |
520 | 520 |
521 void InstallSharedCompilationResult(CompilationInfo* info, | 521 void InstallSharedCompilationResult(CompilationInfo* info, |
522 Handle<SharedFunctionInfo> shared) { | 522 Handle<SharedFunctionInfo> shared) { |
523 // 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 |
524 // functions via {FindSharedFunctionInfoInScript}, in which case we end up | 524 // functions via {FindSharedFunctionInfoInScript}, in which case we end up |
525 // regenerating existing bytecode. Fix this! | 525 // regenerating existing bytecode. Fix this! |
526 if (info->is_debug() && info->has_bytecode_array()) { | 526 if (info->is_debug() && info->has_bytecode_array()) { |
527 shared->ClearBytecodeArray(); | 527 shared->ClearBytecodeArray(); |
528 } | 528 } |
529 // Assert that we are not overwriting (possibly patched) debug code. | |
530 DCHECK(!shared->HasDebugInfo()); | |
531 DCHECK(!info->code().is_null()); | 529 DCHECK(!info->code().is_null()); |
532 shared->ReplaceCode(*info->code()); | 530 shared->ReplaceCode(*info->code()); |
533 if (info->has_bytecode_array()) { | 531 if (info->has_bytecode_array()) { |
534 DCHECK(!shared->HasBytecodeArray()); // Only compiled once. | 532 DCHECK(!shared->HasBytecodeArray()); // Only compiled once. |
535 shared->set_bytecode_array(*info->bytecode_array()); | 533 shared->set_bytecode_array(*info->bytecode_array()); |
536 } | 534 } |
537 } | 535 } |
538 | 536 |
539 MUST_USE_RESULT MaybeHandle<Code> GetUnoptimizedCode(CompilationInfo* info) { | 537 MUST_USE_RESULT MaybeHandle<Code> GetUnoptimizedCode(CompilationInfo* info) { |
540 VMState<COMPILER> state(info->isolate()); | 538 VMState<COMPILER> state(info->isolate()); |
(...skipping 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1955 DCHECK(shared->is_compiled()); | 1953 DCHECK(shared->is_compiled()); |
1956 function->set_literals(cached.literals); | 1954 function->set_literals(cached.literals); |
1957 } else if (shared->is_compiled()) { | 1955 } else if (shared->is_compiled()) { |
1958 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1956 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
1959 JSFunction::EnsureLiterals(function); | 1957 JSFunction::EnsureLiterals(function); |
1960 } | 1958 } |
1961 } | 1959 } |
1962 | 1960 |
1963 } // namespace internal | 1961 } // namespace internal |
1964 } // namespace v8 | 1962 } // namespace v8 |
OLD | NEW |