Revision: 24543
Author:   [email protected]
Date:     Mon Oct 13 07:50:21 2014 UTC
Log:      Always include full reloc info to stubs for serialization.

[email protected]

Review URL: https://codereview.chromium.org/641643006
https://code.google.com/p/v8/source/detail?r=24543

Modified:
 /branches/bleeding_edge/src/code-stubs-hydrogen.cc
 /branches/bleeding_edge/src/code-stubs.cc
 /branches/bleeding_edge/src/execution.cc
 /branches/bleeding_edge/src/objects-inl.h
 /branches/bleeding_edge/src/objects.h
 /branches/bleeding_edge/src/serialize.cc

=======================================
--- /branches/bleeding_edge/src/code-stubs-hydrogen.cc Tue Oct 7 14:32:19 2014 UTC +++ /branches/bleeding_edge/src/code-stubs-hydrogen.cc Mon Oct 13 07:50:21 2014 UTC
@@ -233,6 +233,8 @@

     // 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);
   }
=======================================
--- /branches/bleeding_edge/src/code-stubs.cc   Wed Oct  8 09:15:09 2014 UTC
+++ /branches/bleeding_edge/src/code-stubs.cc   Mon Oct 13 07:50:21 2014 UTC
@@ -111,6 +111,8 @@

     // 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);
   }
=======================================
--- /branches/bleeding_edge/src/execution.cc    Mon Sep  1 09:11:44 2014 UTC
+++ /branches/bleeding_edge/src/execution.cc    Mon Oct 13 07:50:21 2014 UTC
@@ -32,6 +32,21 @@
   thread_local_.climit_ = thread_local_.real_climit_;
   isolate_->heap()->SetStackLimits();
 }
+
+
+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(
@@ -87,6 +102,7 @@
     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);
   }
=======================================
--- /branches/bleeding_edge/src/objects-inl.h   Wed Oct  1 13:14:14 2014 UTC
+++ /branches/bleeding_edge/src/objects-inl.h   Mon Oct 13 07:50:21 2014 UTC
@@ -5465,6 +5465,7 @@
                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
=======================================
--- /branches/bleeding_edge/src/objects.h       Fri Oct 10 13:27:52 2014 UTC
+++ /branches/bleeding_edge/src/objects.h       Mon Oct 13 07:50:21 2014 UTC
@@ -6821,6 +6821,9 @@
   // 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 @@
     kIsGenerator,
     kIsConciseMethod,
     kIsAsmFunction,
+    kDeserialized,
     kCompilerHintsCount  // Pseudo entry
   };

=======================================
--- /branches/bleeding_edge/src/serialize.cc    Fri Oct 10 10:51:34 2014 UTC
+++ /branches/bleeding_edge/src/serialize.cc    Mon Oct 13 07:50:21 2014 UTC
@@ -2140,7 +2140,9 @@
     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;
 }


--
--
v8-dev mailing list
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to