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

Side by Side 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, 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 5831 matching lines...) Expand 10 before | Expand all | Expand 10 after
5842 5842
5843 // [context_data]: context data for the context this script was compiled in. 5843 // [context_data]: context data for the context this script was compiled in.
5844 DECL_ACCESSORS(context_data, Object) 5844 DECL_ACCESSORS(context_data, Object)
5845 5845
5846 // [wrapper]: the wrapper cache. 5846 // [wrapper]: the wrapper cache.
5847 DECL_ACCESSORS(wrapper, Foreign) 5847 DECL_ACCESSORS(wrapper, Foreign)
5848 5848
5849 // [type]: the script type. 5849 // [type]: the script type.
5850 DECL_ACCESSORS(type, Smi) 5850 DECL_ACCESSORS(type, Smi)
5851 5851
5852 // [compilation]: how the the script was compiled. 5852 // [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.
5853 DECL_ACCESSORS(compilation_type, Smi) 5853 inline CompilationType compilation_type();
5854 inline void set_compilation_type(CompilationType type);
5854 5855
5855 // [is_compiled]: determines whether the script has already been compiled. 5856 // [compilation_state]: determines whether the script has already been
5856 DECL_ACCESSORS(compilation_state, Smi) 5857 // compiled.
Michael Starzinger 2013/07/29 14:43:58 Likewise.
Mike West 2013/07/29 14:52:12 Done.
5858 inline CompilationState compilation_state();
5859 inline void set_compilation_state(CompilationState state);
5857 5860
5858 // [line_ends]: FixedArray of line ends positions. 5861 // [line_ends]: FixedArray of line ends positions.
5859 DECL_ACCESSORS(line_ends, Object) 5862 DECL_ACCESSORS(line_ends, Object)
5860 5863
5861 // [eval_from_shared]: for eval scripts the shared funcion info for the 5864 // [eval_from_shared]: for eval scripts the shared funcion info for the
5862 // function from which eval was called. 5865 // function from which eval was called.
5863 DECL_ACCESSORS(eval_from_shared, Object) 5866 DECL_ACCESSORS(eval_from_shared, Object)
5864 5867
5865 // [eval_from_instructions_offset]: the instruction offset in the code for the 5868 // [eval_from_instructions_offset]: the instruction offset in the code for the
5866 // function from which eval was called where eval was called. 5869 // function from which eval was called where eval was called.
5867 DECL_ACCESSORS(eval_from_instructions_offset, Smi) 5870 DECL_ACCESSORS(eval_from_instructions_offset, Smi)
5868 5871
5872 // [flags]: Holds an exciting bitfield.
5873 DECL_ACCESSORS(flags, Smi)
5874
5869 static inline Script* cast(Object* obj); 5875 static inline Script* cast(Object* obj);
5870 5876
5871 // If script source is an external string, check that the underlying 5877 // If script source is an external string, check that the underlying
5872 // resource is accessible. Otherwise, always return true. 5878 // resource is accessible. Otherwise, always return true.
5873 inline bool HasValidSource(); 5879 inline bool HasValidSource();
5874 5880
5875 // Dispatched behavior. 5881 // Dispatched behavior.
5876 DECLARE_PRINTER(Script) 5882 DECLARE_PRINTER(Script)
5877 DECLARE_VERIFIER(Script) 5883 DECLARE_VERIFIER(Script)
5878 5884
5879 static const int kSourceOffset = HeapObject::kHeaderSize; 5885 static const int kSourceOffset = HeapObject::kHeaderSize;
5880 static const int kNameOffset = kSourceOffset + kPointerSize; 5886 static const int kNameOffset = kSourceOffset + kPointerSize;
5881 static const int kLineOffsetOffset = kNameOffset + kPointerSize; 5887 static const int kLineOffsetOffset = kNameOffset + kPointerSize;
5882 static const int kColumnOffsetOffset = kLineOffsetOffset + kPointerSize; 5888 static const int kColumnOffsetOffset = kLineOffsetOffset + kPointerSize;
5883 static const int kDataOffset = kColumnOffsetOffset + kPointerSize; 5889 static const int kDataOffset = kColumnOffsetOffset + kPointerSize;
5884 static const int kContextOffset = kDataOffset + kPointerSize; 5890 static const int kContextOffset = kDataOffset + kPointerSize;
5885 static const int kWrapperOffset = kContextOffset + kPointerSize; 5891 static const int kWrapperOffset = kContextOffset + kPointerSize;
5886 static const int kTypeOffset = kWrapperOffset + kPointerSize; 5892 static const int kTypeOffset = kWrapperOffset + kPointerSize;
5887 static const int kCompilationTypeOffset = kTypeOffset + kPointerSize; 5893 static const int kLineEndsOffset = kTypeOffset + kPointerSize;
5888 static const int kCompilationStateOffset =
5889 kCompilationTypeOffset + kPointerSize;
5890 static const int kLineEndsOffset = kCompilationStateOffset + kPointerSize;
5891 static const int kIdOffset = kLineEndsOffset + kPointerSize; 5894 static const int kIdOffset = kLineEndsOffset + kPointerSize;
5892 static const int kEvalFromSharedOffset = kIdOffset + kPointerSize; 5895 static const int kEvalFromSharedOffset = kIdOffset + kPointerSize;
5893 static const int kEvalFrominstructionsOffsetOffset = 5896 static const int kEvalFrominstructionsOffsetOffset =
5894 kEvalFromSharedOffset + kPointerSize; 5897 kEvalFromSharedOffset + kPointerSize;
5895 static const int kSize = kEvalFrominstructionsOffsetOffset + kPointerSize; 5898 static const int kFlagsOffset =
5899 kEvalFrominstructionsOffsetOffset + kPointerSize;
5900 static const int kSize = kFlagsOffset + kPointerSize;
5896 5901
5897 private: 5902 private:
5903 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.
5904 static const int kCompilationStateBit = 1;
5905
5898 DISALLOW_IMPLICIT_CONSTRUCTORS(Script); 5906 DISALLOW_IMPLICIT_CONSTRUCTORS(Script);
5899 }; 5907 };
5900 5908
5901 5909
5902 // List of builtin functions we want to identify to improve code 5910 // List of builtin functions we want to identify to improve code
5903 // generation. 5911 // generation.
5904 // 5912 //
5905 // Each entry has a name of a global object property holding an object 5913 // Each entry has a name of a global object property holding an object
5906 // optionally followed by ".prototype", a name of a builtin function 5914 // optionally followed by ".prototype", a name of a builtin function
5907 // on the object (the one the id is set for), and a label. 5915 // on the object (the one the id is set for), and a label.
(...skipping 3971 matching lines...) Expand 10 before | Expand all | Expand 10 after
9879 } else { 9887 } else {
9880 value &= ~(1 << bit_position); 9888 value &= ~(1 << bit_position);
9881 } 9889 }
9882 return value; 9890 return value;
9883 } 9891 }
9884 }; 9892 };
9885 9893
9886 } } // namespace v8::internal 9894 } } // namespace v8::internal
9887 9895
9888 #endif // V8_OBJECTS_H_ 9896 #endif // V8_OBJECTS_H_
OLDNEW
« 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