OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2042 __ Branch(&l_send); | 2042 __ Branch(&l_send); |
2043 | 2043 |
2044 // catch (e) { receiver = iter; f = iter.throw; arg = e; goto l_call; } | 2044 // catch (e) { receiver = iter; f = iter.throw; arg = e; goto l_call; } |
2045 __ bind(&l_catch); | 2045 __ bind(&l_catch); |
2046 __ mov(a0, v0); | 2046 __ mov(a0, v0); |
2047 handler_table()->set(expr->index(), Smi::FromInt(l_catch.pos())); | 2047 handler_table()->set(expr->index(), Smi::FromInt(l_catch.pos())); |
2048 __ lw(a3, MemOperand(sp, 1 * kPointerSize)); // iter | 2048 __ lw(a3, MemOperand(sp, 1 * kPointerSize)); // iter |
2049 __ push(a3); // iter | 2049 __ push(a3); // iter |
2050 __ push(a0); // exception | 2050 __ push(a0); // exception |
2051 __ mov(a0, a3); // iter | 2051 __ mov(a0, a3); // iter |
2052 __ push(a0); // push LoadIC state | |
2053 __ LoadRoot(a2, Heap::kthrow_stringRootIndex); // "throw" | 2052 __ LoadRoot(a2, Heap::kthrow_stringRootIndex); // "throw" |
2054 Handle<Code> throw_ic = isolate()->builtins()->LoadIC_Initialize(); | 2053 Handle<Code> throw_ic = isolate()->builtins()->LoadIC_Initialize(); |
2055 CallIC(throw_ic); // iter.throw in a0 | 2054 CallIC(throw_ic); // iter.throw in a0 |
2056 __ mov(a0, v0); | 2055 __ mov(a0, v0); |
2057 __ Addu(sp, sp, Operand(kPointerSize)); // drop LoadIC state | |
2058 __ jmp(&l_call); | 2056 __ jmp(&l_call); |
2059 | 2057 |
2060 // try { received = yield result.value } | 2058 // try { received = yield result.value } |
2061 __ bind(&l_try); | 2059 __ bind(&l_try); |
2062 __ pop(a0); // result.value | 2060 __ pop(a0); // result.value |
2063 __ PushTryHandler(StackHandler::CATCH, expr->index()); | 2061 __ PushTryHandler(StackHandler::CATCH, expr->index()); |
2064 const int handler_size = StackHandlerConstants::kSize; | 2062 const int handler_size = StackHandlerConstants::kSize; |
2065 __ push(a0); // result.value | 2063 __ push(a0); // result.value |
2066 __ lw(a3, MemOperand(sp, (0 + 1) * kPointerSize + handler_size)); // g | 2064 __ lw(a3, MemOperand(sp, (0 + 1) * kPointerSize + handler_size)); // g |
2067 __ push(a3); // g | 2065 __ push(a3); // g |
2068 __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); | 2066 __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); |
2069 __ mov(a0, v0); | 2067 __ mov(a0, v0); |
2070 __ lw(context_register(), | 2068 __ lw(context_register(), |
2071 MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2069 MemOperand(fp, StandardFrameConstants::kContextOffset)); |
2072 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); | 2070 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
2073 __ Branch(&l_resume, ne, a0, Operand(at)); | 2071 __ Branch(&l_resume, ne, a0, Operand(at)); |
2074 EmitReturnIteratorResult(false); | 2072 EmitReturnIteratorResult(false); |
2075 __ mov(a0, v0); | 2073 __ mov(a0, v0); |
2076 __ bind(&l_resume); // received in a0 | 2074 __ bind(&l_resume); // received in a0 |
2077 __ PopTryHandler(); | 2075 __ PopTryHandler(); |
2078 | 2076 |
2079 // receiver = iter; f = iter.send; arg = received; | 2077 // receiver = iter; f = iter.send; arg = received; |
2080 __ bind(&l_send); | 2078 __ bind(&l_send); |
2081 __ lw(a3, MemOperand(sp, 1 * kPointerSize)); // iter | 2079 __ lw(a3, MemOperand(sp, 1 * kPointerSize)); // iter |
2082 __ push(a3); // iter | 2080 __ push(a3); // iter |
2083 __ push(a0); // received | 2081 __ push(a0); // received |
2084 __ mov(a0, a3); // iter | 2082 __ mov(a0, a3); // iter |
2085 __ push(a0); // push LoadIC state | |
2086 __ LoadRoot(a2, Heap::ksend_stringRootIndex); // "send" | 2083 __ LoadRoot(a2, Heap::ksend_stringRootIndex); // "send" |
2087 Handle<Code> send_ic = isolate()->builtins()->LoadIC_Initialize(); | 2084 Handle<Code> send_ic = isolate()->builtins()->LoadIC_Initialize(); |
2088 CallIC(send_ic); // iter.send in a0 | 2085 CallIC(send_ic); // iter.send in a0 |
2089 __ mov(a0, v0); | 2086 __ mov(a0, v0); |
2090 __ Addu(sp, sp, Operand(kPointerSize)); // drop LoadIC state | |
2091 | 2087 |
2092 // result = f.call(receiver, arg); | 2088 // result = f.call(receiver, arg); |
2093 __ bind(&l_call); | 2089 __ bind(&l_call); |
2094 Label l_call_runtime; | 2090 Label l_call_runtime; |
2095 __ JumpIfSmi(a0, &l_call_runtime); | 2091 __ JumpIfSmi(a0, &l_call_runtime); |
2096 __ GetObjectType(a0, a1, a1); | 2092 __ GetObjectType(a0, a1, a1); |
2097 __ Branch(&l_call_runtime, ne, a1, Operand(JS_FUNCTION_TYPE)); | 2093 __ Branch(&l_call_runtime, ne, a1, Operand(JS_FUNCTION_TYPE)); |
2098 __ mov(a1, a0); | 2094 __ mov(a1, a0); |
2099 ParameterCount count(1); | 2095 ParameterCount count(1); |
2100 __ InvokeFunction(a1, count, CALL_FUNCTION, | 2096 __ InvokeFunction(a1, count, CALL_FUNCTION, |
2101 NullCallWrapper(), CALL_AS_METHOD); | 2097 NullCallWrapper(), CALL_AS_METHOD); |
2102 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2098 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
2103 __ jmp(&l_loop); | 2099 __ jmp(&l_loop); |
2104 __ bind(&l_call_runtime); | 2100 __ bind(&l_call_runtime); |
2105 __ push(a0); | 2101 __ push(a0); |
2106 __ CallRuntime(Runtime::kCall, 3); | 2102 __ CallRuntime(Runtime::kCall, 3); |
2107 | 2103 |
2108 // val = result.value; if (!result.done) goto l_try; | 2104 // val = result.value; if (!result.done) goto l_try; |
2109 __ bind(&l_loop); | 2105 __ bind(&l_loop); |
2110 __ mov(a0, v0); | 2106 __ mov(a0, v0); |
2111 // result.value | 2107 // result.value |
2112 __ push(a0); // save result | 2108 __ push(a0); // save result |
2113 __ LoadRoot(a2, Heap::kvalue_stringRootIndex); // "value" | 2109 __ LoadRoot(a2, Heap::kvalue_stringRootIndex); // "value" |
2114 Handle<Code> value_ic = isolate()->builtins()->LoadIC_Initialize(); | 2110 Handle<Code> value_ic = isolate()->builtins()->LoadIC_Initialize(); |
2115 CallIC(value_ic); // result.value in a0 | 2111 CallIC(value_ic); // result.value in a0 |
2116 __ mov(a0, v0); | 2112 __ mov(a0, v0); |
2117 __ pop(a1); // result | 2113 __ pop(a1); // result |
2118 __ push(a0); // result.value | 2114 __ push(a0); // result.value |
2119 __ mov(a0, a1); // result | 2115 __ mov(a0, a1); // result |
2120 __ push(a0); // push LoadIC state | |
2121 __ LoadRoot(a2, Heap::kdone_stringRootIndex); // "done" | 2116 __ LoadRoot(a2, Heap::kdone_stringRootIndex); // "done" |
2122 Handle<Code> done_ic = isolate()->builtins()->LoadIC_Initialize(); | 2117 Handle<Code> done_ic = isolate()->builtins()->LoadIC_Initialize(); |
2123 CallIC(done_ic); // result.done in v0 | 2118 CallIC(done_ic); // result.done in v0 |
2124 __ Addu(sp, sp, Operand(kPointerSize)); // drop LoadIC state | |
2125 __ mov(a0, v0); | 2119 __ mov(a0, v0); |
2126 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); | 2120 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); |
2127 CallIC(bool_ic); | 2121 CallIC(bool_ic); |
2128 __ Branch(&l_try, eq, v0, Operand(zero_reg)); | 2122 __ Branch(&l_try, eq, v0, Operand(zero_reg)); |
2129 | 2123 |
2130 // result.value | 2124 // result.value |
2131 __ pop(v0); // result.value | 2125 __ pop(v0); // result.value |
2132 context()->DropAndPlug(2, v0); // drop iter and g | 2126 context()->DropAndPlug(2, v0); // drop iter and g |
2133 break; | 2127 break; |
2134 } | 2128 } |
(...skipping 2837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4972 *context_length = 0; | 4966 *context_length = 0; |
4973 return previous_; | 4967 return previous_; |
4974 } | 4968 } |
4975 | 4969 |
4976 | 4970 |
4977 #undef __ | 4971 #undef __ |
4978 | 4972 |
4979 } } // namespace v8::internal | 4973 } } // namespace v8::internal |
4980 | 4974 |
4981 #endif // V8_TARGET_ARCH_MIPS | 4975 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |