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-numbering.h" | 9 #include "src/ast-numbering.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1345 timer.Start(); | 1345 timer.Start(); |
1346 } | 1346 } |
1347 | 1347 |
1348 if (!maybe_result.ToHandle(&result)) { | 1348 if (!maybe_result.ToHandle(&result)) { |
1349 // No cache entry found. Compile the script. | 1349 // No cache entry found. Compile the script. |
1350 | 1350 |
1351 // Create a script object describing the script to be compiled. | 1351 // Create a script object describing the script to be compiled. |
1352 Handle<Script> script = isolate->factory()->NewScript(source); | 1352 Handle<Script> script = isolate->factory()->NewScript(source); |
1353 if (natives == NATIVES_CODE) { | 1353 if (natives == NATIVES_CODE) { |
1354 script->set_type(Smi::FromInt(Script::TYPE_NATIVE)); | 1354 script->set_type(Smi::FromInt(Script::TYPE_NATIVE)); |
| 1355 script->set_hide_source(true); |
1355 } | 1356 } |
1356 if (!script_name.is_null()) { | 1357 if (!script_name.is_null()) { |
1357 script->set_name(*script_name); | 1358 script->set_name(*script_name); |
1358 script->set_line_offset(Smi::FromInt(line_offset)); | 1359 script->set_line_offset(Smi::FromInt(line_offset)); |
1359 script->set_column_offset(Smi::FromInt(column_offset)); | 1360 script->set_column_offset(Smi::FromInt(column_offset)); |
1360 } | 1361 } |
1361 script->set_origin_options(resource_options); | 1362 script->set_origin_options(resource_options); |
1362 if (!source_map_url.is_null()) { | 1363 if (!source_map_url.is_null()) { |
1363 script->set_source_mapping_url(*source_map_url); | 1364 script->set_source_mapping_url(*source_map_url); |
1364 } | 1365 } |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1717 | 1718 |
1718 | 1719 |
1719 #if DEBUG | 1720 #if DEBUG |
1720 void CompilationInfo::PrintAstForTesting() { | 1721 void CompilationInfo::PrintAstForTesting() { |
1721 PrintF("--- Source from AST ---\n%s\n", | 1722 PrintF("--- Source from AST ---\n%s\n", |
1722 PrettyPrinter(isolate(), zone()).PrintProgram(literal())); | 1723 PrettyPrinter(isolate(), zone()).PrintProgram(literal())); |
1723 } | 1724 } |
1724 #endif | 1725 #endif |
1725 } // namespace internal | 1726 } // namespace internal |
1726 } // namespace v8 | 1727 } // namespace v8 |
OLD | NEW |