OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 boilerplate->map()->unused_property_fields()); | 427 boilerplate->map()->unused_property_fields()); |
428 } | 428 } |
429 | 429 |
430 return boilerplate; | 430 return boilerplate; |
431 } | 431 } |
432 | 432 |
433 | 433 |
434 static const int kSmiOnlyLiteralMinimumLength = 1024; | 434 static const int kSmiOnlyLiteralMinimumLength = 1024; |
435 | 435 |
436 | 436 |
437 // static | |
438 Handle<Object> Runtime::CreateArrayLiteralBoilerplate( | 437 Handle<Object> Runtime::CreateArrayLiteralBoilerplate( |
439 Isolate* isolate, | 438 Isolate* isolate, |
440 Handle<FixedArray> literals, | 439 Handle<FixedArray> literals, |
441 Handle<FixedArray> elements) { | 440 Handle<FixedArray> elements) { |
442 // Create the JSArray. | 441 // Create the JSArray. |
443 Handle<JSFunction> constructor( | 442 Handle<JSFunction> constructor( |
444 JSFunction::GlobalContextFromLiterals(*literals)->array_function()); | 443 JSFunction::GlobalContextFromLiterals(*literals)->array_function()); |
445 Handle<JSArray> object = | 444 Handle<JSArray> object = |
446 Handle<JSArray>::cast(isolate->factory()->NewJSObject(constructor)); | 445 Handle<JSArray>::cast(isolate->factory()->NewJSObject(constructor)); |
447 | 446 |
(...skipping 13113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13561 } else { | 13560 } else { |
13562 // Handle last resort GC and make sure to allow future allocations | 13561 // Handle last resort GC and make sure to allow future allocations |
13563 // to grow the heap without causing GCs (if possible). | 13562 // to grow the heap without causing GCs (if possible). |
13564 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13563 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13565 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags); | 13564 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags); |
13566 } | 13565 } |
13567 } | 13566 } |
13568 | 13567 |
13569 | 13568 |
13570 } } // namespace v8::internal | 13569 } } // namespace v8::internal |
OLD | NEW |