| 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
| 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 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1056 | 1056 |
| 1057 static Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) { | 1057 static Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) { |
| 1058 Isolate* isolate = info->isolate(); | 1058 Isolate* isolate = info->isolate(); |
| 1059 PostponeInterruptsScope postpone(isolate); | 1059 PostponeInterruptsScope postpone(isolate); |
| 1060 DCHECK(!isolate->native_context().is_null()); | 1060 DCHECK(!isolate->native_context().is_null()); |
| 1061 ParseInfo* parse_info = info->parse_info(); | 1061 ParseInfo* parse_info = info->parse_info(); |
| 1062 Handle<Script> script = parse_info->script(); | 1062 Handle<Script> script = parse_info->script(); |
| 1063 | 1063 |
| 1064 // TODO(svenpanne) Obscure place for this, perhaps move to OnBeforeCompile? | 1064 // TODO(svenpanne) Obscure place for this, perhaps move to OnBeforeCompile? |
| 1065 FixedArray* array = isolate->native_context()->embedder_data(); | 1065 FixedArray* array = isolate->native_context()->embedder_data(); |
| 1066 script->set_context_data(array->get(0)); | 1066 script->set_context_data(array->get(v8::Context::kDebugIdIndex)); |
| 1067 | 1067 |
| 1068 isolate->debug()->OnBeforeCompile(script); | 1068 isolate->debug()->OnBeforeCompile(script); |
| 1069 | 1069 |
| 1070 DCHECK(parse_info->is_eval() || parse_info->is_global() || | 1070 DCHECK(parse_info->is_eval() || parse_info->is_global() || |
| 1071 parse_info->is_module()); | 1071 parse_info->is_module()); |
| 1072 | 1072 |
| 1073 parse_info->set_toplevel(); | 1073 parse_info->set_toplevel(); |
| 1074 | 1074 |
| 1075 Handle<SharedFunctionInfo> result; | 1075 Handle<SharedFunctionInfo> result; |
| 1076 | 1076 |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1597 parse_info_ = nullptr; | 1597 parse_info_ = nullptr; |
| 1598 } | 1598 } |
| 1599 | 1599 |
| 1600 #if DEBUG | 1600 #if DEBUG |
| 1601 void CompilationInfo::PrintAstForTesting() { | 1601 void CompilationInfo::PrintAstForTesting() { |
| 1602 PrintF("--- Source from AST ---\n%s\n", | 1602 PrintF("--- Source from AST ---\n%s\n", |
| 1603 PrettyPrinter(isolate(), zone()).PrintProgram(function())); | 1603 PrettyPrinter(isolate(), zone()).PrintProgram(function())); |
| 1604 } | 1604 } |
| 1605 #endif | 1605 #endif |
| 1606 } } // namespace v8::internal | 1606 } } // namespace v8::internal |
| OLD | NEW |