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 3098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3109 ASSERT(args.length() == 3); | 3109 ASSERT(args.length() == 3); |
3110 CONVERT_ARG_CHECKED(JSGeneratorObject, generator_object, 0); | 3110 CONVERT_ARG_CHECKED(JSGeneratorObject, generator_object, 0); |
3111 CONVERT_ARG_CHECKED(Object, value, 1); | 3111 CONVERT_ARG_CHECKED(Object, value, 1); |
3112 CONVERT_SMI_ARG_CHECKED(resume_mode_int, 2); | 3112 CONVERT_SMI_ARG_CHECKED(resume_mode_int, 2); |
3113 JavaScriptFrameIterator stack_iterator(isolate); | 3113 JavaScriptFrameIterator stack_iterator(isolate); |
3114 JavaScriptFrame* frame = stack_iterator.frame(); | 3114 JavaScriptFrame* frame = stack_iterator.frame(); |
3115 | 3115 |
3116 ASSERT_EQ(frame->function(), generator_object->function()); | 3116 ASSERT_EQ(frame->function(), generator_object->function()); |
3117 ASSERT(frame->function()->is_compiled()); | 3117 ASSERT(frame->function()->is_compiled()); |
3118 | 3118 |
3119 STATIC_ASSERT(JSGeneratorObject::kGeneratorExecuting <= 0); | 3119 STATIC_ASSERT(JSGeneratorObject::kGeneratorExecuting < 0); |
3120 STATIC_ASSERT(JSGeneratorObject::kGeneratorClosed <= 0); | 3120 STATIC_ASSERT(JSGeneratorObject::kGeneratorClosed == 0); |
3121 | 3121 |
3122 Address pc = generator_object->function()->code()->instruction_start(); | 3122 Address pc = generator_object->function()->code()->instruction_start(); |
3123 int offset = generator_object->continuation(); | 3123 int offset = generator_object->continuation(); |
3124 ASSERT(offset > 0); | 3124 ASSERT(offset > 0); |
3125 frame->set_pc(pc + offset); | 3125 frame->set_pc(pc + offset); |
3126 generator_object->set_continuation(JSGeneratorObject::kGeneratorExecuting); | 3126 generator_object->set_continuation(JSGeneratorObject::kGeneratorExecuting); |
3127 | 3127 |
3128 FixedArray* operand_stack = generator_object->operand_stack(); | 3128 FixedArray* operand_stack = generator_object->operand_stack(); |
3129 int operands_count = operand_stack->length(); | 3129 int operands_count = operand_stack->length(); |
3130 if (operands_count != 0) { | 3130 if (operands_count != 0) { |
(...skipping 11753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14884 // Handle last resort GC and make sure to allow future allocations | 14884 // Handle last resort GC and make sure to allow future allocations |
14885 // to grow the heap without causing GCs (if possible). | 14885 // to grow the heap without causing GCs (if possible). |
14886 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14886 isolate->counters()->gc_last_resort_from_js()->Increment(); |
14887 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14887 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
14888 "Runtime::PerformGC"); | 14888 "Runtime::PerformGC"); |
14889 } | 14889 } |
14890 } | 14890 } |
14891 | 14891 |
14892 | 14892 |
14893 } } // namespace v8::internal | 14893 } } // namespace v8::internal |
OLD | NEW |