| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/interpreter/bytecode-generator.h" | 5 #include "src/interpreter/bytecode-generator.h" |
| 6 | 6 |
| 7 #include "src/ast/compile-time-value.h" | 7 #include "src/ast/compile-time-value.h" |
| 8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
| 9 #include "src/builtins/builtins-constructor.h" | 9 #include "src/builtins/builtins-constructor.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 2231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2242 if (FLAG_trace) { | 2242 if (FLAG_trace) { |
| 2243 RegisterAllocationScope register_scope(this); | 2243 RegisterAllocationScope register_scope(this); |
| 2244 Register result = register_allocator()->NewRegister(); | 2244 Register result = register_allocator()->NewRegister(); |
| 2245 // Runtime returns {result} value, preserving accumulator. | 2245 // Runtime returns {result} value, preserving accumulator. |
| 2246 builder()->StoreAccumulatorInRegister(result).CallRuntime( | 2246 builder()->StoreAccumulatorInRegister(result).CallRuntime( |
| 2247 Runtime::kTraceExit, result); | 2247 Runtime::kTraceExit, result); |
| 2248 } | 2248 } |
| 2249 if (info()->literal()->feedback_vector_spec()->HasTypeProfileSlot()) { | 2249 if (info()->literal()->feedback_vector_spec()->HasTypeProfileSlot()) { |
| 2250 builder()->CollectTypeProfile(info()->literal()->return_position()); | 2250 builder()->CollectTypeProfile(info()->literal()->return_position()); |
| 2251 } | 2251 } |
| 2252 if (IsGeneratorFunction(info()->literal()->kind())) { | 2252 if (IsAsyncGeneratorFunction(info()->literal()->kind())) { |
| 2253 // Mark the generator as closed if returning from a generator function. | 2253 // Mark the generator as closed if returning from an async generator |
| 2254 // function. Note that non-async generators are closed by the |
| 2255 // generator-resume builtin. |
| 2254 RegisterAllocationScope register_scope(this); | 2256 RegisterAllocationScope register_scope(this); |
| 2255 Register result = register_allocator()->NewRegister(); | 2257 Register result = register_allocator()->NewRegister(); |
| 2256 builder() | 2258 builder() |
| 2257 ->StoreAccumulatorInRegister(result) | 2259 ->StoreAccumulatorInRegister(result) |
| 2258 .CallRuntime(Runtime::kInlineGeneratorClose, generator_object_) | 2260 .CallRuntime(Runtime::kInlineGeneratorClose, generator_object_) |
| 2259 .LoadAccumulatorWithRegister(result); | 2261 .LoadAccumulatorWithRegister(result); |
| 2260 } | 2262 } |
| 2261 builder()->Return(); | 2263 builder()->Return(); |
| 2262 } | 2264 } |
| 2263 | 2265 |
| (...skipping 1723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3987 } | 3989 } |
| 3988 | 3990 |
| 3989 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { | 3991 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { |
| 3990 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict | 3992 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict |
| 3991 : Runtime::kStoreKeyedToSuper_Sloppy; | 3993 : Runtime::kStoreKeyedToSuper_Sloppy; |
| 3992 } | 3994 } |
| 3993 | 3995 |
| 3994 } // namespace interpreter | 3996 } // namespace interpreter |
| 3995 } // namespace internal | 3997 } // namespace internal |
| 3996 } // namespace v8 | 3998 } // namespace v8 |
| OLD | NEW |