Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 437 static Object* AllocateFunctionContext(int length, JSFunction* closure); | 437 static Object* AllocateFunctionContext(int length, JSFunction* closure); |
| 438 | 438 |
| 439 // Allocate a 'with' context. | 439 // Allocate a 'with' context. |
| 440 static Object* AllocateWithContext(Context* previous, | 440 static Object* AllocateWithContext(Context* previous, |
| 441 JSObject* extension, | 441 JSObject* extension, |
| 442 bool is_catch_context); | 442 bool is_catch_context); |
| 443 | 443 |
| 444 // Allocates a new utility object in the old generation. | 444 // Allocates a new utility object in the old generation. |
| 445 static Object* AllocateStruct(InstanceType type); | 445 static Object* AllocateStruct(InstanceType type); |
| 446 | 446 |
| 447 | |
| 448 // Initializes a function with a shared part and prototype. | |
| 449 // Returns the function. | |
| 450 // Note: this code was factored out of AllocateFunction such that | |
| 451 // other parts of the VM could use it. Specifically, a function that creates | |
| 452 // instances of type JS_FUNCTION_TYPE benefit from the use of this function. | |
| 453 // Please note this does not perform a garbage collection. | |
| 454 static Object* InitializeFunction(JSFunction* function, | |
| 455 SharedFunctionInfo* shared, | |
| 456 Object* prototype); | |
| 457 | |
| 458 // Allocates a function initialized with a shared part. | 447 // Allocates a function initialized with a shared part. |
| 459 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | 448 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
| 460 // failed. | 449 // failed. |
| 461 // Please note this does not perform a garbage collection. | 450 // Please note this does not perform a garbage collection. |
| 462 static Object* AllocateFunction(Map* function_map, | 451 static Object* AllocateFunction(Map* function_map, |
| 463 SharedFunctionInfo* shared, | 452 SharedFunctionInfo* shared, |
| 464 Object* prototype); | 453 Object* prototype); |
| 465 | 454 |
| 466 // Indicies for direct access into argument objects. | 455 // Indicies for direct access into argument objects. |
| 467 static const int arguments_callee_index = 0; | 456 static const int arguments_callee_index = 0; |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 977 // Rebuild remembered set in an old space. | 966 // Rebuild remembered set in an old space. |
| 978 static void RebuildRSets(PagedSpace* space); | 967 static void RebuildRSets(PagedSpace* space); |
| 979 | 968 |
| 980 // Rebuild remembered set in the large object space. | 969 // Rebuild remembered set in the large object space. |
| 981 static void RebuildRSets(LargeObjectSpace* space); | 970 static void RebuildRSets(LargeObjectSpace* space); |
| 982 | 971 |
| 983 // Slow part of scavenge object. | 972 // Slow part of scavenge object. |
| 984 static void ScavengeObjectSlow(HeapObject** p, HeapObject* object); | 973 static void ScavengeObjectSlow(HeapObject** p, HeapObject* object); |
| 985 | 974 |
| 986 // Copy memory from src to dst. | 975 // Copy memory from src to dst. |
| 987 inline static void CopyBlock(Object** dst, Object** src, int byte_size); | 976 inline static void CopyBlock(Object** dst, Object** src, int byte_size); |
|
Mads Ager (chromium)
2009/06/22 08:00:18
This is not your code, but could you make this 'st
| |
| 988 | 977 |
| 978 // Initializes a function with a shared part and prototype. | |
| 979 // Returns the function. | |
| 980 // Note: this code was factored out of AllocateFunction such that | |
| 981 // other parts of the VM could use it. Specifically, a function that creates | |
| 982 // instances of type JS_FUNCTION_TYPE benefit from the use of this function. | |
| 983 // Please note this does not perform a garbage collection. | |
| 984 static inline Object* InitializeFunction(JSFunction* function, | |
| 985 SharedFunctionInfo* shared, | |
| 986 Object* prototype); | |
| 987 | |
| 989 static const int kInitialSymbolTableSize = 2048; | 988 static const int kInitialSymbolTableSize = 2048; |
| 990 static const int kInitialEvalCacheSize = 64; | 989 static const int kInitialEvalCacheSize = 64; |
| 991 | 990 |
| 992 friend class Factory; | 991 friend class Factory; |
| 993 friend class DisallowAllocationFailure; | 992 friend class DisallowAllocationFailure; |
| 994 friend class AlwaysAllocateScope; | 993 friend class AlwaysAllocateScope; |
| 995 }; | 994 }; |
| 996 | 995 |
| 997 | 996 |
| 998 class AlwaysAllocateScope { | 997 class AlwaysAllocateScope { |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1328 int marked_count_; | 1327 int marked_count_; |
| 1329 | 1328 |
| 1330 // The count from the end of the previous full GC. Will be zero if there | 1329 // The count from the end of the previous full GC. Will be zero if there |
| 1331 // was no previous full GC. | 1330 // was no previous full GC. |
| 1332 int previous_marked_count_; | 1331 int previous_marked_count_; |
| 1333 }; | 1332 }; |
| 1334 | 1333 |
| 1335 } } // namespace v8::internal | 1334 } } // namespace v8::internal |
| 1336 | 1335 |
| 1337 #endif // V8_HEAP_H_ | 1336 #endif // V8_HEAP_H_ |
| OLD | NEW |