| 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/debug/debug.h" | 10 #include "src/debug/debug.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 void CompilationInfo::PrepareForSerializing() { | 46 void CompilationInfo::PrepareForSerializing() { |
| 47 if (parse_info()) parse_info()->set_will_serialize(); | 47 if (parse_info()) parse_info()->set_will_serialize(); |
| 48 SetFlag(kSerializing); | 48 SetFlag(kSerializing); |
| 49 } | 49 } |
| 50 | 50 |
| 51 bool CompilationInfo::has_shared_info() const { | 51 bool CompilationInfo::has_shared_info() const { |
| 52 return parse_info_ && !parse_info_->shared_info().is_null(); | 52 return parse_info_ && !parse_info_->shared_info().is_null(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 CompilationInfo::CompilationInfo(ParseInfo* parse_info, | 55 CompilationInfo::CompilationInfo(Zone* zone, ParseInfo* parse_info, |
| 56 Handle<JSFunction> closure) | 56 Handle<JSFunction> closure) |
| 57 : CompilationInfo(parse_info, {}, Code::ComputeFlags(Code::FUNCTION), BASE, | 57 : CompilationInfo(parse_info, {}, Code::ComputeFlags(Code::FUNCTION), BASE, |
| 58 parse_info->isolate(), parse_info->zone()) { | 58 parse_info->isolate(), zone) { |
| 59 closure_ = closure; | 59 closure_ = closure; |
| 60 | 60 |
| 61 // Compiling for the snapshot typically results in different code than | 61 // Compiling for the snapshot typically results in different code than |
| 62 // compiling later on. This means that code recompiled with deoptimization | 62 // compiling later on. This means that code recompiled with deoptimization |
| 63 // support won't be "equivalent" (as defined by SharedFunctionInfo:: | 63 // support won't be "equivalent" (as defined by SharedFunctionInfo:: |
| 64 // EnableDeoptimizationSupport), so it will replace the old code and all | 64 // EnableDeoptimizationSupport), so it will replace the old code and all |
| 65 // its type feedback. To avoid this, always compile functions in the snapshot | 65 // its type feedback. To avoid this, always compile functions in the snapshot |
| 66 // with deoptimization support. | 66 // with deoptimization support. |
| 67 if (isolate_->serializer_enabled()) EnableDeoptimizationSupport(); | 67 if (isolate_->serializer_enabled()) EnableDeoptimizationSupport(); |
| 68 | 68 |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 inlined_function, handle(inlined_function->code()), pos)); | 231 inlined_function, handle(inlined_function->code()), pos)); |
| 232 return id; | 232 return id; |
| 233 } | 233 } |
| 234 | 234 |
| 235 Code::Kind CompilationInfo::output_code_kind() const { | 235 Code::Kind CompilationInfo::output_code_kind() const { |
| 236 return Code::ExtractKindFromFlags(code_flags_); | 236 return Code::ExtractKindFromFlags(code_flags_); |
| 237 } | 237 } |
| 238 | 238 |
| 239 } // namespace internal | 239 } // namespace internal |
| 240 } // namespace v8 | 240 } // namespace v8 |
| OLD | NEW |