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

Side by Side Diff: src/objects.h

Issue 1140673002: [V8] Added Script::is_opaque flag for embedders (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 years, 7 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/debug.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 6720 matching lines...) Expand 10 before | Expand all | Expand 10 after
6731 // [compilation_type]: how the the script was compiled. Encoded in the 6731 // [compilation_type]: how the the script was compiled. Encoded in the
6732 // 'flags' field. 6732 // 'flags' field.
6733 inline CompilationType compilation_type(); 6733 inline CompilationType compilation_type();
6734 inline void set_compilation_type(CompilationType type); 6734 inline void set_compilation_type(CompilationType type);
6735 6735
6736 // [compilation_state]: determines whether the script has already been 6736 // [compilation_state]: determines whether the script has already been
6737 // compiled. Encoded in the 'flags' field. 6737 // compiled. Encoded in the 'flags' field.
6738 inline CompilationState compilation_state(); 6738 inline CompilationState compilation_state();
6739 inline void set_compilation_state(CompilationState state); 6739 inline void set_compilation_state(CompilationState state);
6740 6740
6741 // [is_embedder_debug_script]: An opaque boolean set by the embedder via 6741 // [origin_options]: optional attributes set by the embedder via ScriptOrigin,
6742 // ScriptOrigin, and used by the embedder to make decisions about the 6742 // and used by the embedder to make decisions about the script. V8 just passes
6743 // script's origin. V8 just passes this through. Encoded in 6743 // this through. Encoded in the 'flags' field.
6744 // the 'flags' field. 6744 inline v8::ScriptOriginOptions origin_options();
6745 DECL_BOOLEAN_ACCESSORS(is_embedder_debug_script) 6745 inline void set_origin_options(ScriptOriginOptions origin_options);
6746
6747 // [is_shared_cross_origin]: An opaque boolean set by the embedder via
6748 // ScriptOrigin, and used by the embedder to make decisions about the
6749 // script's level of privilege. V8 just passes this through. Encoded in
6750 // the 'flags' field.
6751 DECL_BOOLEAN_ACCESSORS(is_shared_cross_origin)
6752 6746
6753 DECLARE_CAST(Script) 6747 DECLARE_CAST(Script)
6754 6748
6755 // If script source is an external string, check that the underlying 6749 // If script source is an external string, check that the underlying
6756 // resource is accessible. Otherwise, always return true. 6750 // resource is accessible. Otherwise, always return true.
6757 inline bool HasValidSource(); 6751 inline bool HasValidSource();
6758 6752
6759 // Convert code position into column number. 6753 // Convert code position into column number.
6760 static int GetColumnNumber(Handle<Script> script, int code_pos); 6754 static int GetColumnNumber(Handle<Script> script, int code_pos);
6761 6755
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
6793 static const int kSourceUrlOffset = kFlagsOffset + kPointerSize; 6787 static const int kSourceUrlOffset = kFlagsOffset + kPointerSize;
6794 static const int kSourceMappingUrlOffset = kSourceUrlOffset + kPointerSize; 6788 static const int kSourceMappingUrlOffset = kSourceUrlOffset + kPointerSize;
6795 static const int kSize = kSourceMappingUrlOffset + kPointerSize; 6789 static const int kSize = kSourceMappingUrlOffset + kPointerSize;
6796 6790
6797 private: 6791 private:
6798 int GetLineNumberWithArray(int code_pos); 6792 int GetLineNumberWithArray(int code_pos);
6799 6793
6800 // Bit positions in the flags field. 6794 // Bit positions in the flags field.
6801 static const int kCompilationTypeBit = 0; 6795 static const int kCompilationTypeBit = 0;
6802 static const int kCompilationStateBit = 1; 6796 static const int kCompilationStateBit = 1;
6803 static const int kIsEmbedderDebugScriptBit = 2; 6797 static const int kOriginOptionsShift = 2;
6804 static const int kIsSharedCrossOriginBit = 3; 6798 static const int kOriginOptionsSize = 3;
6799 static const int kOriginOptionsMask = ((1 << kOriginOptionsSize) - 1)
6800 << kOriginOptionsShift;
6805 6801
6806 DISALLOW_IMPLICIT_CONSTRUCTORS(Script); 6802 DISALLOW_IMPLICIT_CONSTRUCTORS(Script);
6807 }; 6803 };
6808 6804
6809 6805
6810 // List of builtin functions we want to identify to improve code 6806 // List of builtin functions we want to identify to improve code
6811 // generation. 6807 // generation.
6812 // 6808 //
6813 // Each entry has a name of a global object property holding an object 6809 // Each entry has a name of a global object property holding an object
6814 // optionally followed by ".prototype", a name of a builtin function 6810 // optionally followed by ".prototype", a name of a builtin function
(...skipping 4301 matching lines...) Expand 10 before | Expand all | Expand 10 after
11116 } else { 11112 } else {
11117 value &= ~(1 << bit_position); 11113 value &= ~(1 << bit_position);
11118 } 11114 }
11119 return value; 11115 return value;
11120 } 11116 }
11121 }; 11117 };
11122 11118
11123 } } // namespace v8::internal 11119 } } // namespace v8::internal
11124 11120
11125 #endif // V8_OBJECTS_H_ 11121 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/debug.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698