| 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 1645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1656 __ push(rax); // Save result on the stack | 1656 __ push(rax); // Save result on the stack |
| 1657 result_saved = true; | 1657 result_saved = true; |
| 1658 } | 1658 } |
| 1659 switch (property->kind()) { | 1659 switch (property->kind()) { |
| 1660 case ObjectLiteral::Property::CONSTANT: | 1660 case ObjectLiteral::Property::CONSTANT: |
| 1661 UNREACHABLE(); | 1661 UNREACHABLE(); |
| 1662 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | 1662 case ObjectLiteral::Property::MATERIALIZED_LITERAL: |
| 1663 ASSERT(!CompileTimeValue::IsCompileTimeValue(value)); | 1663 ASSERT(!CompileTimeValue::IsCompileTimeValue(value)); |
| 1664 // Fall through. | 1664 // Fall through. |
| 1665 case ObjectLiteral::Property::COMPUTED: | 1665 case ObjectLiteral::Property::COMPUTED: |
| 1666 if (key->handle()->IsInternalizedString()) { | 1666 if (key->value()->IsInternalizedString()) { |
| 1667 if (property->emit_store()) { | 1667 if (property->emit_store()) { |
| 1668 VisitForAccumulatorValue(value); | 1668 VisitForAccumulatorValue(value); |
| 1669 __ Move(rcx, key->handle()); | 1669 __ Move(rcx, key->value()); |
| 1670 __ movq(rdx, Operand(rsp, 0)); | 1670 __ movq(rdx, Operand(rsp, 0)); |
| 1671 Handle<Code> ic = is_classic_mode() | 1671 Handle<Code> ic = is_classic_mode() |
| 1672 ? isolate()->builtins()->StoreIC_Initialize() | 1672 ? isolate()->builtins()->StoreIC_Initialize() |
| 1673 : isolate()->builtins()->StoreIC_Initialize_Strict(); | 1673 : isolate()->builtins()->StoreIC_Initialize_Strict(); |
| 1674 CallIC(ic, RelocInfo::CODE_TARGET, key->LiteralFeedbackId()); | 1674 CallIC(ic, RelocInfo::CODE_TARGET, key->LiteralFeedbackId()); |
| 1675 PrepareForBailoutForId(key->id(), NO_REGISTERS); | 1675 PrepareForBailoutForId(key->id(), NO_REGISTERS); |
| 1676 } else { | 1676 } else { |
| 1677 VisitForEffect(value); | 1677 VisitForEffect(value); |
| 1678 } | 1678 } |
| 1679 break; | 1679 break; |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1799 } | 1799 } |
| 1800 | 1800 |
| 1801 bool result_saved = false; // Is the result saved to the stack? | 1801 bool result_saved = false; // Is the result saved to the stack? |
| 1802 | 1802 |
| 1803 // Emit code to evaluate all the non-constant subexpressions and to store | 1803 // Emit code to evaluate all the non-constant subexpressions and to store |
| 1804 // them into the newly cloned array. | 1804 // them into the newly cloned array. |
| 1805 for (int i = 0; i < length; i++) { | 1805 for (int i = 0; i < length; i++) { |
| 1806 Expression* subexpr = subexprs->at(i); | 1806 Expression* subexpr = subexprs->at(i); |
| 1807 // If the subexpression is a literal or a simple materialized literal it | 1807 // If the subexpression is a literal or a simple materialized literal it |
| 1808 // is already set in the cloned array. | 1808 // is already set in the cloned array. |
| 1809 if (subexpr->AsLiteral() != NULL || | 1809 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; |
| 1810 CompileTimeValue::IsCompileTimeValue(subexpr)) { | |
| 1811 continue; | |
| 1812 } | |
| 1813 | 1810 |
| 1814 if (!result_saved) { | 1811 if (!result_saved) { |
| 1815 __ push(rax); // array literal | 1812 __ push(rax); // array literal |
| 1816 __ Push(Smi::FromInt(expr->literal_index())); | 1813 __ Push(Smi::FromInt(expr->literal_index())); |
| 1817 result_saved = true; | 1814 result_saved = true; |
| 1818 } | 1815 } |
| 1819 VisitForAccumulatorValue(subexpr); | 1816 VisitForAccumulatorValue(subexpr); |
| 1820 | 1817 |
| 1821 if (IsFastObjectElementsKind(constant_elements_kind)) { | 1818 if (IsFastObjectElementsKind(constant_elements_kind)) { |
| 1822 // Fast-case array literal with ElementsKind of FAST_*_ELEMENTS, they | 1819 // Fast-case array literal with ElementsKind of FAST_*_ELEMENTS, they |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1969 // this. It stays on the stack while we update the iterator. | 1966 // this. It stays on the stack while we update the iterator. |
| 1970 VisitForStackValue(expr->expression()); | 1967 VisitForStackValue(expr->expression()); |
| 1971 | 1968 |
| 1972 switch (expr->yield_kind()) { | 1969 switch (expr->yield_kind()) { |
| 1973 case Yield::SUSPEND: | 1970 case Yield::SUSPEND: |
| 1974 // Pop value from top-of-stack slot; box result into result register. | 1971 // Pop value from top-of-stack slot; box result into result register. |
| 1975 EmitCreateIteratorResult(false); | 1972 EmitCreateIteratorResult(false); |
| 1976 __ push(result_register()); | 1973 __ push(result_register()); |
| 1977 // Fall through. | 1974 // Fall through. |
| 1978 case Yield::INITIAL: { | 1975 case Yield::INITIAL: { |
| 1979 VisitForStackValue(expr->generator_object()); | 1976 Label suspend, continuation, post_runtime, resume; |
| 1977 |
| 1978 __ jmp(&suspend); |
| 1979 |
| 1980 __ bind(&continuation); |
| 1981 __ jmp(&resume); |
| 1982 |
| 1983 __ bind(&suspend); |
| 1984 VisitForAccumulatorValue(expr->generator_object()); |
| 1985 ASSERT(continuation.pos() > 0 && Smi::IsValid(continuation.pos())); |
| 1986 __ Move(FieldOperand(rax, JSGeneratorObject::kContinuationOffset), |
| 1987 Smi::FromInt(continuation.pos())); |
| 1988 __ movq(FieldOperand(rax, JSGeneratorObject::kContextOffset), rsi); |
| 1989 __ movq(rcx, rsi); |
| 1990 __ RecordWriteField(rax, JSGeneratorObject::kContextOffset, rcx, rdx, |
| 1991 kDontSaveFPRegs); |
| 1992 __ lea(rbx, Operand(rbp, StandardFrameConstants::kExpressionsOffset)); |
| 1993 __ cmpq(rsp, rbx); |
| 1994 __ j(equal, &post_runtime); |
| 1995 __ push(rax); // generator object |
| 1980 __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); | 1996 __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); |
| 1981 __ movq(context_register(), | 1997 __ movq(context_register(), |
| 1982 Operand(rbp, StandardFrameConstants::kContextOffset)); | 1998 Operand(rbp, StandardFrameConstants::kContextOffset)); |
| 1999 __ bind(&post_runtime); |
| 1983 | 2000 |
| 1984 Label resume; | |
| 1985 __ CompareRoot(result_register(), Heap::kTheHoleValueRootIndex); | |
| 1986 __ j(not_equal, &resume); | |
| 1987 __ pop(result_register()); | 2001 __ pop(result_register()); |
| 1988 EmitReturnSequence(); | 2002 EmitReturnSequence(); |
| 1989 | 2003 |
| 1990 __ bind(&resume); | 2004 __ bind(&resume); |
| 1991 context()->Plug(result_register()); | 2005 context()->Plug(result_register()); |
| 1992 break; | 2006 break; |
| 1993 } | 2007 } |
| 1994 | 2008 |
| 1995 case Yield::FINAL: { | 2009 case Yield::FINAL: { |
| 1996 VisitForAccumulatorValue(expr->generator_object()); | 2010 VisitForAccumulatorValue(expr->generator_object()); |
| 1997 __ Move(FieldOperand(result_register(), | 2011 __ Move(FieldOperand(result_register(), |
| 1998 JSGeneratorObject::kContinuationOffset), | 2012 JSGeneratorObject::kContinuationOffset), |
| 1999 Smi::FromInt(JSGeneratorObject::kGeneratorClosed)); | 2013 Smi::FromInt(JSGeneratorObject::kGeneratorClosed)); |
| 2000 // Pop value from top-of-stack slot, box result into result register. | 2014 // Pop value from top-of-stack slot, box result into result register. |
| 2001 EmitCreateIteratorResult(true); | 2015 EmitCreateIteratorResult(true); |
| 2002 EmitUnwindBeforeReturn(); | 2016 EmitUnwindBeforeReturn(); |
| 2003 EmitReturnSequence(); | 2017 EmitReturnSequence(); |
| 2004 break; | 2018 break; |
| 2005 } | 2019 } |
| 2006 | 2020 |
| 2007 case Yield::DELEGATING: { | 2021 case Yield::DELEGATING: { |
| 2008 VisitForStackValue(expr->generator_object()); | 2022 VisitForStackValue(expr->generator_object()); |
| 2009 | 2023 |
| 2010 // Initial stack layout is as follows: | 2024 // Initial stack layout is as follows: |
| 2011 // [sp + 1 * kPointerSize] iter | 2025 // [sp + 1 * kPointerSize] iter |
| 2012 // [sp + 0 * kPointerSize] g | 2026 // [sp + 0 * kPointerSize] g |
| 2013 | 2027 |
| 2014 Label l_catch, l_try, l_resume, l_next, l_call, l_loop; | 2028 Label l_catch, l_try, l_suspend, l_continuation, l_resume; |
| 2029 Label l_next, l_call, l_loop; |
| 2015 // Initial send value is undefined. | 2030 // Initial send value is undefined. |
| 2016 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); | 2031 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); |
| 2017 __ jmp(&l_next); | 2032 __ jmp(&l_next); |
| 2018 | 2033 |
| 2019 // catch (e) { receiver = iter; f = 'throw'; arg = e; goto l_call; } | 2034 // catch (e) { receiver = iter; f = 'throw'; arg = e; goto l_call; } |
| 2020 __ bind(&l_catch); | 2035 __ bind(&l_catch); |
| 2021 handler_table()->set(expr->index(), Smi::FromInt(l_catch.pos())); | 2036 handler_table()->set(expr->index(), Smi::FromInt(l_catch.pos())); |
| 2022 __ LoadRoot(rcx, Heap::kthrow_stringRootIndex); // "throw" | 2037 __ LoadRoot(rcx, Heap::kthrow_stringRootIndex); // "throw" |
| 2023 __ push(rcx); | 2038 __ push(rcx); |
| 2024 __ push(Operand(rsp, 2 * kPointerSize)); // iter | 2039 __ push(Operand(rsp, 2 * kPointerSize)); // iter |
| 2025 __ push(rax); // exception | 2040 __ push(rax); // exception |
| 2026 __ jmp(&l_call); | 2041 __ jmp(&l_call); |
| 2027 | 2042 |
| 2028 // try { received = %yield result } | 2043 // try { received = %yield result } |
| 2029 // Shuffle the received result above a try handler and yield it without | 2044 // Shuffle the received result above a try handler and yield it without |
| 2030 // re-boxing. | 2045 // re-boxing. |
| 2031 __ bind(&l_try); | 2046 __ bind(&l_try); |
| 2032 __ pop(rax); // result | 2047 __ pop(rax); // result |
| 2033 __ PushTryHandler(StackHandler::CATCH, expr->index()); | 2048 __ PushTryHandler(StackHandler::CATCH, expr->index()); |
| 2034 const int handler_size = StackHandlerConstants::kSize; | 2049 const int handler_size = StackHandlerConstants::kSize; |
| 2035 __ push(rax); // result | 2050 __ push(rax); // result |
| 2036 __ push(Operand(rsp, (0 + 1) * kPointerSize + handler_size)); // g | 2051 __ jmp(&l_suspend); |
| 2052 __ bind(&l_continuation); |
| 2053 __ jmp(&l_resume); |
| 2054 __ bind(&l_suspend); |
| 2055 const int generator_object_depth = kPointerSize + handler_size; |
| 2056 __ movq(rax, Operand(rsp, generator_object_depth)); |
| 2057 __ push(rax); // g |
| 2058 ASSERT(l_continuation.pos() > 0 && Smi::IsValid(l_continuation.pos())); |
| 2059 __ Move(FieldOperand(rax, JSGeneratorObject::kContinuationOffset), |
| 2060 Smi::FromInt(l_continuation.pos())); |
| 2061 __ movq(FieldOperand(rax, JSGeneratorObject::kContextOffset), rsi); |
| 2062 __ movq(rcx, rsi); |
| 2063 __ RecordWriteField(rax, JSGeneratorObject::kContextOffset, rcx, rdx, |
| 2064 kDontSaveFPRegs); |
| 2037 __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); | 2065 __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); |
| 2038 __ movq(context_register(), | 2066 __ movq(context_register(), |
| 2039 Operand(rbp, StandardFrameConstants::kContextOffset)); | 2067 Operand(rbp, StandardFrameConstants::kContextOffset)); |
| 2040 __ CompareRoot(rax, Heap::kTheHoleValueRootIndex); | |
| 2041 __ j(not_equal, &l_resume); | |
| 2042 __ pop(rax); // result | 2068 __ pop(rax); // result |
| 2043 EmitReturnSequence(); | 2069 EmitReturnSequence(); |
| 2044 __ bind(&l_resume); // received in rax | 2070 __ bind(&l_resume); // received in rax |
| 2045 __ PopTryHandler(); | 2071 __ PopTryHandler(); |
| 2046 | 2072 |
| 2047 // receiver = iter; f = 'next'; arg = received; | 2073 // receiver = iter; f = 'next'; arg = received; |
| 2048 __ bind(&l_next); | 2074 __ bind(&l_next); |
| 2049 __ LoadRoot(rcx, Heap::knext_stringRootIndex); // "next" | 2075 __ LoadRoot(rcx, Heap::knext_stringRootIndex); // "next" |
| 2050 __ push(rcx); | 2076 __ push(rcx); |
| 2051 __ push(Operand(rsp, 2 * kPointerSize)); // iter | 2077 __ push(Operand(rsp, 2 * kPointerSize)); // iter |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2211 // Only the value field needs a write barrier, as the other values are in the | 2237 // Only the value field needs a write barrier, as the other values are in the |
| 2212 // root set. | 2238 // root set. |
| 2213 __ RecordWriteField(rax, JSGeneratorObject::kResultValuePropertyOffset, | 2239 __ RecordWriteField(rax, JSGeneratorObject::kResultValuePropertyOffset, |
| 2214 rcx, rdx, kDontSaveFPRegs); | 2240 rcx, rdx, kDontSaveFPRegs); |
| 2215 } | 2241 } |
| 2216 | 2242 |
| 2217 | 2243 |
| 2218 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { | 2244 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { |
| 2219 SetSourcePosition(prop->position()); | 2245 SetSourcePosition(prop->position()); |
| 2220 Literal* key = prop->key()->AsLiteral(); | 2246 Literal* key = prop->key()->AsLiteral(); |
| 2221 __ Move(rcx, key->handle()); | 2247 __ Move(rcx, key->value()); |
| 2222 Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize(); | 2248 Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize(); |
| 2223 CallIC(ic, RelocInfo::CODE_TARGET, prop->PropertyFeedbackId()); | 2249 CallIC(ic, RelocInfo::CODE_TARGET, prop->PropertyFeedbackId()); |
| 2224 } | 2250 } |
| 2225 | 2251 |
| 2226 | 2252 |
| 2227 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { | 2253 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { |
| 2228 SetSourcePosition(prop->position()); | 2254 SetSourcePosition(prop->position()); |
| 2229 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); | 2255 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); |
| 2230 CallIC(ic, RelocInfo::CODE_TARGET, prop->PropertyFeedbackId()); | 2256 CallIC(ic, RelocInfo::CODE_TARGET, prop->PropertyFeedbackId()); |
| 2231 } | 2257 } |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2330 Variable* var = expr->AsVariableProxy()->var(); | 2356 Variable* var = expr->AsVariableProxy()->var(); |
| 2331 EffectContext context(this); | 2357 EffectContext context(this); |
| 2332 EmitVariableAssignment(var, Token::ASSIGN); | 2358 EmitVariableAssignment(var, Token::ASSIGN); |
| 2333 break; | 2359 break; |
| 2334 } | 2360 } |
| 2335 case NAMED_PROPERTY: { | 2361 case NAMED_PROPERTY: { |
| 2336 __ push(rax); // Preserve value. | 2362 __ push(rax); // Preserve value. |
| 2337 VisitForAccumulatorValue(prop->obj()); | 2363 VisitForAccumulatorValue(prop->obj()); |
| 2338 __ movq(rdx, rax); | 2364 __ movq(rdx, rax); |
| 2339 __ pop(rax); // Restore value. | 2365 __ pop(rax); // Restore value. |
| 2340 __ Move(rcx, prop->key()->AsLiteral()->handle()); | 2366 __ Move(rcx, prop->key()->AsLiteral()->value()); |
| 2341 Handle<Code> ic = is_classic_mode() | 2367 Handle<Code> ic = is_classic_mode() |
| 2342 ? isolate()->builtins()->StoreIC_Initialize() | 2368 ? isolate()->builtins()->StoreIC_Initialize() |
| 2343 : isolate()->builtins()->StoreIC_Initialize_Strict(); | 2369 : isolate()->builtins()->StoreIC_Initialize_Strict(); |
| 2344 CallIC(ic); | 2370 CallIC(ic); |
| 2345 break; | 2371 break; |
| 2346 } | 2372 } |
| 2347 case KEYED_PROPERTY: { | 2373 case KEYED_PROPERTY: { |
| 2348 __ push(rax); // Preserve value. | 2374 __ push(rax); // Preserve value. |
| 2349 VisitForStackValue(prop->obj()); | 2375 VisitForStackValue(prop->obj()); |
| 2350 VisitForAccumulatorValue(prop->key()); | 2376 VisitForAccumulatorValue(prop->key()); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2453 | 2479 |
| 2454 | 2480 |
| 2455 void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { | 2481 void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { |
| 2456 // Assignment to a property, using a named store IC. | 2482 // Assignment to a property, using a named store IC. |
| 2457 Property* prop = expr->target()->AsProperty(); | 2483 Property* prop = expr->target()->AsProperty(); |
| 2458 ASSERT(prop != NULL); | 2484 ASSERT(prop != NULL); |
| 2459 ASSERT(prop->key()->AsLiteral() != NULL); | 2485 ASSERT(prop->key()->AsLiteral() != NULL); |
| 2460 | 2486 |
| 2461 // Record source code position before IC call. | 2487 // Record source code position before IC call. |
| 2462 SetSourcePosition(expr->position()); | 2488 SetSourcePosition(expr->position()); |
| 2463 __ Move(rcx, prop->key()->AsLiteral()->handle()); | 2489 __ Move(rcx, prop->key()->AsLiteral()->value()); |
| 2464 __ pop(rdx); | 2490 __ pop(rdx); |
| 2465 Handle<Code> ic = is_classic_mode() | 2491 Handle<Code> ic = is_classic_mode() |
| 2466 ? isolate()->builtins()->StoreIC_Initialize() | 2492 ? isolate()->builtins()->StoreIC_Initialize() |
| 2467 : isolate()->builtins()->StoreIC_Initialize_Strict(); | 2493 : isolate()->builtins()->StoreIC_Initialize_Strict(); |
| 2468 CallIC(ic, RelocInfo::CODE_TARGET, expr->AssignmentFeedbackId()); | 2494 CallIC(ic, RelocInfo::CODE_TARGET, expr->AssignmentFeedbackId()); |
| 2469 | 2495 |
| 2470 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); | 2496 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
| 2471 context()->Plug(rax); | 2497 context()->Plug(rax); |
| 2472 } | 2498 } |
| 2473 | 2499 |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2713 // The receiver is either the global receiver or an object found by | 2739 // The receiver is either the global receiver or an object found by |
| 2714 // LoadContextSlot. That object could be the hole if the receiver is | 2740 // LoadContextSlot. That object could be the hole if the receiver is |
| 2715 // implicitly the global object. | 2741 // implicitly the global object. |
| 2716 EmitCallWithStub(expr, RECEIVER_MIGHT_BE_IMPLICIT); | 2742 EmitCallWithStub(expr, RECEIVER_MIGHT_BE_IMPLICIT); |
| 2717 } else if (property != NULL) { | 2743 } else if (property != NULL) { |
| 2718 { PreservePositionScope scope(masm()->positions_recorder()); | 2744 { PreservePositionScope scope(masm()->positions_recorder()); |
| 2719 VisitForStackValue(property->obj()); | 2745 VisitForStackValue(property->obj()); |
| 2720 } | 2746 } |
| 2721 if (property->key()->IsPropertyName()) { | 2747 if (property->key()->IsPropertyName()) { |
| 2722 EmitCallWithIC(expr, | 2748 EmitCallWithIC(expr, |
| 2723 property->key()->AsLiteral()->handle(), | 2749 property->key()->AsLiteral()->value(), |
| 2724 RelocInfo::CODE_TARGET); | 2750 RelocInfo::CODE_TARGET); |
| 2725 } else { | 2751 } else { |
| 2726 EmitKeyedCallWithIC(expr, property->key()); | 2752 EmitKeyedCallWithIC(expr, property->key()); |
| 2727 } | 2753 } |
| 2728 } else { | 2754 } else { |
| 2729 // Call to an arbitrary expression not handled specially above. | 2755 // Call to an arbitrary expression not handled specially above. |
| 2730 { PreservePositionScope scope(masm()->positions_recorder()); | 2756 { PreservePositionScope scope(masm()->positions_recorder()); |
| 2731 VisitForStackValue(callee); | 2757 VisitForStackValue(callee); |
| 2732 } | 2758 } |
| 2733 // Load global receiver object. | 2759 // Load global receiver object. |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3318 | 3344 |
| 3319 __ bind(&done); | 3345 __ bind(&done); |
| 3320 context()->Plug(rax); | 3346 context()->Plug(rax); |
| 3321 } | 3347 } |
| 3322 | 3348 |
| 3323 | 3349 |
| 3324 void FullCodeGenerator::EmitDateField(CallRuntime* expr) { | 3350 void FullCodeGenerator::EmitDateField(CallRuntime* expr) { |
| 3325 ZoneList<Expression*>* args = expr->arguments(); | 3351 ZoneList<Expression*>* args = expr->arguments(); |
| 3326 ASSERT(args->length() == 2); | 3352 ASSERT(args->length() == 2); |
| 3327 ASSERT_NE(NULL, args->at(1)->AsLiteral()); | 3353 ASSERT_NE(NULL, args->at(1)->AsLiteral()); |
| 3328 Smi* index = Smi::cast(*(args->at(1)->AsLiteral()->handle())); | 3354 Smi* index = Smi::cast(*(args->at(1)->AsLiteral()->value())); |
| 3329 | 3355 |
| 3330 VisitForAccumulatorValue(args->at(0)); // Load the object. | 3356 VisitForAccumulatorValue(args->at(0)); // Load the object. |
| 3331 | 3357 |
| 3332 Label runtime, done, not_date_object; | 3358 Label runtime, done, not_date_object; |
| 3333 Register object = rax; | 3359 Register object = rax; |
| 3334 Register result = rax; | 3360 Register result = rax; |
| 3335 Register scratch = rcx; | 3361 Register scratch = rcx; |
| 3336 | 3362 |
| 3337 __ JumpIfSmi(object, ¬_date_object); | 3363 __ JumpIfSmi(object, ¬_date_object); |
| 3338 __ CmpObjectType(object, JS_DATE_TYPE, scratch); | 3364 __ CmpObjectType(object, JS_DATE_TYPE, scratch); |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3739 __ CallStub(&stub); | 3765 __ CallStub(&stub); |
| 3740 context()->Plug(rax); | 3766 context()->Plug(rax); |
| 3741 } | 3767 } |
| 3742 | 3768 |
| 3743 | 3769 |
| 3744 void FullCodeGenerator::EmitGetFromCache(CallRuntime* expr) { | 3770 void FullCodeGenerator::EmitGetFromCache(CallRuntime* expr) { |
| 3745 ZoneList<Expression*>* args = expr->arguments(); | 3771 ZoneList<Expression*>* args = expr->arguments(); |
| 3746 ASSERT_EQ(2, args->length()); | 3772 ASSERT_EQ(2, args->length()); |
| 3747 | 3773 |
| 3748 ASSERT_NE(NULL, args->at(0)->AsLiteral()); | 3774 ASSERT_NE(NULL, args->at(0)->AsLiteral()); |
| 3749 int cache_id = Smi::cast(*(args->at(0)->AsLiteral()->handle()))->value(); | 3775 int cache_id = Smi::cast(*(args->at(0)->AsLiteral()->value()))->value(); |
| 3750 | 3776 |
| 3751 Handle<FixedArray> jsfunction_result_caches( | 3777 Handle<FixedArray> jsfunction_result_caches( |
| 3752 isolate()->native_context()->jsfunction_result_caches()); | 3778 isolate()->native_context()->jsfunction_result_caches()); |
| 3753 if (jsfunction_result_caches->length() <= cache_id) { | 3779 if (jsfunction_result_caches->length() <= cache_id) { |
| 3754 __ Abort("Attempt to use undefined cache."); | 3780 __ Abort("Attempt to use undefined cache."); |
| 3755 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); | 3781 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); |
| 3756 context()->Plug(rax); | 3782 context()->Plug(rax); |
| 3757 return; | 3783 return; |
| 3758 } | 3784 } |
| 3759 | 3785 |
| (...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4477 } | 4503 } |
| 4478 } else { | 4504 } else { |
| 4479 // Perform the assignment as if via '='. | 4505 // Perform the assignment as if via '='. |
| 4480 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), | 4506 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
| 4481 Token::ASSIGN); | 4507 Token::ASSIGN); |
| 4482 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); | 4508 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
| 4483 context()->Plug(rax); | 4509 context()->Plug(rax); |
| 4484 } | 4510 } |
| 4485 break; | 4511 break; |
| 4486 case NAMED_PROPERTY: { | 4512 case NAMED_PROPERTY: { |
| 4487 __ Move(rcx, prop->key()->AsLiteral()->handle()); | 4513 __ Move(rcx, prop->key()->AsLiteral()->value()); |
| 4488 __ pop(rdx); | 4514 __ pop(rdx); |
| 4489 Handle<Code> ic = is_classic_mode() | 4515 Handle<Code> ic = is_classic_mode() |
| 4490 ? isolate()->builtins()->StoreIC_Initialize() | 4516 ? isolate()->builtins()->StoreIC_Initialize() |
| 4491 : isolate()->builtins()->StoreIC_Initialize_Strict(); | 4517 : isolate()->builtins()->StoreIC_Initialize_Strict(); |
| 4492 CallIC(ic, RelocInfo::CODE_TARGET, expr->CountStoreFeedbackId()); | 4518 CallIC(ic, RelocInfo::CODE_TARGET, expr->CountStoreFeedbackId()); |
| 4493 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); | 4519 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
| 4494 if (expr->is_postfix()) { | 4520 if (expr->is_postfix()) { |
| 4495 if (!context()->IsEffect()) { | 4521 if (!context()->IsEffect()) { |
| 4496 context()->PlugTOS(); | 4522 context()->PlugTOS(); |
| 4497 } | 4523 } |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4880 *context_length = 0; | 4906 *context_length = 0; |
| 4881 return previous_; | 4907 return previous_; |
| 4882 } | 4908 } |
| 4883 | 4909 |
| 4884 | 4910 |
| 4885 #undef __ | 4911 #undef __ |
| 4886 | 4912 |
| 4887 } } // namespace v8::internal | 4913 } } // namespace v8::internal |
| 4888 | 4914 |
| 4889 #endif // V8_TARGET_ARCH_X64 | 4915 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |