| 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 2395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2406 JSGeneratorObject* generator; | 2406 JSGeneratorObject* generator; |
| 2407 if (frame->IsConstructor()) { | 2407 if (frame->IsConstructor()) { |
| 2408 generator = JSGeneratorObject::cast(frame->receiver()); | 2408 generator = JSGeneratorObject::cast(frame->receiver()); |
| 2409 } else { | 2409 } else { |
| 2410 MaybeObject* maybe_generator = | 2410 MaybeObject* maybe_generator = |
| 2411 isolate->heap()->AllocateJSGeneratorObject(function); | 2411 isolate->heap()->AllocateJSGeneratorObject(function); |
| 2412 if (!maybe_generator->To(&generator)) return maybe_generator; | 2412 if (!maybe_generator->To(&generator)) return maybe_generator; |
| 2413 } | 2413 } |
| 2414 generator->set_function(function); | 2414 generator->set_function(function); |
| 2415 generator->set_context(Context::cast(frame->context())); | 2415 generator->set_context(Context::cast(frame->context())); |
| 2416 generator->set_receiver(frame->receiver()); |
| 2416 generator->set_continuation(0); | 2417 generator->set_continuation(0); |
| 2417 generator->set_operand_stack(isolate->heap()->empty_fixed_array()); | 2418 generator->set_operand_stack(isolate->heap()->empty_fixed_array()); |
| 2418 | 2419 |
| 2419 return generator; | 2420 return generator; |
| 2420 } | 2421 } |
| 2421 | 2422 |
| 2422 | 2423 |
| 2423 RUNTIME_FUNCTION(MaybeObject*, Runtime_SuspendJSGeneratorObject) { | 2424 RUNTIME_FUNCTION(MaybeObject*, Runtime_SuspendJSGeneratorObject) { |
| 2424 HandleScope scope(isolate); | 2425 HandleScope scope(isolate); |
| 2425 ASSERT(args.length() == 1); | 2426 ASSERT(args.length() == 1); |
| (...skipping 10924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13350 // Handle last resort GC and make sure to allow future allocations | 13351 // Handle last resort GC and make sure to allow future allocations |
| 13351 // to grow the heap without causing GCs (if possible). | 13352 // to grow the heap without causing GCs (if possible). |
| 13352 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13353 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 13353 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13354 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 13354 "Runtime::PerformGC"); | 13355 "Runtime::PerformGC"); |
| 13355 } | 13356 } |
| 13356 } | 13357 } |
| 13357 | 13358 |
| 13358 | 13359 |
| 13359 } } // namespace v8::internal | 13360 } } // namespace v8::internal |
| OLD | NEW |