OLD | NEW |
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 6567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6578 // [compilation_type]: how the the script was compiled. Encoded in the | 6578 // [compilation_type]: how the the script was compiled. Encoded in the |
6579 // 'flags' field. | 6579 // 'flags' field. |
6580 inline CompilationType compilation_type(); | 6580 inline CompilationType compilation_type(); |
6581 inline void set_compilation_type(CompilationType type); | 6581 inline void set_compilation_type(CompilationType type); |
6582 | 6582 |
6583 // [compilation_state]: determines whether the script has already been | 6583 // [compilation_state]: determines whether the script has already been |
6584 // compiled. Encoded in the 'flags' field. | 6584 // compiled. Encoded in the 'flags' field. |
6585 inline CompilationState compilation_state(); | 6585 inline CompilationState compilation_state(); |
6586 inline void set_compilation_state(CompilationState state); | 6586 inline void set_compilation_state(CompilationState state); |
6587 | 6587 |
| 6588 // [is_debugger_script]: An opaque boolean set by the embedder via |
| 6589 // ScriptOrigin, and used by the embedder to make decisions about the |
| 6590 // script's origin. V8 just passes this through. Encoded in |
| 6591 // the 'flags' field. |
| 6592 DECL_BOOLEAN_ACCESSORS(is_debugger_script) |
| 6593 |
6588 // [is_shared_cross_origin]: An opaque boolean set by the embedder via | 6594 // [is_shared_cross_origin]: An opaque boolean set by the embedder via |
6589 // ScriptOrigin, and used by the embedder to make decisions about the | 6595 // ScriptOrigin, and used by the embedder to make decisions about the |
6590 // script's level of privilege. V8 just passes this through. Encoded in | 6596 // script's level of privilege. V8 just passes this through. Encoded in |
6591 // the 'flags' field. | 6597 // the 'flags' field. |
6592 DECL_BOOLEAN_ACCESSORS(is_shared_cross_origin) | 6598 DECL_BOOLEAN_ACCESSORS(is_shared_cross_origin) |
6593 | 6599 |
6594 DECLARE_CAST(Script) | 6600 DECLARE_CAST(Script) |
6595 | 6601 |
6596 // If script source is an external string, check that the underlying | 6602 // If script source is an external string, check that the underlying |
6597 // resource is accessible. Otherwise, always return true. | 6603 // resource is accessible. Otherwise, always return true. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6634 static const int kSourceUrlOffset = kFlagsOffset + kPointerSize; | 6640 static const int kSourceUrlOffset = kFlagsOffset + kPointerSize; |
6635 static const int kSourceMappingUrlOffset = kSourceUrlOffset + kPointerSize; | 6641 static const int kSourceMappingUrlOffset = kSourceUrlOffset + kPointerSize; |
6636 static const int kSize = kSourceMappingUrlOffset + kPointerSize; | 6642 static const int kSize = kSourceMappingUrlOffset + kPointerSize; |
6637 | 6643 |
6638 private: | 6644 private: |
6639 int GetLineNumberWithArray(int code_pos); | 6645 int GetLineNumberWithArray(int code_pos); |
6640 | 6646 |
6641 // Bit positions in the flags field. | 6647 // Bit positions in the flags field. |
6642 static const int kCompilationTypeBit = 0; | 6648 static const int kCompilationTypeBit = 0; |
6643 static const int kCompilationStateBit = 1; | 6649 static const int kCompilationStateBit = 1; |
6644 static const int kIsSharedCrossOriginBit = 2; | 6650 static const int kIsDebuggerScriptBit = 2; |
| 6651 static const int kIsSharedCrossOriginBit = 3; |
6645 | 6652 |
6646 DISALLOW_IMPLICIT_CONSTRUCTORS(Script); | 6653 DISALLOW_IMPLICIT_CONSTRUCTORS(Script); |
6647 }; | 6654 }; |
6648 | 6655 |
6649 | 6656 |
6650 // List of builtin functions we want to identify to improve code | 6657 // List of builtin functions we want to identify to improve code |
6651 // generation. | 6658 // generation. |
6652 // | 6659 // |
6653 // Each entry has a name of a global object property holding an object | 6660 // Each entry has a name of a global object property holding an object |
6654 // optionally followed by ".prototype", a name of a builtin function | 6661 // optionally followed by ".prototype", a name of a builtin function |
(...skipping 4278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10933 } else { | 10940 } else { |
10934 value &= ~(1 << bit_position); | 10941 value &= ~(1 << bit_position); |
10935 } | 10942 } |
10936 return value; | 10943 return value; |
10937 } | 10944 } |
10938 }; | 10945 }; |
10939 | 10946 |
10940 } } // namespace v8::internal | 10947 } } // namespace v8::internal |
10941 | 10948 |
10942 #endif // V8_OBJECTS_H_ | 10949 #endif // V8_OBJECTS_H_ |
OLD | NEW |