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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/factory.h" | 8 #include "src/factory.h" |
9 #include "src/frames-inl.h" | 9 #include "src/frames-inl.h" |
10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 if (generator->is_suspended()) { | 196 if (generator->is_suspended()) { |
197 Handle<Code> code(generator->function()->code(), isolate); | 197 Handle<Code> code(generator->function()->code(), isolate); |
198 int offset = generator->continuation(); | 198 int offset = generator->continuation(); |
199 RUNTIME_ASSERT(0 <= offset && offset < code->instruction_size()); | 199 RUNTIME_ASSERT(0 <= offset && offset < code->instruction_size()); |
200 return Smi::FromInt(code->SourcePosition(offset)); | 200 return Smi::FromInt(code->SourcePosition(offset)); |
201 } | 201 } |
202 | 202 |
203 return isolate->heap()->undefined_value(); | 203 return isolate->heap()->undefined_value(); |
204 } | 204 } |
205 | 205 |
206 | 206 // Optimization for builtins calling any of the following three functions is |
207 // Optimization for the following three functions is disabled in | 207 // disabled in js/generator.js and compiler.cc, hence they are unreachable. |
208 // js/generator.js and compiler/ast-graph-builder.cc. | |
209 | |
210 | 208 |
211 RUNTIME_FUNCTION(Runtime_GeneratorNext) { | 209 RUNTIME_FUNCTION(Runtime_GeneratorNext) { |
212 UNREACHABLE(); | 210 UNREACHABLE(); |
213 return nullptr; | 211 return nullptr; |
214 } | 212 } |
215 | 213 |
216 | |
217 RUNTIME_FUNCTION(Runtime_GeneratorReturn) { | 214 RUNTIME_FUNCTION(Runtime_GeneratorReturn) { |
218 UNREACHABLE(); | 215 UNREACHABLE(); |
219 return nullptr; | 216 return nullptr; |
220 } | 217 } |
221 | 218 |
222 | |
223 RUNTIME_FUNCTION(Runtime_GeneratorThrow) { | 219 RUNTIME_FUNCTION(Runtime_GeneratorThrow) { |
224 UNREACHABLE(); | 220 UNREACHABLE(); |
225 return nullptr; | 221 return nullptr; |
226 } | 222 } |
| 223 |
227 } // namespace internal | 224 } // namespace internal |
228 } // namespace v8 | 225 } // namespace v8 |
OLD | NEW |