OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
8 | 8 |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1968 } | 1968 } |
1969 | 1969 |
1970 | 1970 |
1971 void FullCodeGenerator::VisitYield(Yield* expr) { | 1971 void FullCodeGenerator::VisitYield(Yield* expr) { |
1972 Comment cmnt(masm_, "[ Yield"); | 1972 Comment cmnt(masm_, "[ Yield"); |
1973 // Evaluate yielded value first; the initial iterator definition depends on | 1973 // Evaluate yielded value first; the initial iterator definition depends on |
1974 // this. It stays on the stack while we update the iterator. | 1974 // this. It stays on the stack while we update the iterator. |
1975 VisitForStackValue(expr->expression()); | 1975 VisitForStackValue(expr->expression()); |
1976 | 1976 |
1977 switch (expr->yield_kind()) { | 1977 switch (expr->yield_kind()) { |
1978 case Yield::SUSPEND: | 1978 case Yield::kSuspend: |
1979 // Pop value from top-of-stack slot; box result into result register. | 1979 // Pop value from top-of-stack slot; box result into result register. |
1980 EmitCreateIteratorResult(false); | 1980 EmitCreateIteratorResult(false); |
1981 __ push(result_register()); | 1981 __ push(result_register()); |
1982 // Fall through. | 1982 // Fall through. |
1983 case Yield::INITIAL: { | 1983 case Yield::kInitial: { |
1984 Label suspend, continuation, post_runtime, resume; | 1984 Label suspend, continuation, post_runtime, resume; |
1985 | 1985 |
1986 __ jmp(&suspend); | 1986 __ jmp(&suspend); |
1987 | 1987 |
1988 __ bind(&continuation); | 1988 __ bind(&continuation); |
1989 __ jmp(&resume); | 1989 __ jmp(&resume); |
1990 | 1990 |
1991 __ bind(&suspend); | 1991 __ bind(&suspend); |
1992 VisitForAccumulatorValue(expr->generator_object()); | 1992 VisitForAccumulatorValue(expr->generator_object()); |
1993 DCHECK(continuation.pos() > 0 && Smi::IsValid(continuation.pos())); | 1993 DCHECK(continuation.pos() > 0 && Smi::IsValid(continuation.pos())); |
(...skipping 11 matching lines...) Expand all Loading... |
2005 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2005 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
2006 __ bind(&post_runtime); | 2006 __ bind(&post_runtime); |
2007 __ pop(result_register()); | 2007 __ pop(result_register()); |
2008 EmitReturnSequence(); | 2008 EmitReturnSequence(); |
2009 | 2009 |
2010 __ bind(&resume); | 2010 __ bind(&resume); |
2011 context()->Plug(result_register()); | 2011 context()->Plug(result_register()); |
2012 break; | 2012 break; |
2013 } | 2013 } |
2014 | 2014 |
2015 case Yield::FINAL: { | 2015 case Yield::kFinal: { |
2016 VisitForAccumulatorValue(expr->generator_object()); | 2016 VisitForAccumulatorValue(expr->generator_object()); |
2017 __ mov(r1, Operand(Smi::FromInt(JSGeneratorObject::kGeneratorClosed))); | 2017 __ mov(r1, Operand(Smi::FromInt(JSGeneratorObject::kGeneratorClosed))); |
2018 __ str(r1, FieldMemOperand(result_register(), | 2018 __ str(r1, FieldMemOperand(result_register(), |
2019 JSGeneratorObject::kContinuationOffset)); | 2019 JSGeneratorObject::kContinuationOffset)); |
2020 // Pop value from top-of-stack slot, box result into result register. | 2020 // Pop value from top-of-stack slot, box result into result register. |
2021 EmitCreateIteratorResult(true); | 2021 EmitCreateIteratorResult(true); |
2022 EmitUnwindBeforeReturn(); | 2022 EmitUnwindBeforeReturn(); |
2023 EmitReturnSequence(); | 2023 EmitReturnSequence(); |
2024 break; | 2024 break; |
2025 } | 2025 } |
2026 | 2026 |
2027 case Yield::DELEGATING: { | 2027 case Yield::kDelegating: { |
2028 VisitForStackValue(expr->generator_object()); | 2028 VisitForStackValue(expr->generator_object()); |
2029 | 2029 |
2030 // Initial stack layout is as follows: | 2030 // Initial stack layout is as follows: |
2031 // [sp + 1 * kPointerSize] iter | 2031 // [sp + 1 * kPointerSize] iter |
2032 // [sp + 0 * kPointerSize] g | 2032 // [sp + 0 * kPointerSize] g |
2033 | 2033 |
2034 Label l_catch, l_try, l_suspend, l_continuation, l_resume; | 2034 Label l_catch, l_try, l_suspend, l_continuation, l_resume; |
2035 Label l_next, l_call, l_loop; | 2035 Label l_next, l_call, l_loop; |
2036 Register load_receiver = LoadConvention::ReceiverRegister(); | 2036 Register load_receiver = LoadConvention::ReceiverRegister(); |
2037 Register load_name = LoadConvention::NameRegister(); | 2037 Register load_name = LoadConvention::NameRegister(); |
(...skipping 2889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4927 | 4927 |
4928 DCHECK(interrupt_address == | 4928 DCHECK(interrupt_address == |
4929 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4929 isolate->builtins()->OsrAfterStackCheck()->entry()); |
4930 return OSR_AFTER_STACK_CHECK; | 4930 return OSR_AFTER_STACK_CHECK; |
4931 } | 4931 } |
4932 | 4932 |
4933 | 4933 |
4934 } } // namespace v8::internal | 4934 } } // namespace v8::internal |
4935 | 4935 |
4936 #endif // V8_TARGET_ARCH_ARM | 4936 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |