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 4362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4373 } | 4373 } |
4374 } | 4374 } |
4375 | 4375 |
4376 bool first_allocation = !function->has_initial_map(); | 4376 bool first_allocation = !function->has_initial_map(); |
4377 Handle<JSObject> result = Factory::NewJSObject(function); | 4377 Handle<JSObject> result = Factory::NewJSObject(function); |
4378 if (first_allocation) { | 4378 if (first_allocation) { |
4379 Handle<Map> map = Handle<Map>(function->initial_map()); | 4379 Handle<Map> map = Handle<Map>(function->initial_map()); |
4380 Handle<Code> stub = ComputeConstructStub(map); | 4380 Handle<Code> stub = ComputeConstructStub(map); |
4381 function->shared()->set_construct_stub(*stub); | 4381 function->shared()->set_construct_stub(*stub); |
4382 } | 4382 } |
| 4383 Counters::constructed_objects.Increment(); |
| 4384 Counters::constructed_objects_runtime.Increment(); |
4383 return *result; | 4385 return *result; |
4384 } | 4386 } |
4385 | 4387 |
4386 | 4388 |
4387 static Object* Runtime_LazyCompile(Arguments args) { | 4389 static Object* Runtime_LazyCompile(Arguments args) { |
4388 HandleScope scope; | 4390 HandleScope scope; |
4389 ASSERT(args.length() == 1); | 4391 ASSERT(args.length() == 1); |
4390 | 4392 |
4391 Handle<JSFunction> function = args.at<JSFunction>(0); | 4393 Handle<JSFunction> function = args.at<JSFunction>(0); |
4392 #ifdef DEBUG | 4394 #ifdef DEBUG |
(...skipping 3237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7630 } else { | 7632 } else { |
7631 // Handle last resort GC and make sure to allow future allocations | 7633 // Handle last resort GC and make sure to allow future allocations |
7632 // to grow the heap without causing GCs (if possible). | 7634 // to grow the heap without causing GCs (if possible). |
7633 Counters::gc_last_resort_from_js.Increment(); | 7635 Counters::gc_last_resort_from_js.Increment(); |
7634 Heap::CollectAllGarbage(); | 7636 Heap::CollectAllGarbage(); |
7635 } | 7637 } |
7636 } | 7638 } |
7637 | 7639 |
7638 | 7640 |
7639 } } // namespace v8::internal | 7641 } } // namespace v8::internal |
OLD | NEW |