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

Unified Diff: src/objects.h

Issue 20758002: Compilation type and state allocate an unnecessary Smi on v8::Script. (Closed) Base URL: https://chromium.googlesource.com/external/v8.git@master
Patch Set: rebaseline. Created 7 years, 5 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 | « src/liveedit.cc ('k') | src/objects-inl.h » ('j') | src/objects-inl.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 36611ee077710cdf4efebbc3beb8afe53bf17c52..37f94794598fe25440049bc66dd3904656796866 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -5849,11 +5849,14 @@ class Script: public Struct {
// [type]: the script type.
DECL_ACCESSORS(type, Smi)
- // [compilation]: how the the script was compiled.
- DECL_ACCESSORS(compilation_type, Smi)
+ // [compilation_type]: how the the script was compiled.
Michael Starzinger 2013/07/29 14:43:58 nit: Can we add a short sentence to the comment sa
Mike West 2013/07/29 14:52:12 Makes sense. Upcoming patchset does both.
+ inline CompilationType compilation_type();
+ inline void set_compilation_type(CompilationType type);
- // [is_compiled]: determines whether the script has already been compiled.
- DECL_ACCESSORS(compilation_state, Smi)
+ // [compilation_state]: determines whether the script has already been
+ // compiled.
Michael Starzinger 2013/07/29 14:43:58 Likewise.
Mike West 2013/07/29 14:52:12 Done.
+ inline CompilationState compilation_state();
+ inline void set_compilation_state(CompilationState state);
// [line_ends]: FixedArray of line ends positions.
DECL_ACCESSORS(line_ends, Object)
@@ -5866,6 +5869,9 @@ class Script: public Struct {
// function from which eval was called where eval was called.
DECL_ACCESSORS(eval_from_instructions_offset, Smi)
+ // [flags]: Holds an exciting bitfield.
+ DECL_ACCESSORS(flags, Smi)
+
static inline Script* cast(Object* obj);
// If script source is an external string, check that the underlying
@@ -5884,17 +5890,19 @@ class Script: public Struct {
static const int kContextOffset = kDataOffset + kPointerSize;
static const int kWrapperOffset = kContextOffset + kPointerSize;
static const int kTypeOffset = kWrapperOffset + kPointerSize;
- static const int kCompilationTypeOffset = kTypeOffset + kPointerSize;
- static const int kCompilationStateOffset =
- kCompilationTypeOffset + kPointerSize;
- static const int kLineEndsOffset = kCompilationStateOffset + kPointerSize;
+ static const int kLineEndsOffset = kTypeOffset + kPointerSize;
static const int kIdOffset = kLineEndsOffset + kPointerSize;
static const int kEvalFromSharedOffset = kIdOffset + kPointerSize;
static const int kEvalFrominstructionsOffsetOffset =
kEvalFromSharedOffset + kPointerSize;
- static const int kSize = kEvalFrominstructionsOffsetOffset + kPointerSize;
+ static const int kFlagsOffset =
+ kEvalFrominstructionsOffsetOffset + kPointerSize;
+ static const int kSize = kFlagsOffset + kPointerSize;
private:
+ static const int kCompilationTypeBit = 0;
Michael Starzinger 2013/07/29 14:43:58 nit: Lets add a one-liner comment "// Bit position
Mike West 2013/07/29 14:52:12 Done.
+ static const int kCompilationStateBit = 1;
+
DISALLOW_IMPLICIT_CONSTRUCTORS(Script);
};
« no previous file with comments | « src/liveedit.cc ('k') | src/objects-inl.h » ('j') | src/objects-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698