| 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 | 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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 if (info->shared_info()->is_toplevel()) { | 438 if (info->shared_info()->is_toplevel()) { |
| 439 Vector<const char> filter = CStrVector(FLAG_ignition_filter); | 439 Vector<const char> filter = CStrVector(FLAG_ignition_filter); |
| 440 return (filter.length() == 0) || (filter.length() == 1 && filter[0] == '*'); | 440 return (filter.length() == 0) || (filter.length() == 1 && filter[0] == '*'); |
| 441 } | 441 } |
| 442 | 442 |
| 443 // Finally respect the filter. | 443 // Finally respect the filter. |
| 444 return info->shared_info()->PassesFilter(FLAG_ignition_filter); | 444 return info->shared_info()->PassesFilter(FLAG_ignition_filter); |
| 445 } | 445 } |
| 446 | 446 |
| 447 int CodeAndMetadataSize(CompilationInfo* info) { | 447 int CodeAndMetadataSize(CompilationInfo* info) { |
| 448 int size = 0; | |
| 449 if (info->has_bytecode_array()) { | 448 if (info->has_bytecode_array()) { |
| 450 Handle<BytecodeArray> bytecode_array = info->bytecode_array(); | 449 return info->bytecode_array()->SizeIncludingMetadata(); |
| 451 size += bytecode_array->BytecodeArraySize(); | |
| 452 size += bytecode_array->constant_pool()->Size(); | |
| 453 size += bytecode_array->handler_table()->Size(); | |
| 454 size += bytecode_array->source_position_table()->Size(); | |
| 455 } else { | |
| 456 Handle<Code> code = info->code(); | |
| 457 size += code->CodeSize(); | |
| 458 size += code->relocation_info()->Size(); | |
| 459 size += code->deoptimization_data()->Size(); | |
| 460 size += code->handler_table()->Size(); | |
| 461 } | 450 } |
| 462 return size; | 451 return info->code()->SizeIncludingMetadata(); |
| 463 } | 452 } |
| 464 | 453 |
| 465 bool GenerateUnoptimizedCode(CompilationInfo* info) { | 454 bool GenerateUnoptimizedCode(CompilationInfo* info) { |
| 466 bool success; | 455 bool success; |
| 467 EnsureFeedbackVector(info); | 456 EnsureFeedbackVector(info); |
| 468 if (FLAG_validate_asm && info->scope()->asm_module()) { | 457 if (FLAG_validate_asm && info->scope()->asm_module()) { |
| 469 AsmTyper typer(info->isolate(), info->zone(), *(info->script()), | 458 AsmTyper typer(info->isolate(), info->zone(), *(info->script()), |
| 470 info->literal()); | 459 info->literal()); |
| 471 if (FLAG_enable_simd_asmjs) { | 460 if (FLAG_enable_simd_asmjs) { |
| 472 typer.set_allow_simd(true); | 461 typer.set_allow_simd(true); |
| (...skipping 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1756 MaybeHandle<Code> code; | 1745 MaybeHandle<Code> code; |
| 1757 if (cached.code != nullptr) code = handle(cached.code); | 1746 if (cached.code != nullptr) code = handle(cached.code); |
| 1758 Handle<Context> native_context(function->context()->native_context()); | 1747 Handle<Context> native_context(function->context()->native_context()); |
| 1759 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, | 1748 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, |
| 1760 literals, BailoutId::None()); | 1749 literals, BailoutId::None()); |
| 1761 } | 1750 } |
| 1762 } | 1751 } |
| 1763 | 1752 |
| 1764 } // namespace internal | 1753 } // namespace internal |
| 1765 } // namespace v8 | 1754 } // namespace v8 |
| OLD | NEW |