| Index: src/compiler.cc | 
| diff --git a/src/compiler.cc b/src/compiler.cc | 
| index b36d2663ac0545ee89e5f814d136aa3fa0df3501..b40c153684eee91ea2215e4efc8420fe71870aa0 100644 | 
| --- a/src/compiler.cc | 
| +++ b/src/compiler.cc | 
| @@ -1331,8 +1331,10 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfoForScript( | 
| timer.Start(); | 
| } | 
|  | 
| -  if (!maybe_result.ToHandle(&result)) { | 
| -    // No cache entry found. Compile the script. | 
| +  if (!maybe_result.ToHandle(&result) || | 
| +      (FLAG_serialize_toplevel && | 
| +       compile_options == ScriptCompiler::kProduceCodeCache)) { | 
| +    // No cache entry found, or embedder wants a code cache. Compile the script. | 
|  | 
| // Create a script object describing the script to be compiled. | 
| Handle<Script> script = isolate->factory()->NewScript(source); | 
|  |