I try to create a codeCache via V8. ``` ScriptCompiler::CachedData* CreateCachedData(Local<String> sourceContent, Local<String> sourceName) { ScriptOrigin* scriptOriginPtr = nullptr; scriptOriginPtr = new ScriptOrigin( String::NewFromTwoByte(isolate_, sourceName, NewStringType::kNormal).ToLocalChecked(), Integer::New(isolate_, 0), Integer::New(isolate_, 0)); ScriptCompiler::Source* source = nullptr; source = new ScriptCompiler::Source(sourceContent, *scriptOriginPtr);
Local<Script> script; ScriptCompiler::Compile(context_, source, ScriptCompiler::CompileOptions::kEagerCompile).ToLocal(&script); ScriptCompiler::CachedData* data = ScriptCompiler::CreateCodeCache(script->GetUnboundScript()); return data; } ``` When I use these code, the value of data is nullptr. ``` function A() { "use asm" function R() {} return R } ``` When I use these code, the value of data isn't nullptr. ``` function A() { "use asm" function R() {}; return R } ``` What's the difference between these two JS codes? In V8? And In JS? -- -- v8-dev mailing list v8-dev@googlegroups.com http://groups.google.com/group/v8-dev --- You received this message because you are subscribed to the Google Groups "v8-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to v8-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/5c6eaaa6-b0cc-4196-bd90-2d2dbe632f21n%40googlegroups.com.