| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/compilation-info.h" | 5 #include "src/compilation-info.h" |
| 6 | 6 |
| 7 #include "src/api.h" | 7 #include "src/api.h" |
| 8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
| 9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
| 10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 } | 25 } |
| 26 | 26 |
| 27 PARSE_INFO_GETTER(Handle<Script>, script) | 27 PARSE_INFO_GETTER(Handle<Script>, script) |
| 28 PARSE_INFO_GETTER(FunctionLiteral*, literal) | 28 PARSE_INFO_GETTER(FunctionLiteral*, literal) |
| 29 PARSE_INFO_GETTER_WITH_DEFAULT(DeclarationScope*, scope, nullptr) | 29 PARSE_INFO_GETTER_WITH_DEFAULT(DeclarationScope*, scope, nullptr) |
| 30 PARSE_INFO_GETTER(Handle<SharedFunctionInfo>, shared_info) | 30 PARSE_INFO_GETTER(Handle<SharedFunctionInfo>, shared_info) |
| 31 | 31 |
| 32 #undef PARSE_INFO_GETTER | 32 #undef PARSE_INFO_GETTER |
| 33 #undef PARSE_INFO_GETTER_WITH_DEFAULT | 33 #undef PARSE_INFO_GETTER_WITH_DEFAULT |
| 34 | 34 |
| 35 bool CompilationInfo::is_debug() const { |
| 36 return parse_info() ? parse_info()->is_debug() : false; |
| 37 } |
| 38 |
| 39 void CompilationInfo::set_is_debug() { |
| 40 CHECK(parse_info()); |
| 41 parse_info()->set_is_debug(); |
| 42 } |
| 43 |
| 44 void CompilationInfo::PrepareForSerializing() { |
| 45 if (parse_info()) parse_info()->set_will_serialize(); |
| 46 SetFlag(kSerializing); |
| 47 } |
| 48 |
| 35 bool CompilationInfo::has_shared_info() const { | 49 bool CompilationInfo::has_shared_info() const { |
| 36 return parse_info_ && !parse_info_->shared_info().is_null(); | 50 return parse_info_ && !parse_info_->shared_info().is_null(); |
| 37 } | 51 } |
| 38 | 52 |
| 39 CompilationInfo::CompilationInfo(ParseInfo* parse_info, | 53 CompilationInfo::CompilationInfo(ParseInfo* parse_info, |
| 40 Handle<JSFunction> closure) | 54 Handle<JSFunction> closure) |
| 41 : CompilationInfo(parse_info, {}, Code::ComputeFlags(Code::FUNCTION), BASE, | 55 : CompilationInfo(parse_info, {}, Code::ComputeFlags(Code::FUNCTION), BASE, |
| 42 parse_info->isolate(), parse_info->zone()) { | 56 parse_info->isolate(), parse_info->zone()) { |
| 43 closure_ = closure; | 57 closure_ = closure; |
| 44 | 58 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 inlined_functions_.push_back(InlinedFunctionHolder( | 219 inlined_functions_.push_back(InlinedFunctionHolder( |
| 206 inlined_function, handle(inlined_function->code()))); | 220 inlined_function, handle(inlined_function->code()))); |
| 207 } | 221 } |
| 208 | 222 |
| 209 Code::Kind CompilationInfo::output_code_kind() const { | 223 Code::Kind CompilationInfo::output_code_kind() const { |
| 210 return Code::ExtractKindFromFlags(code_flags_); | 224 return Code::ExtractKindFromFlags(code_flags_); |
| 211 } | 225 } |
| 212 | 226 |
| 213 } // namespace internal | 227 } // namespace internal |
| 214 } // namespace v8 | 228 } // namespace v8 |
| OLD | NEW |