Index: third_party/protobuf/src/google/protobuf/compiler/java/java_message.h |
diff --git a/third_party/protobuf/src/google/protobuf/compiler/java/java_message.h b/third_party/protobuf/src/google/protobuf/compiler/java/java_message.h |
index be5bfb07546e908930a2907346c8a1c901ed4fc4..e9fc57c26aaaa1b4ad012c9a9139b5c5fb651c9c 100644 |
--- a/third_party/protobuf/src/google/protobuf/compiler/java/java_message.h |
+++ b/third_party/protobuf/src/google/protobuf/compiler/java/java_message.h |
@@ -56,6 +56,8 @@ namespace protobuf { |
namespace compiler { |
namespace java { |
+static const int kMaxStaticSize = 1 << 15; // aka 32k |
+ |
class MessageGenerator { |
public: |
explicit MessageGenerator(const Descriptor* descriptor); |
@@ -64,7 +66,8 @@ class MessageGenerator { |
// All static variables have to be declared at the top-level of the file |
// so that we can control initialization order, which is important for |
// DescriptorProto bootstrapping to work. |
- virtual void GenerateStaticVariables(io::Printer* printer) = 0; |
+ virtual void GenerateStaticVariables( |
+ io::Printer* printer, int* bytecode_estimate) = 0; |
// Output code which initializes the static variables generated by |
// GenerateStaticVariables(). Returns an estimate of bytecode size. |
@@ -96,14 +99,15 @@ class ImmutableMessageGenerator : public MessageGenerator { |
virtual void Generate(io::Printer* printer); |
virtual void GenerateInterface(io::Printer* printer); |
virtual void GenerateExtensionRegistrationCode(io::Printer* printer); |
- virtual void GenerateStaticVariables(io::Printer* printer); |
+ virtual void GenerateStaticVariables( |
+ io::Printer* printer, int* bytecode_estimate); |
// Returns an estimate of the number of bytes the printed code will compile to |
virtual int GenerateStaticVariableInitializers(io::Printer* printer); |
private: |
- void GenerateFieldAccessorTable(io::Printer* printer); |
+ void GenerateFieldAccessorTable(io::Printer* printer, int* bytecode_estimate); |
// Returns an estimate of the number of bytes the printed code will compile to |
int GenerateFieldAccessorTableInitializer(io::Printer* printer); |