OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 3271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3282 inline bool is_toplevel(); | 3282 inline bool is_toplevel(); |
3283 inline void set_is_toplevel(bool value); | 3283 inline void set_is_toplevel(bool value); |
3284 | 3284 |
3285 // Bit field containing various information collected by the compiler to | 3285 // Bit field containing various information collected by the compiler to |
3286 // drive optimization. | 3286 // drive optimization. |
3287 inline int compiler_hints(); | 3287 inline int compiler_hints(); |
3288 inline void set_compiler_hints(int value); | 3288 inline void set_compiler_hints(int value); |
3289 | 3289 |
3290 // Add information on assignments of the form this.x = ...; | 3290 // Add information on assignments of the form this.x = ...; |
3291 void SetThisPropertyAssignmentsInfo( | 3291 void SetThisPropertyAssignmentsInfo( |
3292 bool has_only_this_property_assignments, | |
3293 bool has_only_simple_this_property_assignments, | 3292 bool has_only_simple_this_property_assignments, |
3294 FixedArray* this_property_assignments); | 3293 FixedArray* this_property_assignments); |
3295 | 3294 |
3296 // Clear information on assignments of the form this.x = ...; | 3295 // Clear information on assignments of the form this.x = ...; |
3297 void ClearThisPropertyAssignmentsInfo(); | 3296 void ClearThisPropertyAssignmentsInfo(); |
3298 | 3297 |
3299 // Indicate that this function only consists of assignments of the form | 3298 // Indicate that this function only consists of assignments of the form |
3300 // this.x = ...;. | |
3301 inline bool has_only_this_property_assignments(); | |
3302 | |
3303 // Indicate that this function only consists of assignments of the form | |
3304 // this.x = y; where y is either a constant or refers to an argument. | 3299 // this.x = y; where y is either a constant or refers to an argument. |
3305 inline bool has_only_simple_this_property_assignments(); | 3300 inline bool has_only_simple_this_property_assignments(); |
3306 | 3301 |
3307 inline bool try_fast_codegen(); | 3302 inline bool try_fast_codegen(); |
3308 inline void set_try_fast_codegen(bool flag); | 3303 inline void set_try_fast_codegen(bool flag); |
3309 | 3304 |
3310 // For functions which only contains this property assignments this provides | 3305 // For functions which only contains this property assignments this provides |
3311 // access to the names for the properties assigned. | 3306 // access to the names for the properties assigned. |
3312 DECL_ACCESSORS(this_property_assignments, Object) | 3307 DECL_ACCESSORS(this_property_assignments, Object) |
3313 inline int this_property_assignments_count(); | 3308 inline int this_property_assignments_count(); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3378 | 3373 |
3379 // Bit positions in start_position_and_type. | 3374 // Bit positions in start_position_and_type. |
3380 // The source code start position is in the 30 most significant bits of | 3375 // The source code start position is in the 30 most significant bits of |
3381 // the start_position_and_type field. | 3376 // the start_position_and_type field. |
3382 static const int kIsExpressionBit = 0; | 3377 static const int kIsExpressionBit = 0; |
3383 static const int kIsTopLevelBit = 1; | 3378 static const int kIsTopLevelBit = 1; |
3384 static const int kStartPositionShift = 2; | 3379 static const int kStartPositionShift = 2; |
3385 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1); | 3380 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1); |
3386 | 3381 |
3387 // Bit positions in compiler_hints. | 3382 // Bit positions in compiler_hints. |
3388 static const int kHasOnlyThisPropertyAssignments = 0; | 3383 static const int kHasOnlySimpleThisPropertyAssignments = 0; |
3389 static const int kHasOnlySimpleThisPropertyAssignments = 1; | 3384 static const int kTryFastCodegen = 1; |
3390 static const int kTryFastCodegen = 2; | |
3391 | 3385 |
3392 DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo); | 3386 DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo); |
3393 }; | 3387 }; |
3394 | 3388 |
3395 | 3389 |
3396 // JSFunction describes JavaScript functions. | 3390 // JSFunction describes JavaScript functions. |
3397 class JSFunction: public JSObject { | 3391 class JSFunction: public JSObject { |
3398 public: | 3392 public: |
3399 // [prototype_or_initial_map]: | 3393 // [prototype_or_initial_map]: |
3400 DECL_ACCESSORS(prototype_or_initial_map, Object) | 3394 DECL_ACCESSORS(prototype_or_initial_map, Object) |
(...skipping 1621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5022 } else { | 5016 } else { |
5023 value &= ~(1 << bit_position); | 5017 value &= ~(1 << bit_position); |
5024 } | 5018 } |
5025 return value; | 5019 return value; |
5026 } | 5020 } |
5027 }; | 5021 }; |
5028 | 5022 |
5029 } } // namespace v8::internal | 5023 } } // namespace v8::internal |
5030 | 5024 |
5031 #endif // V8_OBJECTS_H_ | 5025 #endif // V8_OBJECTS_H_ |
OLD | NEW |