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

Side by Side Diff: src/objects.h

Issue 21062004: Revert 15940: "Compilation type and state allocate an unnecessary Smi on v8::Script." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 | Annotate | Revision Log
« 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
5852 // [line_ends]: FixedArray of line ends positions. 5858 // [line_ends]: FixedArray of line ends positions.
5853 DECL_ACCESSORS(line_ends, Object) 5859 DECL_ACCESSORS(line_ends, Object)
5854 5860
5855 // [eval_from_shared]: for eval scripts the shared funcion info for the 5861 // [eval_from_shared]: for eval scripts the shared funcion info for the
5856 // function from which eval was called. 5862 // function from which eval was called.
5857 DECL_ACCESSORS(eval_from_shared, Object) 5863 DECL_ACCESSORS(eval_from_shared, Object)
5858 5864
5859 // [eval_from_instructions_offset]: the instruction offset in the code for the 5865 // [eval_from_instructions_offset]: the instruction offset in the code for the
5860 // function from which eval was called where eval was called. 5866 // function from which eval was called where eval was called.
5861 DECL_ACCESSORS(eval_from_instructions_offset, Smi) 5867 DECL_ACCESSORS(eval_from_instructions_offset, Smi)
5862 5868
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
5876 static inline Script* cast(Object* obj); 5869 static inline Script* cast(Object* obj);
5877 5870
5878 // If script source is an external string, check that the underlying 5871 // If script source is an external string, check that the underlying
5879 // resource is accessible. Otherwise, always return true. 5872 // resource is accessible. Otherwise, always return true.
5880 inline bool HasValidSource(); 5873 inline bool HasValidSource();
5881 5874
5882 // Dispatched behavior. 5875 // Dispatched behavior.
5883 DECLARE_PRINTER(Script) 5876 DECLARE_PRINTER(Script)
5884 DECLARE_VERIFIER(Script) 5877 DECLARE_VERIFIER(Script)
5885 5878
5886 static const int kSourceOffset = HeapObject::kHeaderSize; 5879 static const int kSourceOffset = HeapObject::kHeaderSize;
5887 static const int kNameOffset = kSourceOffset + kPointerSize; 5880 static const int kNameOffset = kSourceOffset + kPointerSize;
5888 static const int kLineOffsetOffset = kNameOffset + kPointerSize; 5881 static const int kLineOffsetOffset = kNameOffset + kPointerSize;
5889 static const int kColumnOffsetOffset = kLineOffsetOffset + kPointerSize; 5882 static const int kColumnOffsetOffset = kLineOffsetOffset + kPointerSize;
5890 static const int kDataOffset = kColumnOffsetOffset + kPointerSize; 5883 static const int kDataOffset = kColumnOffsetOffset + kPointerSize;
5891 static const int kContextOffset = kDataOffset + kPointerSize; 5884 static const int kContextOffset = kDataOffset + kPointerSize;
5892 static const int kWrapperOffset = kContextOffset + kPointerSize; 5885 static const int kWrapperOffset = kContextOffset + kPointerSize;
5893 static const int kTypeOffset = kWrapperOffset + kPointerSize; 5886 static const int kTypeOffset = kWrapperOffset + kPointerSize;
5894 static const int kLineEndsOffset = kTypeOffset + kPointerSize; 5887 static const int kCompilationTypeOffset = kTypeOffset + kPointerSize;
5888 static const int kCompilationStateOffset =
5889 kCompilationTypeOffset + kPointerSize;
5890 static const int kLineEndsOffset = kCompilationStateOffset + kPointerSize;
5895 static const int kIdOffset = kLineEndsOffset + kPointerSize; 5891 static const int kIdOffset = kLineEndsOffset + kPointerSize;
5896 static const int kEvalFromSharedOffset = kIdOffset + kPointerSize; 5892 static const int kEvalFromSharedOffset = kIdOffset + kPointerSize;
5897 static const int kEvalFrominstructionsOffsetOffset = 5893 static const int kEvalFrominstructionsOffsetOffset =
5898 kEvalFromSharedOffset + kPointerSize; 5894 kEvalFromSharedOffset + kPointerSize;
5899 static const int kFlagsOffset = 5895 static const int kSize = kEvalFrominstructionsOffsetOffset + kPointerSize;
5900 kEvalFrominstructionsOffsetOffset + kPointerSize;
5901 static const int kSize = kFlagsOffset + kPointerSize;
5902 5896
5903 private: 5897 private:
5904 // Bit positions in the flags field.
5905 static const int kCompilationTypeBit = 0;
5906 static const int kCompilationStateBit = 1;
5907
5908 DISALLOW_IMPLICIT_CONSTRUCTORS(Script); 5898 DISALLOW_IMPLICIT_CONSTRUCTORS(Script);
5909 }; 5899 };
5910 5900
5911 5901
5912 // List of builtin functions we want to identify to improve code 5902 // List of builtin functions we want to identify to improve code
5913 // generation. 5903 // generation.
5914 // 5904 //
5915 // Each entry has a name of a global object property holding an object 5905 // Each entry has a name of a global object property holding an object
5916 // optionally followed by ".prototype", a name of a builtin function 5906 // optionally followed by ".prototype", a name of a builtin function
5917 // on the object (the one the id is set for), and a label. 5907 // 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
9889 } else { 9879 } else {
9890 value &= ~(1 << bit_position); 9880 value &= ~(1 << bit_position);
9891 } 9881 }
9892 return value; 9882 return value;
9893 } 9883 }
9894 }; 9884 };
9895 9885
9896 } } // namespace v8::internal 9886 } } // namespace v8::internal
9897 9887
9898 #endif // V8_OBJECTS_H_ 9888 #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