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

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

Issue 16203004: Fix LoadIC calling convention on ARM (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/arm/ic-arm.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 // 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 2023 matching lines...) Expand 10 before | Expand all | Expand 10 after
2034 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); 2034 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
2035 __ b(&l_send); 2035 __ b(&l_send);
2036 2036
2037 // catch (e) { receiver = iter; f = iter.throw; arg = e; goto l_call; } 2037 // catch (e) { receiver = iter; f = iter.throw; arg = e; goto l_call; }
2038 __ bind(&l_catch); 2038 __ bind(&l_catch);
2039 handler_table()->set(expr->index(), Smi::FromInt(l_catch.pos())); 2039 handler_table()->set(expr->index(), Smi::FromInt(l_catch.pos()));
2040 __ ldr(r3, MemOperand(sp, 1 * kPointerSize)); // iter 2040 __ ldr(r3, MemOperand(sp, 1 * kPointerSize)); // iter
2041 __ push(r3); // iter 2041 __ push(r3); // iter
2042 __ push(r0); // exception 2042 __ push(r0); // exception
2043 __ mov(r0, r3); // iter 2043 __ mov(r0, r3); // iter
2044 __ push(r0); // push LoadIC state
2045 __ LoadRoot(r2, Heap::kthrow_stringRootIndex); // "throw" 2044 __ LoadRoot(r2, Heap::kthrow_stringRootIndex); // "throw"
2046 Handle<Code> throw_ic = isolate()->builtins()->LoadIC_Initialize(); 2045 Handle<Code> throw_ic = isolate()->builtins()->LoadIC_Initialize();
2047 CallIC(throw_ic); // iter.throw in r0 2046 CallIC(throw_ic); // iter.throw in r0
2048 __ add(sp, sp, Operand(kPointerSize)); // drop LoadIC state
2049 __ jmp(&l_call); 2047 __ jmp(&l_call);
2050 2048
2051 // try { received = yield result.value } 2049 // try { received = yield result.value }
2052 __ bind(&l_try); 2050 __ bind(&l_try);
2053 __ pop(r0); // result.value 2051 __ pop(r0); // result.value
2054 __ PushTryHandler(StackHandler::CATCH, expr->index()); 2052 __ PushTryHandler(StackHandler::CATCH, expr->index());
2055 const int handler_size = StackHandlerConstants::kSize; 2053 const int handler_size = StackHandlerConstants::kSize;
2056 __ push(r0); // result.value 2054 __ push(r0); // result.value
2057 __ ldr(r3, MemOperand(sp, (0 + 1) * kPointerSize + handler_size)); // g 2055 __ ldr(r3, MemOperand(sp, (0 + 1) * kPointerSize + handler_size)); // g
2058 __ push(r3); // g 2056 __ push(r3); // g
2059 __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); 2057 __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1);
2060 __ ldr(context_register(), 2058 __ ldr(context_register(),
2061 MemOperand(fp, StandardFrameConstants::kContextOffset)); 2059 MemOperand(fp, StandardFrameConstants::kContextOffset));
2062 __ CompareRoot(r0, Heap::kTheHoleValueRootIndex); 2060 __ CompareRoot(r0, Heap::kTheHoleValueRootIndex);
2063 __ b(ne, &l_resume); 2061 __ b(ne, &l_resume);
2064 EmitReturnIteratorResult(false); 2062 EmitReturnIteratorResult(false);
2065 __ bind(&l_resume); // received in r0 2063 __ bind(&l_resume); // received in r0
2066 __ PopTryHandler(); 2064 __ PopTryHandler();
2067 2065
2068 // receiver = iter; f = iter.send; arg = received; 2066 // receiver = iter; f = iter.send; arg = received;
2069 __ bind(&l_send); 2067 __ bind(&l_send);
2070 __ ldr(r3, MemOperand(sp, 1 * kPointerSize)); // iter 2068 __ ldr(r3, MemOperand(sp, 1 * kPointerSize)); // iter
2071 __ push(r3); // iter 2069 __ push(r3); // iter
2072 __ push(r0); // received 2070 __ push(r0); // received
2073 __ mov(r0, r3); // iter 2071 __ mov(r0, r3); // iter
2074 __ push(r0); // push LoadIC state
2075 __ LoadRoot(r2, Heap::ksend_stringRootIndex); // "send" 2072 __ LoadRoot(r2, Heap::ksend_stringRootIndex); // "send"
2076 Handle<Code> send_ic = isolate()->builtins()->LoadIC_Initialize(); 2073 Handle<Code> send_ic = isolate()->builtins()->LoadIC_Initialize();
2077 CallIC(send_ic); // iter.send in r0 2074 CallIC(send_ic); // iter.send in r0
2078 __ add(sp, sp, Operand(kPointerSize)); // drop LoadIC state
2079 2075
2080 // result = f.call(receiver, arg); 2076 // result = f.call(receiver, arg);
2081 __ bind(&l_call); 2077 __ bind(&l_call);
2082 Label l_call_runtime; 2078 Label l_call_runtime;
2083 __ JumpIfSmi(r0, &l_call_runtime); 2079 __ JumpIfSmi(r0, &l_call_runtime);
2084 __ CompareObjectType(r0, r1, r1, JS_FUNCTION_TYPE); 2080 __ CompareObjectType(r0, r1, r1, JS_FUNCTION_TYPE);
2085 __ b(ne, &l_call_runtime); 2081 __ b(ne, &l_call_runtime);
2086 __ mov(r1, r0); 2082 __ mov(r1, r0);
2087 ParameterCount count(1); 2083 ParameterCount count(1);
2088 __ InvokeFunction(r1, count, CALL_FUNCTION, 2084 __ InvokeFunction(r1, count, CALL_FUNCTION,
2089 NullCallWrapper(), CALL_AS_METHOD); 2085 NullCallWrapper(), CALL_AS_METHOD);
2090 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 2086 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
2091 __ jmp(&l_loop); 2087 __ jmp(&l_loop);
2092 __ bind(&l_call_runtime); 2088 __ bind(&l_call_runtime);
2093 __ push(r0); 2089 __ push(r0);
2094 __ CallRuntime(Runtime::kCall, 3); 2090 __ CallRuntime(Runtime::kCall, 3);
2095 2091
2096 // val = result.value; if (!result.done) goto l_try; 2092 // val = result.value; if (!result.done) goto l_try;
2097 __ bind(&l_loop); 2093 __ bind(&l_loop);
2098 // result.value 2094 // result.value
2099 __ push(r0); // save result 2095 __ push(r0); // save result
2100 __ LoadRoot(r2, Heap::kvalue_stringRootIndex); // "value" 2096 __ LoadRoot(r2, Heap::kvalue_stringRootIndex); // "value"
2101 Handle<Code> value_ic = isolate()->builtins()->LoadIC_Initialize(); 2097 Handle<Code> value_ic = isolate()->builtins()->LoadIC_Initialize();
2102 CallIC(value_ic); // result.value in r0 2098 CallIC(value_ic); // result.value in r0
2103 __ pop(r1); // result 2099 __ pop(r1); // result
2104 __ push(r0); // result.value 2100 __ push(r0); // result.value
2105 __ mov(r0, r1); // result 2101 __ mov(r0, r1); // result
2106 __ push(r0); // push LoadIC state
2107 __ LoadRoot(r2, Heap::kdone_stringRootIndex); // "done" 2102 __ LoadRoot(r2, Heap::kdone_stringRootIndex); // "done"
2108 Handle<Code> done_ic = isolate()->builtins()->LoadIC_Initialize(); 2103 Handle<Code> done_ic = isolate()->builtins()->LoadIC_Initialize();
2109 CallIC(done_ic); // result.done in r0 2104 CallIC(done_ic); // result.done in r0
2110 __ add(sp, sp, Operand(kPointerSize)); // drop LoadIC state
2111 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); 2105 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate());
2112 CallIC(bool_ic); 2106 CallIC(bool_ic);
2113 __ cmp(r0, Operand(0)); 2107 __ cmp(r0, Operand(0));
2114 __ b(eq, &l_try); 2108 __ b(eq, &l_try);
2115 2109
2116 // result.value 2110 // result.value
2117 __ pop(r0); // result.value 2111 __ pop(r0); // result.value
2118 context()->DropAndPlug(2, r0); // drop iter and g 2112 context()->DropAndPlug(2, r0); // drop iter and g
2119 break; 2113 break;
2120 } 2114 }
(...skipping 2814 matching lines...) Expand 10 before | Expand all | Expand 10 after
4935 *context_length = 0; 4929 *context_length = 0;
4936 return previous_; 4930 return previous_;
4937 } 4931 }
4938 4932
4939 4933
4940 #undef __ 4934 #undef __
4941 4935
4942 } } // namespace v8::internal 4936 } } // namespace v8::internal
4943 4937
4944 #endif // V8_TARGET_ARCH_ARM 4938 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/ic-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698