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

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

Issue 142813003: A64: Synchronize with r15358. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/arm/frames-arm.cc ('k') | 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 1674 matching lines...) Expand 10 before | Expand all | Expand 10 after
1685 __ push(r0); // Save result on stack 1685 __ push(r0); // Save result on stack
1686 result_saved = true; 1686 result_saved = true;
1687 } 1687 }
1688 switch (property->kind()) { 1688 switch (property->kind()) {
1689 case ObjectLiteral::Property::CONSTANT: 1689 case ObjectLiteral::Property::CONSTANT:
1690 UNREACHABLE(); 1690 UNREACHABLE();
1691 case ObjectLiteral::Property::MATERIALIZED_LITERAL: 1691 case ObjectLiteral::Property::MATERIALIZED_LITERAL:
1692 ASSERT(!CompileTimeValue::IsCompileTimeValue(property->value())); 1692 ASSERT(!CompileTimeValue::IsCompileTimeValue(property->value()));
1693 // Fall through. 1693 // Fall through.
1694 case ObjectLiteral::Property::COMPUTED: 1694 case ObjectLiteral::Property::COMPUTED:
1695 if (key->handle()->IsInternalizedString()) { 1695 if (key->value()->IsInternalizedString()) {
1696 if (property->emit_store()) { 1696 if (property->emit_store()) {
1697 VisitForAccumulatorValue(value); 1697 VisitForAccumulatorValue(value);
1698 __ mov(r2, Operand(key->handle())); 1698 __ mov(r2, Operand(key->value()));
1699 __ ldr(r1, MemOperand(sp)); 1699 __ ldr(r1, MemOperand(sp));
1700 Handle<Code> ic = is_classic_mode() 1700 Handle<Code> ic = is_classic_mode()
1701 ? isolate()->builtins()->StoreIC_Initialize() 1701 ? isolate()->builtins()->StoreIC_Initialize()
1702 : isolate()->builtins()->StoreIC_Initialize_Strict(); 1702 : isolate()->builtins()->StoreIC_Initialize_Strict();
1703 CallIC(ic, RelocInfo::CODE_TARGET, key->LiteralFeedbackId()); 1703 CallIC(ic, RelocInfo::CODE_TARGET, key->LiteralFeedbackId());
1704 PrepareForBailoutForId(key->id(), NO_REGISTERS); 1704 PrepareForBailoutForId(key->id(), NO_REGISTERS);
1705 } else { 1705 } else {
1706 VisitForEffect(value); 1706 VisitForEffect(value);
1707 } 1707 }
1708 break; 1708 break;
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1822 } 1822 }
1823 1823
1824 bool result_saved = false; // Is the result saved to the stack? 1824 bool result_saved = false; // Is the result saved to the stack?
1825 1825
1826 // Emit code to evaluate all the non-constant subexpressions and to store 1826 // Emit code to evaluate all the non-constant subexpressions and to store
1827 // them into the newly cloned array. 1827 // them into the newly cloned array.
1828 for (int i = 0; i < length; i++) { 1828 for (int i = 0; i < length; i++) {
1829 Expression* subexpr = subexprs->at(i); 1829 Expression* subexpr = subexprs->at(i);
1830 // If the subexpression is a literal or a simple materialized literal it 1830 // If the subexpression is a literal or a simple materialized literal it
1831 // is already set in the cloned array. 1831 // is already set in the cloned array.
1832 if (subexpr->AsLiteral() != NULL || 1832 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue;
1833 CompileTimeValue::IsCompileTimeValue(subexpr)) {
1834 continue;
1835 }
1836 1833
1837 if (!result_saved) { 1834 if (!result_saved) {
1838 __ push(r0); 1835 __ push(r0);
1839 __ Push(Smi::FromInt(expr->literal_index())); 1836 __ Push(Smi::FromInt(expr->literal_index()));
1840 result_saved = true; 1837 result_saved = true;
1841 } 1838 }
1842 VisitForAccumulatorValue(subexpr); 1839 VisitForAccumulatorValue(subexpr);
1843 1840
1844 if (IsFastObjectElementsKind(constant_elements_kind)) { 1841 if (IsFastObjectElementsKind(constant_elements_kind)) {
1845 int offset = FixedArray::kHeaderSize + (i * kPointerSize); 1842 int offset = FixedArray::kHeaderSize + (i * kPointerSize);
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1987 // this. It stays on the stack while we update the iterator. 1984 // this. It stays on the stack while we update the iterator.
1988 VisitForStackValue(expr->expression()); 1985 VisitForStackValue(expr->expression());
1989 1986
1990 switch (expr->yield_kind()) { 1987 switch (expr->yield_kind()) {
1991 case Yield::SUSPEND: 1988 case Yield::SUSPEND:
1992 // Pop value from top-of-stack slot; box result into result register. 1989 // Pop value from top-of-stack slot; box result into result register.
1993 EmitCreateIteratorResult(false); 1990 EmitCreateIteratorResult(false);
1994 __ push(result_register()); 1991 __ push(result_register());
1995 // Fall through. 1992 // Fall through.
1996 case Yield::INITIAL: { 1993 case Yield::INITIAL: {
1997 VisitForStackValue(expr->generator_object()); 1994 Label suspend, continuation, post_runtime, resume;
1995
1996 __ jmp(&suspend);
1997
1998 __ bind(&continuation);
1999 __ jmp(&resume);
2000
2001 __ bind(&suspend);
2002 VisitForAccumulatorValue(expr->generator_object());
2003 ASSERT(continuation.pos() > 0 && Smi::IsValid(continuation.pos()));
2004 __ mov(r1, Operand(Smi::FromInt(continuation.pos())));
2005 __ str(r1, FieldMemOperand(r0, JSGeneratorObject::kContinuationOffset));
2006 __ str(cp, FieldMemOperand(r0, JSGeneratorObject::kContextOffset));
2007 __ mov(r1, cp);
2008 __ RecordWriteField(r0, JSGeneratorObject::kContextOffset, r1, r2,
2009 kLRHasBeenSaved, kDontSaveFPRegs);
2010 __ add(r1, fp, Operand(StandardFrameConstants::kExpressionsOffset));
2011 __ cmp(sp, r1);
2012 __ b(eq, &post_runtime);
2013 __ push(r0); // generator object
1998 __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); 2014 __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1);
1999 __ ldr(context_register(), 2015 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
2000 MemOperand(fp, StandardFrameConstants::kContextOffset)); 2016 __ bind(&post_runtime);
2001
2002 Label resume;
2003 __ CompareRoot(result_register(), Heap::kTheHoleValueRootIndex);
2004 __ b(ne, &resume);
2005 __ pop(result_register()); 2017 __ pop(result_register());
2006 EmitReturnSequence(); 2018 EmitReturnSequence();
2007 2019
2008 __ bind(&resume); 2020 __ bind(&resume);
2009 context()->Plug(result_register()); 2021 context()->Plug(result_register());
2010 break; 2022 break;
2011 } 2023 }
2012 2024
2013 case Yield::FINAL: { 2025 case Yield::FINAL: {
2014 VisitForAccumulatorValue(expr->generator_object()); 2026 VisitForAccumulatorValue(expr->generator_object());
2015 __ mov(r1, Operand(Smi::FromInt(JSGeneratorObject::kGeneratorClosed))); 2027 __ mov(r1, Operand(Smi::FromInt(JSGeneratorObject::kGeneratorClosed)));
2016 __ str(r1, FieldMemOperand(result_register(), 2028 __ str(r1, FieldMemOperand(result_register(),
2017 JSGeneratorObject::kContinuationOffset)); 2029 JSGeneratorObject::kContinuationOffset));
2018 // Pop value from top-of-stack slot, box result into result register. 2030 // Pop value from top-of-stack slot, box result into result register.
2019 EmitCreateIteratorResult(true); 2031 EmitCreateIteratorResult(true);
2020 EmitUnwindBeforeReturn(); 2032 EmitUnwindBeforeReturn();
2021 EmitReturnSequence(); 2033 EmitReturnSequence();
2022 break; 2034 break;
2023 } 2035 }
2024 2036
2025 case Yield::DELEGATING: { 2037 case Yield::DELEGATING: {
2026 VisitForStackValue(expr->generator_object()); 2038 VisitForStackValue(expr->generator_object());
2027 2039
2028 // Initial stack layout is as follows: 2040 // Initial stack layout is as follows:
2029 // [sp + 1 * kPointerSize] iter 2041 // [sp + 1 * kPointerSize] iter
2030 // [sp + 0 * kPointerSize] g 2042 // [sp + 0 * kPointerSize] g
2031 2043
2032 Label l_catch, l_try, l_resume, l_next, l_call, l_loop; 2044 Label l_catch, l_try, l_suspend, l_continuation, l_resume;
2045 Label l_next, l_call, l_loop;
2033 // Initial send value is undefined. 2046 // Initial send value is undefined.
2034 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); 2047 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
2035 __ b(&l_next); 2048 __ b(&l_next);
2036 2049
2037 // catch (e) { receiver = iter; f = 'throw'; arg = e; goto l_call; } 2050 // catch (e) { receiver = iter; f = 'throw'; arg = e; goto l_call; }
2038 __ bind(&l_catch); 2051 __ bind(&l_catch);
2039 handler_table()->set(expr->index(), Smi::FromInt(l_catch.pos())); 2052 handler_table()->set(expr->index(), Smi::FromInt(l_catch.pos()));
2040 __ LoadRoot(r2, Heap::kthrow_stringRootIndex); // "throw" 2053 __ LoadRoot(r2, Heap::kthrow_stringRootIndex); // "throw"
2041 __ ldr(r3, MemOperand(sp, 1 * kPointerSize)); // iter 2054 __ ldr(r3, MemOperand(sp, 1 * kPointerSize)); // iter
2042 __ push(r3); // iter 2055 __ push(r3); // iter
2043 __ push(r0); // exception 2056 __ push(r0); // exception
2044 __ jmp(&l_call); 2057 __ jmp(&l_call);
2045 2058
2046 // try { received = %yield result } 2059 // try { received = %yield result }
2047 // Shuffle the received result above a try handler and yield it without 2060 // Shuffle the received result above a try handler and yield it without
2048 // re-boxing. 2061 // re-boxing.
2049 __ bind(&l_try); 2062 __ bind(&l_try);
2050 __ pop(r0); // result 2063 __ pop(r0); // result
2051 __ PushTryHandler(StackHandler::CATCH, expr->index()); 2064 __ PushTryHandler(StackHandler::CATCH, expr->index());
2052 const int handler_size = StackHandlerConstants::kSize; 2065 const int handler_size = StackHandlerConstants::kSize;
2053 __ push(r0); // result 2066 __ push(r0); // result
2054 __ ldr(r3, MemOperand(sp, (0 + 1) * kPointerSize + handler_size)); // g 2067 __ jmp(&l_suspend);
2055 __ push(r3); // g 2068 __ bind(&l_continuation);
2069 __ jmp(&l_resume);
2070 __ bind(&l_suspend);
2071 const int generator_object_depth = kPointerSize + handler_size;
2072 __ ldr(r0, MemOperand(sp, generator_object_depth));
2073 __ push(r0); // g
2074 ASSERT(l_continuation.pos() > 0 && Smi::IsValid(l_continuation.pos()));
2075 __ mov(r1, Operand(Smi::FromInt(l_continuation.pos())));
2076 __ str(r1, FieldMemOperand(r0, JSGeneratorObject::kContinuationOffset));
2077 __ str(cp, FieldMemOperand(r0, JSGeneratorObject::kContextOffset));
2078 __ mov(r1, cp);
2079 __ RecordWriteField(r0, JSGeneratorObject::kContextOffset, r1, r2,
2080 kLRHasBeenSaved, kDontSaveFPRegs);
2056 __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); 2081 __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1);
2057 __ ldr(context_register(), 2082 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
2058 MemOperand(fp, StandardFrameConstants::kContextOffset));
2059 __ CompareRoot(r0, Heap::kTheHoleValueRootIndex);
2060 __ b(ne, &l_resume);
2061 __ pop(r0); // result 2083 __ pop(r0); // result
2062 EmitReturnSequence(); 2084 EmitReturnSequence();
2063 __ bind(&l_resume); // received in r0 2085 __ bind(&l_resume); // received in r0
2064 __ PopTryHandler(); 2086 __ PopTryHandler();
2065 2087
2066 // receiver = iter; f = 'next'; arg = received; 2088 // receiver = iter; f = 'next'; arg = received;
2067 __ bind(&l_next); 2089 __ bind(&l_next);
2068 __ LoadRoot(r2, Heap::knext_stringRootIndex); // "next" 2090 __ LoadRoot(r2, Heap::knext_stringRootIndex); // "next"
2069 __ ldr(r3, MemOperand(sp, 1 * kPointerSize)); // iter 2091 __ ldr(r3, MemOperand(sp, 1 * kPointerSize)); // iter
2070 __ push(r3); // iter 2092 __ push(r3); // iter
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
2125 __ ldr(r2, FieldMemOperand(r1, JSGeneratorObject::kReceiverOffset)); 2147 __ ldr(r2, FieldMemOperand(r1, JSGeneratorObject::kReceiverOffset));
2126 __ push(r2); 2148 __ push(r2);
2127 2149
2128 // Push holes for the rest of the arguments to the generator function. 2150 // Push holes for the rest of the arguments to the generator function.
2129 __ ldr(r3, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); 2151 __ ldr(r3, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset));
2130 __ ldr(r3, 2152 __ ldr(r3,
2131 FieldMemOperand(r3, SharedFunctionInfo::kFormalParameterCountOffset)); 2153 FieldMemOperand(r3, SharedFunctionInfo::kFormalParameterCountOffset));
2132 __ LoadRoot(r2, Heap::kTheHoleValueRootIndex); 2154 __ LoadRoot(r2, Heap::kTheHoleValueRootIndex);
2133 Label push_argument_holes, push_frame; 2155 Label push_argument_holes, push_frame;
2134 __ bind(&push_argument_holes); 2156 __ bind(&push_argument_holes);
2135 __ sub(r3, r3, Operand(1), SetCC); 2157 __ sub(r3, r3, Operand(Smi::FromInt(1)), SetCC);
2136 __ b(mi, &push_frame); 2158 __ b(mi, &push_frame);
2137 __ push(r2); 2159 __ push(r2);
2138 __ jmp(&push_argument_holes); 2160 __ jmp(&push_argument_holes);
2139 2161
2140 // Enter a new JavaScript frame, and initialize its slots as they were when 2162 // Enter a new JavaScript frame, and initialize its slots as they were when
2141 // the generator was suspended. 2163 // the generator was suspended.
2142 Label resume_frame; 2164 Label resume_frame;
2143 __ bind(&push_frame); 2165 __ bind(&push_frame);
2144 __ bl(&resume_frame); 2166 __ bl(&resume_frame);
2145 __ jmp(&done); 2167 __ jmp(&done);
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
2229 // Only the value field needs a write barrier, as the other values are in the 2251 // Only the value field needs a write barrier, as the other values are in the
2230 // root set. 2252 // root set.
2231 __ RecordWriteField(r0, JSGeneratorObject::kResultValuePropertyOffset, 2253 __ RecordWriteField(r0, JSGeneratorObject::kResultValuePropertyOffset,
2232 r2, r3, kLRHasBeenSaved, kDontSaveFPRegs); 2254 r2, r3, kLRHasBeenSaved, kDontSaveFPRegs);
2233 } 2255 }
2234 2256
2235 2257
2236 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { 2258 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
2237 SetSourcePosition(prop->position()); 2259 SetSourcePosition(prop->position());
2238 Literal* key = prop->key()->AsLiteral(); 2260 Literal* key = prop->key()->AsLiteral();
2239 __ mov(r2, Operand(key->handle())); 2261 __ mov(r2, Operand(key->value()));
2240 // Call load IC. It has arguments receiver and property name r0 and r2. 2262 // Call load IC. It has arguments receiver and property name r0 and r2.
2241 Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize(); 2263 Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize();
2242 CallIC(ic, RelocInfo::CODE_TARGET, prop->PropertyFeedbackId()); 2264 CallIC(ic, RelocInfo::CODE_TARGET, prop->PropertyFeedbackId());
2243 } 2265 }
2244 2266
2245 2267
2246 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { 2268 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
2247 SetSourcePosition(prop->position()); 2269 SetSourcePosition(prop->position());
2248 // Call keyed load IC. It has arguments key and receiver in r0 and r1. 2270 // Call keyed load IC. It has arguments key and receiver in r0 and r1.
2249 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); 2271 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
2384 Variable* var = expr->AsVariableProxy()->var(); 2406 Variable* var = expr->AsVariableProxy()->var();
2385 EffectContext context(this); 2407 EffectContext context(this);
2386 EmitVariableAssignment(var, Token::ASSIGN); 2408 EmitVariableAssignment(var, Token::ASSIGN);
2387 break; 2409 break;
2388 } 2410 }
2389 case NAMED_PROPERTY: { 2411 case NAMED_PROPERTY: {
2390 __ push(r0); // Preserve value. 2412 __ push(r0); // Preserve value.
2391 VisitForAccumulatorValue(prop->obj()); 2413 VisitForAccumulatorValue(prop->obj());
2392 __ mov(r1, r0); 2414 __ mov(r1, r0);
2393 __ pop(r0); // Restore value. 2415 __ pop(r0); // Restore value.
2394 __ mov(r2, Operand(prop->key()->AsLiteral()->handle())); 2416 __ mov(r2, Operand(prop->key()->AsLiteral()->value()));
2395 Handle<Code> ic = is_classic_mode() 2417 Handle<Code> ic = is_classic_mode()
2396 ? isolate()->builtins()->StoreIC_Initialize() 2418 ? isolate()->builtins()->StoreIC_Initialize()
2397 : isolate()->builtins()->StoreIC_Initialize_Strict(); 2419 : isolate()->builtins()->StoreIC_Initialize_Strict();
2398 CallIC(ic); 2420 CallIC(ic);
2399 break; 2421 break;
2400 } 2422 }
2401 case KEYED_PROPERTY: { 2423 case KEYED_PROPERTY: {
2402 __ push(r0); // Preserve value. 2424 __ push(r0); // Preserve value.
2403 VisitForStackValue(prop->obj()); 2425 VisitForStackValue(prop->obj());
2404 VisitForAccumulatorValue(prop->key()); 2426 VisitForAccumulatorValue(prop->key());
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
2513 2535
2514 2536
2515 void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { 2537 void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
2516 // Assignment to a property, using a named store IC. 2538 // Assignment to a property, using a named store IC.
2517 Property* prop = expr->target()->AsProperty(); 2539 Property* prop = expr->target()->AsProperty();
2518 ASSERT(prop != NULL); 2540 ASSERT(prop != NULL);
2519 ASSERT(prop->key()->AsLiteral() != NULL); 2541 ASSERT(prop->key()->AsLiteral() != NULL);
2520 2542
2521 // Record source code position before IC call. 2543 // Record source code position before IC call.
2522 SetSourcePosition(expr->position()); 2544 SetSourcePosition(expr->position());
2523 __ mov(r2, Operand(prop->key()->AsLiteral()->handle())); 2545 __ mov(r2, Operand(prop->key()->AsLiteral()->value()));
2524 __ pop(r1); 2546 __ pop(r1);
2525 2547
2526 Handle<Code> ic = is_classic_mode() 2548 Handle<Code> ic = is_classic_mode()
2527 ? isolate()->builtins()->StoreIC_Initialize() 2549 ? isolate()->builtins()->StoreIC_Initialize()
2528 : isolate()->builtins()->StoreIC_Initialize_Strict(); 2550 : isolate()->builtins()->StoreIC_Initialize_Strict();
2529 CallIC(ic, RelocInfo::CODE_TARGET, expr->AssignmentFeedbackId()); 2551 CallIC(ic, RelocInfo::CODE_TARGET, expr->AssignmentFeedbackId());
2530 2552
2531 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); 2553 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
2532 context()->Plug(r0); 2554 context()->Plug(r0);
2533 } 2555 }
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
2787 // The receiver is either the global receiver or an object found 2809 // The receiver is either the global receiver or an object found
2788 // by LoadContextSlot. That object could be the hole if the 2810 // by LoadContextSlot. That object could be the hole if the
2789 // receiver is implicitly the global object. 2811 // receiver is implicitly the global object.
2790 EmitCallWithStub(expr, RECEIVER_MIGHT_BE_IMPLICIT); 2812 EmitCallWithStub(expr, RECEIVER_MIGHT_BE_IMPLICIT);
2791 } else if (property != NULL) { 2813 } else if (property != NULL) {
2792 { PreservePositionScope scope(masm()->positions_recorder()); 2814 { PreservePositionScope scope(masm()->positions_recorder());
2793 VisitForStackValue(property->obj()); 2815 VisitForStackValue(property->obj());
2794 } 2816 }
2795 if (property->key()->IsPropertyName()) { 2817 if (property->key()->IsPropertyName()) {
2796 EmitCallWithIC(expr, 2818 EmitCallWithIC(expr,
2797 property->key()->AsLiteral()->handle(), 2819 property->key()->AsLiteral()->value(),
2798 RelocInfo::CODE_TARGET); 2820 RelocInfo::CODE_TARGET);
2799 } else { 2821 } else {
2800 EmitKeyedCallWithIC(expr, property->key()); 2822 EmitKeyedCallWithIC(expr, property->key());
2801 } 2823 }
2802 } else { 2824 } else {
2803 // Call to an arbitrary expression not handled specially above. 2825 // Call to an arbitrary expression not handled specially above.
2804 { PreservePositionScope scope(masm()->positions_recorder()); 2826 { PreservePositionScope scope(masm()->positions_recorder());
2805 VisitForStackValue(callee); 2827 VisitForStackValue(callee);
2806 } 2828 }
2807 // Load global receiver object. 2829 // Load global receiver object.
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
3395 3417
3396 __ bind(&done); 3418 __ bind(&done);
3397 context()->Plug(r0); 3419 context()->Plug(r0);
3398 } 3420 }
3399 3421
3400 3422
3401 void FullCodeGenerator::EmitDateField(CallRuntime* expr) { 3423 void FullCodeGenerator::EmitDateField(CallRuntime* expr) {
3402 ZoneList<Expression*>* args = expr->arguments(); 3424 ZoneList<Expression*>* args = expr->arguments();
3403 ASSERT(args->length() == 2); 3425 ASSERT(args->length() == 2);
3404 ASSERT_NE(NULL, args->at(1)->AsLiteral()); 3426 ASSERT_NE(NULL, args->at(1)->AsLiteral());
3405 Smi* index = Smi::cast(*(args->at(1)->AsLiteral()->handle())); 3427 Smi* index = Smi::cast(*(args->at(1)->AsLiteral()->value()));
3406 3428
3407 VisitForAccumulatorValue(args->at(0)); // Load the object. 3429 VisitForAccumulatorValue(args->at(0)); // Load the object.
3408 3430
3409 Label runtime, done, not_date_object; 3431 Label runtime, done, not_date_object;
3410 Register object = r0; 3432 Register object = r0;
3411 Register result = r0; 3433 Register result = r0;
3412 Register scratch0 = r9; 3434 Register scratch0 = r9;
3413 Register scratch1 = r1; 3435 Register scratch1 = r1;
3414 3436
3415 __ JumpIfSmi(object, &not_date_object); 3437 __ JumpIfSmi(object, &not_date_object);
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
3814 VisitForStackValue(args->at(2)); 3836 VisitForStackValue(args->at(2));
3815 __ CallStub(&stub); 3837 __ CallStub(&stub);
3816 context()->Plug(r0); 3838 context()->Plug(r0);
3817 } 3839 }
3818 3840
3819 3841
3820 void FullCodeGenerator::EmitGetFromCache(CallRuntime* expr) { 3842 void FullCodeGenerator::EmitGetFromCache(CallRuntime* expr) {
3821 ZoneList<Expression*>* args = expr->arguments(); 3843 ZoneList<Expression*>* args = expr->arguments();
3822 ASSERT_EQ(2, args->length()); 3844 ASSERT_EQ(2, args->length());
3823 ASSERT_NE(NULL, args->at(0)->AsLiteral()); 3845 ASSERT_NE(NULL, args->at(0)->AsLiteral());
3824 int cache_id = Smi::cast(*(args->at(0)->AsLiteral()->handle()))->value(); 3846 int cache_id = Smi::cast(*(args->at(0)->AsLiteral()->value()))->value();
3825 3847
3826 Handle<FixedArray> jsfunction_result_caches( 3848 Handle<FixedArray> jsfunction_result_caches(
3827 isolate()->native_context()->jsfunction_result_caches()); 3849 isolate()->native_context()->jsfunction_result_caches());
3828 if (jsfunction_result_caches->length() <= cache_id) { 3850 if (jsfunction_result_caches->length() <= cache_id) {
3829 __ Abort("Attempt to use undefined cache."); 3851 __ Abort("Attempt to use undefined cache.");
3830 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); 3852 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
3831 context()->Plug(r0); 3853 context()->Plug(r0);
3832 return; 3854 return;
3833 } 3855 }
3834 3856
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
4487 context()->PlugTOS(); 4509 context()->PlugTOS();
4488 } 4510 }
4489 } else { 4511 } else {
4490 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), 4512 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
4491 Token::ASSIGN); 4513 Token::ASSIGN);
4492 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); 4514 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
4493 context()->Plug(r0); 4515 context()->Plug(r0);
4494 } 4516 }
4495 break; 4517 break;
4496 case NAMED_PROPERTY: { 4518 case NAMED_PROPERTY: {
4497 __ mov(r2, Operand(prop->key()->AsLiteral()->handle())); 4519 __ mov(r2, Operand(prop->key()->AsLiteral()->value()));
4498 __ pop(r1); 4520 __ pop(r1);
4499 Handle<Code> ic = is_classic_mode() 4521 Handle<Code> ic = is_classic_mode()
4500 ? isolate()->builtins()->StoreIC_Initialize() 4522 ? isolate()->builtins()->StoreIC_Initialize()
4501 : isolate()->builtins()->StoreIC_Initialize_Strict(); 4523 : isolate()->builtins()->StoreIC_Initialize_Strict();
4502 CallIC(ic, RelocInfo::CODE_TARGET, expr->CountStoreFeedbackId()); 4524 CallIC(ic, RelocInfo::CODE_TARGET, expr->CountStoreFeedbackId());
4503 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); 4525 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
4504 if (expr->is_postfix()) { 4526 if (expr->is_postfix()) {
4505 if (!context()->IsEffect()) { 4527 if (!context()->IsEffect()) {
4506 context()->PlugTOS(); 4528 context()->PlugTOS();
4507 } 4529 }
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
4893 *context_length = 0; 4915 *context_length = 0;
4894 return previous_; 4916 return previous_;
4895 } 4917 }
4896 4918
4897 4919
4898 #undef __ 4920 #undef __
4899 4921
4900 } } // namespace v8::internal 4922 } } // namespace v8::internal
4901 4923
4902 #endif // V8_TARGET_ARCH_ARM 4924 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/frames-arm.cc ('k') | src/arm/ic-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698