OLD | NEW |
---|---|
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 6909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6920 if (!function->has_initial_map() && | 6920 if (!function->has_initial_map() && |
6921 shared->IsInobjectSlackTrackingInProgress()) { | 6921 shared->IsInobjectSlackTrackingInProgress()) { |
6922 // The tracking is already in progress for another function. We can only | 6922 // The tracking is already in progress for another function. We can only |
6923 // track one initial_map at a time, so we force the completion before the | 6923 // track one initial_map at a time, so we force the completion before the |
6924 // function is called as a constructor for the first time. | 6924 // function is called as a constructor for the first time. |
6925 shared->CompleteInobjectSlackTracking(); | 6925 shared->CompleteInobjectSlackTracking(); |
6926 } | 6926 } |
6927 | 6927 |
6928 bool first_allocation = !shared->live_objects_may_exist(); | 6928 bool first_allocation = !shared->live_objects_may_exist(); |
6929 Handle<JSObject> result = Factory::NewJSObject(function); | 6929 Handle<JSObject> result = Factory::NewJSObject(function); |
6930 RETURN_IF_EMPTY_HANDLE(result); | |
Mads Ager (chromium)
2011/02/17 20:55:41
Shouldn't we be able to create a test case for thi
antonm
2011/02/18 10:40:28
I quickly inspected the code and apparently now it
| |
6930 // Delay setting the stub if inobject slack tracking is in progress. | 6931 // Delay setting the stub if inobject slack tracking is in progress. |
6931 if (first_allocation && !shared->IsInobjectSlackTrackingInProgress()) { | 6932 if (first_allocation && !shared->IsInobjectSlackTrackingInProgress()) { |
6932 TrySettingInlineConstructStub(function); | 6933 TrySettingInlineConstructStub(function); |
6933 } | 6934 } |
6934 | 6935 |
6935 Counters::constructed_objects.Increment(); | 6936 Counters::constructed_objects.Increment(); |
6936 Counters::constructed_objects_runtime.Increment(); | 6937 Counters::constructed_objects_runtime.Increment(); |
6937 | 6938 |
6938 return *result; | 6939 return *result; |
6939 } | 6940 } |
(...skipping 4261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
11201 } else { | 11202 } else { |
11202 // Handle last resort GC and make sure to allow future allocations | 11203 // Handle last resort GC and make sure to allow future allocations |
11203 // to grow the heap without causing GCs (if possible). | 11204 // to grow the heap without causing GCs (if possible). |
11204 Counters::gc_last_resort_from_js.Increment(); | 11205 Counters::gc_last_resort_from_js.Increment(); |
11205 Heap::CollectAllGarbage(false); | 11206 Heap::CollectAllGarbage(false); |
11206 } | 11207 } |
11207 } | 11208 } |
11208 | 11209 |
11209 | 11210 |
11210 } } // namespace v8::internal | 11211 } } // namespace v8::internal |
OLD | NEW |