Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(989)

Side by Side Diff: src/full-codegen/mips64/full-codegen-mips64.cc

Issue 1620253003: Implement the function.sent proposal. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add TODO Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #if V8_TARGET_ARCH_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
6 6
7 // Note on Mips implementation: 7 // Note on Mips implementation:
8 // 8 //
9 // The result_register() for mips is the 'v0' register, which is defined 9 // The result_register() for mips is the 'v0' register, which is defined
10 // by the ABI to contain function return values. However, the first 10 // by the ABI to contain function return values. However, the first
(...skipping 1956 matching lines...) Expand 10 before | Expand all | Expand 10 after
1967 VisitForStackValue(expr->generator_object()); 1967 VisitForStackValue(expr->generator_object());
1968 1968
1969 // Initial stack layout is as follows: 1969 // Initial stack layout is as follows:
1970 // [sp + 1 * kPointerSize] iter 1970 // [sp + 1 * kPointerSize] iter
1971 // [sp + 0 * kPointerSize] g 1971 // [sp + 0 * kPointerSize] g
1972 1972
1973 Label l_catch, l_try, l_suspend, l_continuation, l_resume; 1973 Label l_catch, l_try, l_suspend, l_continuation, l_resume;
1974 Label l_next, l_call; 1974 Label l_next, l_call;
1975 Register load_receiver = LoadDescriptor::ReceiverRegister(); 1975 Register load_receiver = LoadDescriptor::ReceiverRegister();
1976 Register load_name = LoadDescriptor::NameRegister(); 1976 Register load_name = LoadDescriptor::NameRegister();
1977
1977 // Initial send value is undefined. 1978 // Initial send value is undefined.
1978 __ LoadRoot(a0, Heap::kUndefinedValueRootIndex); 1979 __ LoadRoot(a0, Heap::kUndefinedValueRootIndex);
1979 __ Branch(&l_next); 1980 __ Branch(&l_next);
1980 1981
1981 // catch (e) { receiver = iter; f = 'throw'; arg = e; goto l_call; } 1982 // catch (e) { receiver = iter; f = 'throw'; arg = e; goto l_call; }
1982 __ bind(&l_catch); 1983 __ bind(&l_catch);
1983 __ mov(a0, v0); 1984 __ mov(a0, v0);
1984 __ LoadRoot(a2, Heap::kthrow_stringRootIndex); // "throw" 1985 __ LoadRoot(a2, Heap::kthrow_stringRootIndex); // "throw"
1985 __ ld(a3, MemOperand(sp, 1 * kPointerSize)); // iter 1986 __ ld(a3, MemOperand(sp, 1 * kPointerSize)); // iter
1986 __ Push(a2, a3, a0); // "throw", iter, except 1987 __ Push(a2, a3, a0); // "throw", iter, except
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
2079 Expression *value, 2080 Expression *value,
2080 JSGeneratorObject::ResumeMode resume_mode) { 2081 JSGeneratorObject::ResumeMode resume_mode) {
2081 // The value stays in a0, and is ultimately read by the resumed generator, as 2082 // The value stays in a0, and is ultimately read by the resumed generator, as
2082 // if CallRuntime(Runtime::kSuspendJSGeneratorObject) returned it. Or it 2083 // if CallRuntime(Runtime::kSuspendJSGeneratorObject) returned it. Or it
2083 // is read to throw the value when the resumed generator is already closed. 2084 // is read to throw the value when the resumed generator is already closed.
2084 // a1 will hold the generator object until the activation has been resumed. 2085 // a1 will hold the generator object until the activation has been resumed.
2085 VisitForStackValue(generator); 2086 VisitForStackValue(generator);
2086 VisitForAccumulatorValue(value); 2087 VisitForAccumulatorValue(value);
2087 __ pop(a1); 2088 __ pop(a1);
2088 2089
2090 // Store input value into generator object.
2091 __ sd(result_register(),
2092 FieldMemOperand(a1, JSGeneratorObject::kInputOffset));
2093 __ mov(a2, result_register());
2094 __ RecordWriteField(a1, JSGeneratorObject::kInputOffset, a2, a3,
2095 kRAHasBeenSaved, kDontSaveFPRegs);
2096
2089 // Load suspended function and context. 2097 // Load suspended function and context.
2090 __ ld(cp, FieldMemOperand(a1, JSGeneratorObject::kContextOffset)); 2098 __ ld(cp, FieldMemOperand(a1, JSGeneratorObject::kContextOffset));
2091 __ ld(a4, FieldMemOperand(a1, JSGeneratorObject::kFunctionOffset)); 2099 __ ld(a4, FieldMemOperand(a1, JSGeneratorObject::kFunctionOffset));
2092 2100
2093 // Load receiver and store as the first argument. 2101 // Load receiver and store as the first argument.
2094 __ ld(a2, FieldMemOperand(a1, JSGeneratorObject::kReceiverOffset)); 2102 __ ld(a2, FieldMemOperand(a1, JSGeneratorObject::kReceiverOffset));
2095 __ push(a2); 2103 __ push(a2);
2096 2104
2097 // Push holes for the rest of the arguments to the generator function. 2105 // Push holes for the rest of the arguments to the generator function.
2098 __ ld(a3, FieldMemOperand(a4, JSFunction::kSharedFunctionInfoOffset)); 2106 __ ld(a3, FieldMemOperand(a4, JSFunction::kSharedFunctionInfoOffset));
(...skipping 2717 matching lines...) Expand 10 before | Expand all | Expand 10 after
4816 reinterpret_cast<uint64_t>( 4824 reinterpret_cast<uint64_t>(
4817 isolate->builtins()->OsrAfterStackCheck()->entry())); 4825 isolate->builtins()->OsrAfterStackCheck()->entry()));
4818 return OSR_AFTER_STACK_CHECK; 4826 return OSR_AFTER_STACK_CHECK;
4819 } 4827 }
4820 4828
4821 4829
4822 } // namespace internal 4830 } // namespace internal
4823 } // namespace v8 4831 } // namespace v8
4824 4832
4825 #endif // V8_TARGET_ARCH_MIPS64 4833 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698