Chromium Code Reviews| Index: runtime/vm/compiler.cc |
| diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc |
| index 14bcc09403163ef425a4f0f9bb5e64539db47995..a12c58973b571a254167f6c10b928224c6abdba8 100644 |
| --- a/runtime/vm/compiler.cc |
| +++ b/runtime/vm/compiler.cc |
| @@ -385,6 +385,9 @@ class CompileParsedFunctionHelper : public ValueObject { |
| } |
| bool Compile(CompilationPipeline* pipeline); |
| + uint32_t prefix_invalidation_gen_at_start() const { |
| + return prefix_invalidation_gen_at_start_; |
| + } |
| private: |
| ParsedFunction* parsed_function() const { return parsed_function_; } |
| @@ -398,9 +401,6 @@ class CompileParsedFunctionHelper : public ValueObject { |
| uint32_t field_invalidation_gen_at_start() const { |
| return field_invalidation_gen_at_start_; |
| } |
| - uint32_t prefix_invalidation_gen_at_start() const { |
| - return prefix_invalidation_gen_at_start_; |
| - } |
| void FinalizeCompilation(Assembler* assembler, |
| FlowGraphCompiler* graph_compiler, |
| FlowGraph* flow_graph); |
| @@ -1154,6 +1154,9 @@ static RawError* CompileFunctionHelper(CompilationPipeline* pipeline, |
| if (optimized) { |
| INC_STAT(thread, num_functions_optimized, 1); |
| } |
| + // Makes sure no libraries are loaded during parsing. |
| + const uint32_t prefix_invalidation_gen_at_start = |
| + isolate->prefix_invalidation_gen(); |
| { |
| HANDLESCOPE(thread); |
| const int64_t num_tokens_before = STAT_VALUE(thread, num_tokens_consumed); |
| @@ -1165,6 +1168,12 @@ static RawError* CompileFunctionHelper(CompilationPipeline* pipeline, |
| } |
| CompileParsedFunctionHelper helper(parsed_function, optimized, osr_id); |
| + if (prefix_invalidation_gen_at_start != |
| + helper.prefix_invalidation_gen_at_start()) { |
| + ASSERT(Compiler::IsBackgroundCompilation()); |
| + // Deferred loading occured while parsing or copying ICData. |
| + Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId); |
|
rmacnak
2016/03/24 18:18:19
Add comment here that we need to abort because the
srdjan
2016/03/24 18:22:08
Done.
|
| + } |
| const bool success = helper.Compile(pipeline); |
| if (!success) { |
| if (optimized) { |
| @@ -1377,6 +1386,8 @@ void Compiler::ComputeLocalVarDescriptors(const Code& code) { |
| // IsIrregexpFunction have eager var descriptors generation. |
| ASSERT(!function.IsIrregexpFunction()); |
| // Parser should not produce any errors, therefore no LongJumpScope needed. |
| + // (exception is background compilation). |
| + ASSERT(!Compiler::IsBackgroundCompilation()); |
| Parser::ParseFunction(parsed_function); |
| parsed_function->AllocateVariables(); |
| var_descs = parsed_function->node_sequence()->scope()-> |