Chromium Code Reviews| 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 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 493 if (*boilerplate == isolate->heap()->undefined_value()) { | 493 if (*boilerplate == isolate->heap()->undefined_value()) { |
| 494 boilerplate = CreateObjectLiteralBoilerplate(isolate, | 494 boilerplate = CreateObjectLiteralBoilerplate(isolate, |
| 495 literals, | 495 literals, |
| 496 constant_properties, | 496 constant_properties, |
| 497 should_have_fast_elements, | 497 should_have_fast_elements, |
| 498 has_function_literal); | 498 has_function_literal); |
| 499 RETURN_IF_EMPTY_HANDLE(isolate, boilerplate); | 499 RETURN_IF_EMPTY_HANDLE(isolate, boilerplate); |
| 500 // Update the functions literal and return the boilerplate. | 500 // Update the functions literal and return the boilerplate. |
| 501 literals->set(literals_index, *boilerplate); | 501 literals->set(literals_index, *boilerplate); |
| 502 } | 502 } |
| 503 return JSObject::cast(*boilerplate)->DeepCopy(isolate); | 503 return *JSObject::DeepCopy(Handle<JSObject>::cast(boilerplate)); |
|
Toon Verwaest
2013/08/20 09:37:13
As discussed, here and everywhere else, we need an
Michael Starzinger
2013/08/29 19:18:27
Done.
| |
| 504 } | 504 } |
| 505 | 505 |
| 506 | 506 |
| 507 RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateObjectLiteralShallow) { | 507 RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateObjectLiteralShallow) { |
| 508 HandleScope scope(isolate); | 508 HandleScope scope(isolate); |
| 509 ASSERT(args.length() == 4); | 509 ASSERT(args.length() == 4); |
| 510 CONVERT_ARG_HANDLE_CHECKED(FixedArray, literals, 0); | 510 CONVERT_ARG_HANDLE_CHECKED(FixedArray, literals, 0); |
| 511 CONVERT_SMI_ARG_CHECKED(literals_index, 1); | 511 CONVERT_SMI_ARG_CHECKED(literals_index, 1); |
| 512 CONVERT_ARG_HANDLE_CHECKED(FixedArray, constant_properties, 2); | 512 CONVERT_ARG_HANDLE_CHECKED(FixedArray, constant_properties, 2); |
| 513 CONVERT_SMI_ARG_CHECKED(flags, 3); | 513 CONVERT_SMI_ARG_CHECKED(flags, 3); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 558 HandleScope scope(isolate); | 558 HandleScope scope(isolate); |
| 559 ASSERT(args.length() == 3); | 559 ASSERT(args.length() == 3); |
| 560 CONVERT_ARG_HANDLE_CHECKED(FixedArray, literals, 0); | 560 CONVERT_ARG_HANDLE_CHECKED(FixedArray, literals, 0); |
| 561 CONVERT_SMI_ARG_CHECKED(literals_index, 1); | 561 CONVERT_SMI_ARG_CHECKED(literals_index, 1); |
| 562 CONVERT_ARG_HANDLE_CHECKED(FixedArray, elements, 2); | 562 CONVERT_ARG_HANDLE_CHECKED(FixedArray, elements, 2); |
| 563 | 563 |
| 564 Handle<AllocationSite> site = GetLiteralAllocationSite(isolate, literals, | 564 Handle<AllocationSite> site = GetLiteralAllocationSite(isolate, literals, |
| 565 literals_index, elements); | 565 literals_index, elements); |
| 566 RETURN_IF_EMPTY_HANDLE(isolate, site); | 566 RETURN_IF_EMPTY_HANDLE(isolate, site); |
| 567 | 567 |
| 568 JSObject* boilerplate = JSObject::cast(site->transition_info()); | 568 Handle<JSObject> boilerplate(JSObject::cast(site->transition_info())); |
| 569 return boilerplate->DeepCopy(isolate); | 569 return *JSObject::DeepCopy(boilerplate); |
| 570 } | 570 } |
| 571 | 571 |
| 572 | 572 |
| 573 RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateArrayLiteralShallow) { | 573 RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateArrayLiteralShallow) { |
| 574 HandleScope scope(isolate); | 574 HandleScope scope(isolate); |
| 575 ASSERT(args.length() == 3); | 575 ASSERT(args.length() == 3); |
| 576 CONVERT_ARG_HANDLE_CHECKED(FixedArray, literals, 0); | 576 CONVERT_ARG_HANDLE_CHECKED(FixedArray, literals, 0); |
| 577 CONVERT_SMI_ARG_CHECKED(literals_index, 1); | 577 CONVERT_SMI_ARG_CHECKED(literals_index, 1); |
| 578 CONVERT_ARG_HANDLE_CHECKED(FixedArray, elements, 2); | 578 CONVERT_ARG_HANDLE_CHECKED(FixedArray, elements, 2); |
| 579 | 579 |
| (...skipping 13901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 14481 // Handle last resort GC and make sure to allow future allocations | 14481 // Handle last resort GC and make sure to allow future allocations |
| 14482 // to grow the heap without causing GCs (if possible). | 14482 // to grow the heap without causing GCs (if possible). |
| 14483 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14483 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 14484 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14484 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 14485 "Runtime::PerformGC"); | 14485 "Runtime::PerformGC"); |
| 14486 } | 14486 } |
| 14487 } | 14487 } |
| 14488 | 14488 |
| 14489 | 14489 |
| 14490 } } // namespace v8::internal | 14490 } } // namespace v8::internal |
| OLD | NEW |