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

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: feedback. 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
« no previous file with comments | « src/liveedit.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
5853 DECL_ACCESSORS(compilation_type, Smi)
5854
5855 // [is_compiled]: determines whether the script has already been compiled.
5856 DECL_ACCESSORS(compilation_state, Smi)
5857
5858 // [line_ends]: FixedArray of line ends positions. 5852 // [line_ends]: FixedArray of line ends positions.
5859 DECL_ACCESSORS(line_ends, Object) 5853 DECL_ACCESSORS(line_ends, Object)
5860 5854
5861 // [eval_from_shared]: for eval scripts the shared funcion info for the 5855 // [eval_from_shared]: for eval scripts the shared funcion info for the
5862 // function from which eval was called. 5856 // function from which eval was called.
5863 DECL_ACCESSORS(eval_from_shared, Object) 5857 DECL_ACCESSORS(eval_from_shared, Object)
5864 5858
5865 // [eval_from_instructions_offset]: the instruction offset in the code for the 5859 // [eval_from_instructions_offset]: the instruction offset in the code for the
5866 // function from which eval was called where eval was called. 5860 // function from which eval was called where eval was called.
5867 DECL_ACCESSORS(eval_from_instructions_offset, Smi) 5861 DECL_ACCESSORS(eval_from_instructions_offset, Smi)
5868 5862
5863 // [flags]: Holds an exciting bitfield.
5864 DECL_ACCESSORS(flags, Smi)
5865
5866 // [compilation_type]: how the the script was compiled. Encoded in the
5867 // 'flags' field.
5868 inline CompilationType compilation_type();
5869 inline void set_compilation_type(CompilationType type);
5870
5871 // [compilation_state]: determines whether the script has already been
5872 // compiled. Encoded in the 'flags' field.
5873 inline CompilationState compilation_state();
5874 inline void set_compilation_state(CompilationState state);
5875
5869 static inline Script* cast(Object* obj); 5876 static inline Script* cast(Object* obj);
5870 5877
5871 // If script source is an external string, check that the underlying 5878 // If script source is an external string, check that the underlying
5872 // resource is accessible. Otherwise, always return true. 5879 // resource is accessible. Otherwise, always return true.
5873 inline bool HasValidSource(); 5880 inline bool HasValidSource();
5874 5881
5875 // Dispatched behavior. 5882 // Dispatched behavior.
5876 DECLARE_PRINTER(Script) 5883 DECLARE_PRINTER(Script)
5877 DECLARE_VERIFIER(Script) 5884 DECLARE_VERIFIER(Script)
5878 5885
5879 static const int kSourceOffset = HeapObject::kHeaderSize; 5886 static const int kSourceOffset = HeapObject::kHeaderSize;
5880 static const int kNameOffset = kSourceOffset + kPointerSize; 5887 static const int kNameOffset = kSourceOffset + kPointerSize;
5881 static const int kLineOffsetOffset = kNameOffset + kPointerSize; 5888 static const int kLineOffsetOffset = kNameOffset + kPointerSize;
5882 static const int kColumnOffsetOffset = kLineOffsetOffset + kPointerSize; 5889 static const int kColumnOffsetOffset = kLineOffsetOffset + kPointerSize;
5883 static const int kDataOffset = kColumnOffsetOffset + kPointerSize; 5890 static const int kDataOffset = kColumnOffsetOffset + kPointerSize;
5884 static const int kContextOffset = kDataOffset + kPointerSize; 5891 static const int kContextOffset = kDataOffset + kPointerSize;
5885 static const int kWrapperOffset = kContextOffset + kPointerSize; 5892 static const int kWrapperOffset = kContextOffset + kPointerSize;
5886 static const int kTypeOffset = kWrapperOffset + kPointerSize; 5893 static const int kTypeOffset = kWrapperOffset + kPointerSize;
5887 static const int kCompilationTypeOffset = kTypeOffset + kPointerSize; 5894 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; 5895 static const int kIdOffset = kLineEndsOffset + kPointerSize;
5892 static const int kEvalFromSharedOffset = kIdOffset + kPointerSize; 5896 static const int kEvalFromSharedOffset = kIdOffset + kPointerSize;
5893 static const int kEvalFrominstructionsOffsetOffset = 5897 static const int kEvalFrominstructionsOffsetOffset =
5894 kEvalFromSharedOffset + kPointerSize; 5898 kEvalFromSharedOffset + kPointerSize;
5895 static const int kSize = kEvalFrominstructionsOffsetOffset + kPointerSize; 5899 static const int kFlagsOffset =
5900 kEvalFrominstructionsOffsetOffset + kPointerSize;
5901 static const int kSize = kFlagsOffset + kPointerSize;
5896 5902
5897 private: 5903 private:
5904 // Bit positions in the flags field.
5905 static const int kCompilationTypeBit = 0;
5906 static const int kCompilationStateBit = 1;
5907
5898 DISALLOW_IMPLICIT_CONSTRUCTORS(Script); 5908 DISALLOW_IMPLICIT_CONSTRUCTORS(Script);
5899 }; 5909 };
5900 5910
5901 5911
5902 // List of builtin functions we want to identify to improve code 5912 // List of builtin functions we want to identify to improve code
5903 // generation. 5913 // generation.
5904 // 5914 //
5905 // Each entry has a name of a global object property holding an object 5915 // Each entry has a name of a global object property holding an object
5906 // optionally followed by ".prototype", a name of a builtin function 5916 // optionally followed by ".prototype", a name of a builtin function
5907 // on the object (the one the id is set for), and a label. 5917 // 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 { 9889 } else {
9880 value &= ~(1 << bit_position); 9890 value &= ~(1 << bit_position);
9881 } 9891 }
9882 return value; 9892 return value;
9883 } 9893 }
9884 }; 9894 };
9885 9895
9886 } } // namespace v8::internal 9896 } } // namespace v8::internal
9887 9897
9888 #endif // V8_OBJECTS_H_ 9898 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/liveedit.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698