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

Unified Diff: src/objects-inl.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: feedback. 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/objects.h ('k') | src/objects-printer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 3189d840304c7cbb5be807cc9b47c8ef470a9372..39799c3e722e5d63cbdd5ce840f836d07ea3ded1 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -4482,12 +4482,29 @@ ACCESSORS(Script, data, Object, kDataOffset)
ACCESSORS(Script, context_data, Object, kContextOffset)
ACCESSORS(Script, wrapper, Foreign, kWrapperOffset)
ACCESSORS_TO_SMI(Script, type, kTypeOffset)
-ACCESSORS_TO_SMI(Script, compilation_type, kCompilationTypeOffset)
-ACCESSORS_TO_SMI(Script, compilation_state, kCompilationStateOffset)
ACCESSORS(Script, line_ends, Object, kLineEndsOffset)
ACCESSORS(Script, eval_from_shared, Object, kEvalFromSharedOffset)
ACCESSORS_TO_SMI(Script, eval_from_instructions_offset,
kEvalFrominstructionsOffsetOffset)
+ACCESSORS_TO_SMI(Script, flags, kFlagsOffset);
+
+Script::CompilationType Script::compilation_type() {
+ return BooleanBit::get(flags(), kCompilationTypeBit) ?
+ COMPILATION_TYPE_EVAL : COMPILATION_TYPE_HOST;
+}
+void Script::set_compilation_type(CompilationType type) {
+ set_flags(BooleanBit::set(flags(), kCompilationTypeBit,
+ type == COMPILATION_TYPE_EVAL));
+}
+Script::CompilationState Script::compilation_state() {
+ return BooleanBit::get(flags(), kCompilationStateBit) ?
+ COMPILATION_STATE_COMPILED : COMPILATION_STATE_INITIAL;
+}
+void Script::set_compilation_state(CompilationState state) {
+ set_flags(BooleanBit::set(flags(), kCompilationStateBit,
+ state == COMPILATION_STATE_COMPILED));
+}
+
#ifdef ENABLE_DEBUGGER_SUPPORT
ACCESSORS(DebugInfo, shared, SharedFunctionInfo, kSharedFunctionInfoIndex)
« no previous file with comments | « src/objects.h ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698