Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1523)

Unified Diff: src/value-serializer.h

Issue 2232323004: Blink-compatible serialization of numbers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@vs1
Patch Set: for consistency, use sizeof(double) everywhere Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/value-serializer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/value-serializer.h
diff --git a/src/value-serializer.h b/src/value-serializer.h
index d3da52981b994ba5168d6ab5a26066fbfa811027..eedd91abc31f4c5d111664144293115c7116a855 100644
--- a/src/value-serializer.h
+++ b/src/value-serializer.h
@@ -16,9 +16,11 @@
namespace v8 {
namespace internal {
+class HeapNumber;
class Isolate;
class Object;
class Oddball;
+class Smi;
enum class SerializationTag : uint8_t;
@@ -54,9 +56,14 @@ class ValueSerializer {
void WriteTag(SerializationTag tag);
template <typename T>
void WriteVarint(T value);
+ template <typename T>
+ void WriteZigZag(T value);
+ void WriteDouble(double value);
// Writing V8 objects of various kinds.
void WriteOddball(Oddball* oddball);
+ void WriteSmi(Smi* smi);
+ void WriteHeapNumber(HeapNumber* number);
std::vector<uint8_t> buffer_;
@@ -86,6 +93,9 @@ class ValueDeserializer {
Maybe<SerializationTag> ReadTag() WARN_UNUSED_RESULT;
template <typename T>
Maybe<T> ReadVarint() WARN_UNUSED_RESULT;
+ template <typename T>
+ Maybe<T> ReadZigZag() WARN_UNUSED_RESULT;
+ Maybe<double> ReadDouble() WARN_UNUSED_RESULT;
Isolate* const isolate_;
const uint8_t* position_;
« no previous file with comments | « no previous file | src/value-serializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698