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 2462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2473 for (int i = 0; i < operands_count; i++) { | 2473 for (int i = 0; i < operands_count; i++) { |
2474 operand_stack->set(i, frame->GetOperand(i)); | 2474 operand_stack->set(i, frame->GetOperand(i)); |
2475 } | 2475 } |
2476 generator_object->set_operand_stack(operand_stack); | 2476 generator_object->set_operand_stack(operand_stack); |
2477 } | 2477 } |
2478 | 2478 |
2479 // Set continuation down here to avoid side effects if the operand stack | 2479 // Set continuation down here to avoid side effects if the operand stack |
2480 // allocation fails. | 2480 // allocation fails. |
2481 intptr_t offset = frame->pc() - function->code()->instruction_start(); | 2481 intptr_t offset = frame->pc() - function->code()->instruction_start(); |
2482 ASSERT(offset > 0 && Smi::IsValid(offset)); | 2482 ASSERT(offset > 0 && Smi::IsValid(offset)); |
2483 generator_object->set_continuation(offset); | 2483 generator_object->set_continuation(static_cast<int>(offset)); |
2484 | 2484 |
2485 // It's possible for the context to be other than the initial context even if | 2485 // It's possible for the context to be other than the initial context even if |
2486 // there is no stack handler active. For example, this is the case in the | 2486 // there is no stack handler active. For example, this is the case in the |
2487 // body of a "with" statement. Therefore we always save the context. | 2487 // body of a "with" statement. Therefore we always save the context. |
2488 generator_object->set_context(Context::cast(frame->context())); | 2488 generator_object->set_context(Context::cast(frame->context())); |
2489 | 2489 |
2490 // The return value is the hole for a suspend return, and anything else for a | 2490 // The return value is the hole for a suspend return, and anything else for a |
2491 // resume return. | 2491 // resume return. |
2492 return isolate->heap()->the_hole_value(); | 2492 return isolate->heap()->the_hole_value(); |
2493 } | 2493 } |
(...skipping 10892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13386 // Handle last resort GC and make sure to allow future allocations | 13386 // Handle last resort GC and make sure to allow future allocations |
13387 // to grow the heap without causing GCs (if possible). | 13387 // to grow the heap without causing GCs (if possible). |
13388 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13388 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13389 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13389 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
13390 "Runtime::PerformGC"); | 13390 "Runtime::PerformGC"); |
13391 } | 13391 } |
13392 } | 13392 } |
13393 | 13393 |
13394 | 13394 |
13395 } } // namespace v8::internal | 13395 } } // namespace v8::internal |
OLD | NEW |