OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/frames-inl.h" | 8 #include "src/frames-inl.h" |
9 #include "src/runtime/runtime-utils.h" | 9 #include "src/runtime/runtime-utils.h" |
10 | 10 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 DCHECK_EQ(frame->function(), generator_object->function()); | 104 DCHECK_EQ(frame->function(), generator_object->function()); |
105 DCHECK(frame->function()->is_compiled()); | 105 DCHECK(frame->function()->is_compiled()); |
106 | 106 |
107 STATIC_ASSERT(JSGeneratorObject::kGeneratorExecuting < 0); | 107 STATIC_ASSERT(JSGeneratorObject::kGeneratorExecuting < 0); |
108 STATIC_ASSERT(JSGeneratorObject::kGeneratorClosed == 0); | 108 STATIC_ASSERT(JSGeneratorObject::kGeneratorClosed == 0); |
109 | 109 |
110 Address pc = generator_object->function()->code()->instruction_start(); | 110 Address pc = generator_object->function()->code()->instruction_start(); |
111 int offset = generator_object->continuation(); | 111 int offset = generator_object->continuation(); |
112 DCHECK(offset > 0); | 112 DCHECK(offset > 0); |
113 frame->set_pc(pc + offset); | 113 frame->set_pc(pc + offset); |
114 if (FLAG_enable_ool_constant_pool) { | 114 if (FLAG_enable_embedded_constant_pool) { |
115 frame->set_constant_pool( | 115 frame->set_constant_pool( |
116 generator_object->function()->code()->constant_pool()); | 116 generator_object->function()->code()->constant_pool()); |
117 } | 117 } |
118 generator_object->set_continuation(JSGeneratorObject::kGeneratorExecuting); | 118 generator_object->set_continuation(JSGeneratorObject::kGeneratorExecuting); |
119 | 119 |
120 FixedArray* operand_stack = generator_object->operand_stack(); | 120 FixedArray* operand_stack = generator_object->operand_stack(); |
121 int operands_count = operand_stack->length(); | 121 int operands_count = operand_stack->length(); |
122 if (operands_count != 0) { | 122 if (operands_count != 0) { |
123 frame->RestoreOperandStack(operand_stack); | 123 frame->RestoreOperandStack(operand_stack); |
124 generator_object->set_operand_stack(isolate->heap()->empty_fixed_array()); | 124 generator_object->set_operand_stack(isolate->heap()->empty_fixed_array()); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 return NULL; | 221 return NULL; |
222 } | 222 } |
223 | 223 |
224 | 224 |
225 RUNTIME_FUNCTION(Runtime_GeneratorThrow) { | 225 RUNTIME_FUNCTION(Runtime_GeneratorThrow) { |
226 UNREACHABLE(); // Optimization disabled in SetUpGenerators(). | 226 UNREACHABLE(); // Optimization disabled in SetUpGenerators(). |
227 return NULL; | 227 return NULL; |
228 } | 228 } |
229 } // namespace internal | 229 } // namespace internal |
230 } // namespace v8 | 230 } // namespace v8 |
OLD | NEW |