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 6811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6822 | 6822 |
6823 // Whether this function is defined in native code or extensions. | 6823 // Whether this function is defined in native code or extensions. |
6824 inline bool IsBuiltin(); | 6824 inline bool IsBuiltin(); |
6825 | 6825 |
6826 // Check whether or not this function is inlineable. | 6826 // Check whether or not this function is inlineable. |
6827 bool IsInlineable(); | 6827 bool IsInlineable(); |
6828 | 6828 |
6829 // Source size of this function. | 6829 // Source size of this function. |
6830 int SourceSize(); | 6830 int SourceSize(); |
6831 | 6831 |
| 6832 // Returns `false` if formal parameters include rest parameters, optional |
| 6833 // parameters, or destructuring parameters. |
| 6834 // TODO(caitp): make this a flag set during parsing |
6832 inline bool has_simple_parameters(); | 6835 inline bool has_simple_parameters(); |
6833 | 6836 |
6834 // Initialize a SharedFunctionInfo from a parsed function literal. | 6837 // Initialize a SharedFunctionInfo from a parsed function literal. |
6835 static void InitFromFunctionLiteral(Handle<SharedFunctionInfo> shared_info, | 6838 static void InitFromFunctionLiteral(Handle<SharedFunctionInfo> shared_info, |
6836 FunctionLiteral* lit); | 6839 FunctionLiteral* lit); |
6837 | 6840 |
6838 // Dispatched behavior. | 6841 // Dispatched behavior. |
6839 DECLARE_PRINTER(SharedFunctionInfo) | 6842 DECLARE_PRINTER(SharedFunctionInfo) |
6840 DECLARE_VERIFIER(SharedFunctionInfo) | 6843 DECLARE_VERIFIER(SharedFunctionInfo) |
6841 | 6844 |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7218 | 7221 |
7219 // [code]: The generated code object for this function. Executed | 7222 // [code]: The generated code object for this function. Executed |
7220 // when the function is invoked, e.g. foo() or new foo(). See | 7223 // when the function is invoked, e.g. foo() or new foo(). See |
7221 // [[Call]] and [[Construct]] description in ECMA-262, section | 7224 // [[Call]] and [[Construct]] description in ECMA-262, section |
7222 // 8.6.2, page 27. | 7225 // 8.6.2, page 27. |
7223 inline Code* code(); | 7226 inline Code* code(); |
7224 inline void set_code(Code* code); | 7227 inline void set_code(Code* code); |
7225 inline void set_code_no_write_barrier(Code* code); | 7228 inline void set_code_no_write_barrier(Code* code); |
7226 inline void ReplaceCode(Code* code); | 7229 inline void ReplaceCode(Code* code); |
7227 | 7230 |
7228 // Tells whether this function is builtin. | |
7229 inline bool IsBuiltin(); | |
7230 | |
7231 // Tells whether this function inlines the given shared function info. | 7231 // Tells whether this function inlines the given shared function info. |
7232 bool Inlines(SharedFunctionInfo* candidate); | 7232 bool Inlines(SharedFunctionInfo* candidate); |
7233 | 7233 |
7234 // Tells whether this function should be subject to debugging. | |
7235 inline bool IsSubjectToDebugging(); | |
7236 | |
7237 // Tells whether or not the function needs arguments adaption. | |
7238 inline bool NeedsArgumentsAdaption(); | |
7239 | |
7240 // Tells whether or not this function has been optimized. | 7234 // Tells whether or not this function has been optimized. |
7241 inline bool IsOptimized(); | 7235 inline bool IsOptimized(); |
7242 | 7236 |
7243 // Mark this function for lazy recompilation. The function will be | 7237 // Mark this function for lazy recompilation. The function will be |
7244 // recompiled the next time it is executed. | 7238 // recompiled the next time it is executed. |
7245 void MarkForOptimization(); | 7239 void MarkForOptimization(); |
7246 void AttemptConcurrentOptimization(); | 7240 void AttemptConcurrentOptimization(); |
7247 | 7241 |
7248 // Tells whether or not the function is already marked for lazy | 7242 // Tells whether or not the function is already marked for lazy |
7249 // recompilation. | 7243 // recompilation. |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7338 inline Object* instance_prototype(); | 7332 inline Object* instance_prototype(); |
7339 static void SetPrototype(Handle<JSFunction> function, | 7333 static void SetPrototype(Handle<JSFunction> function, |
7340 Handle<Object> value); | 7334 Handle<Object> value); |
7341 static void SetInstancePrototype(Handle<JSFunction> function, | 7335 static void SetInstancePrototype(Handle<JSFunction> function, |
7342 Handle<Object> value); | 7336 Handle<Object> value); |
7343 | 7337 |
7344 // After prototype is removed, it will not be created when accessed, and | 7338 // After prototype is removed, it will not be created when accessed, and |
7345 // [[Construct]] from this function will not be allowed. | 7339 // [[Construct]] from this function will not be allowed. |
7346 bool RemovePrototype(); | 7340 bool RemovePrototype(); |
7347 | 7341 |
7348 // Accessor for this function's initial map's [[class]] | |
7349 // property. This is primarily used by ECMA native functions. This | |
7350 // method sets the class_name field of this function's initial map | |
7351 // to a given value. It creates an initial map if this function does | |
7352 // not have one. Note that this method does not copy the initial map | |
7353 // if it has one already, but simply replaces it with the new value. | |
7354 // Instances created afterwards will have a map whose [[class]] is | |
7355 // set to 'value', but there is no guarantees on instances created | |
7356 // before. | |
7357 void SetInstanceClassName(String* name); | |
7358 | |
7359 // Returns if this function has been compiled to native code yet. | 7342 // Returns if this function has been compiled to native code yet. |
7360 inline bool is_compiled(); | 7343 inline bool is_compiled(); |
7361 | 7344 |
7362 // Returns `false` if formal parameters include rest parameters, optional | |
7363 // parameters, or destructuring parameters. | |
7364 // TODO(caitp): make this a flag set during parsing | |
7365 inline bool has_simple_parameters(); | |
7366 | |
7367 // [next_function_link]: Links functions into various lists, e.g. the list | 7345 // [next_function_link]: Links functions into various lists, e.g. the list |
7368 // of optimized functions hanging off the native_context. The CodeFlusher | 7346 // of optimized functions hanging off the native_context. The CodeFlusher |
7369 // uses this link to chain together flushing candidates. Treated weakly | 7347 // uses this link to chain together flushing candidates. Treated weakly |
7370 // by the garbage collector. | 7348 // by the garbage collector. |
7371 DECL_ACCESSORS(next_function_link, Object) | 7349 DECL_ACCESSORS(next_function_link, Object) |
7372 | 7350 |
7373 // Prints the name of the function using PrintF. | 7351 // Prints the name of the function using PrintF. |
7374 void PrintName(FILE* out = stdout); | 7352 void PrintName(FILE* out = stdout); |
7375 | 7353 |
7376 DECLARE_CAST(JSFunction) | 7354 DECLARE_CAST(JSFunction) |
(...skipping 3424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10801 // (elements + properties) in the current level. | 10779 // (elements + properties) in the current level. |
10802 int levelLength_ = 0; | 10780 int levelLength_ = 0; |
10803 | 10781 |
10804 DISALLOW_COPY_AND_ASSIGN(KeyAccumulator); | 10782 DISALLOW_COPY_AND_ASSIGN(KeyAccumulator); |
10805 }; | 10783 }; |
10806 | 10784 |
10807 } // NOLINT, false-positive due to second-order macros. | 10785 } // NOLINT, false-positive due to second-order macros. |
10808 } // NOLINT, false-positive due to second-order macros. | 10786 } // NOLINT, false-positive due to second-order macros. |
10809 | 10787 |
10810 #endif // V8_OBJECTS_H_ | 10788 #endif // V8_OBJECTS_H_ |
OLD | NEW |