Commit 33dc53f9 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Always include full reloc info to stubs for serialization.

R=mvstanton@chromium.org

Review URL: https://codereview.chromium.org/641643006

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24543 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 907ad65d
......@@ -233,6 +233,8 @@ Handle<Code> HydrogenCodeStub::GenerateLightweightMissCode(
// Generate the code for the stub.
masm.set_generating_stub(true);
// TODO(yangguo): remove this once we can serialize IC stubs.
masm.enable_serializer();
NoCurrentFrameScope scope(&masm);
GenerateLightweightMiss(&masm, miss);
}
......
......@@ -111,6 +111,8 @@ Handle<Code> PlatformCodeStub::GenerateCode() {
// Generate the code for the stub.
masm.set_generating_stub(true);
// TODO(yangguo): remove this once we can serialize IC stubs.
masm.enable_serializer();
NoCurrentFrameScope scope(&masm);
Generate(&masm);
}
......
......@@ -34,6 +34,21 @@ void StackGuard::reset_limits(const ExecutionAccess& lock) {
}
static PrintDeserializedCodeInfo(Handle<JSFunction> function) {
if (function->code() == function->shared()->code() &&
function->shared()->deserialized()) {
PrintF("Running deserialized script: ");
Object* script = function->shared()->script();
if (script->IsScript()) {
Script::cast(script)->name()->ShortPrint();
} else {
function->shared()->script()->ShortPrint();
}
PrintF("\n");
}
}
MUST_USE_RESULT static MaybeHandle<Object> Invoke(
bool is_construct,
Handle<JSFunction> function,
......@@ -87,6 +102,7 @@ MUST_USE_RESULT static MaybeHandle<Object> Invoke(
JSFunction* func = *function;
Object* recv = *receiver;
Object*** argv = reinterpret_cast<Object***>(args);
if (FLAG_profile_deserialization) PrintDeserializedCodeInfo(function);
value =
CALL_GENERATED_CODE(stub_entry, function_entry, func, recv, argc, argv);
}
......
......@@ -5465,6 +5465,7 @@ BOOL_ACCESSORS(SharedFunctionInfo,
has_duplicate_parameters,
kHasDuplicateParameters)
BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, asm_function, kIsAsmFunction)
BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, deserialized, kDeserialized)
#if V8_HOST_ARCH_32_BIT
......
......@@ -6821,6 +6821,9 @@ class SharedFunctionInfo: public HeapObject {
// Indicates that this function is an asm function.
DECL_BOOLEAN_ACCESSORS(asm_function)
// Indicates that the the shared function info is deserialized from cache.
DECL_BOOLEAN_ACCESSORS(deserialized)
inline FunctionKind kind();
inline void set_kind(FunctionKind kind);
......@@ -7053,6 +7056,7 @@ class SharedFunctionInfo: public HeapObject {
kIsGenerator,
kIsConciseMethod,
kIsAsmFunction,
kDeserialized,
kCompilerHintsCount // Pseudo entry
};
......
......@@ -2140,7 +2140,9 @@ Handle<SharedFunctionInfo> CodeSerializer::Deserialize(Isolate* isolate,
int length = data->length();
PrintF("[Deserializing from %d bytes took %0.3f ms]\n", length, ms);
}
return Handle<SharedFunctionInfo>(SharedFunctionInfo::cast(root), isolate);
Handle<SharedFunctionInfo> result(SharedFunctionInfo::cast(root), isolate);
result->set_deserialized(true);
return result;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment