| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 | 234 |
| 235 int heap_slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 235 int heap_slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
| 236 if (heap_slots > 0) { | 236 if (heap_slots > 0) { |
| 237 // Argument to NewContext is the function, which is still in x1. | 237 // Argument to NewContext is the function, which is still in x1. |
| 238 Comment cmnt(masm_, "[ Allocate context"); | 238 Comment cmnt(masm_, "[ Allocate context"); |
| 239 if (FLAG_harmony_scoping && info->scope()->is_global_scope()) { | 239 if (FLAG_harmony_scoping && info->scope()->is_global_scope()) { |
| 240 __ Mov(x10, Operand(info->scope()->GetScopeInfo())); | 240 __ Mov(x10, Operand(info->scope()->GetScopeInfo())); |
| 241 __ Push(x1, x10); | 241 __ Push(x1, x10); |
| 242 __ CallRuntime(Runtime::kHiddenNewGlobalContext, 2); | 242 __ CallRuntime(Runtime::kHiddenNewGlobalContext, 2); |
| 243 } else if (heap_slots <= FastNewContextStub::kMaximumSlots) { | 243 } else if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
| 244 FastNewContextStub stub(heap_slots); | 244 FastNewContextStub stub(isolate(), heap_slots); |
| 245 __ CallStub(&stub); | 245 __ CallStub(&stub); |
| 246 } else { | 246 } else { |
| 247 __ Push(x1); | 247 __ Push(x1); |
| 248 __ CallRuntime(Runtime::kHiddenNewFunctionContext, 1); | 248 __ CallRuntime(Runtime::kHiddenNewFunctionContext, 1); |
| 249 } | 249 } |
| 250 function_in_register_x1 = false; | 250 function_in_register_x1 = false; |
| 251 // Context is returned in x0. It replaces the context passed to us. | 251 // Context is returned in x0. It replaces the context passed to us. |
| 252 // It's saved in the stack and kept live in cp. | 252 // It's saved in the stack and kept live in cp. |
| 253 __ Mov(cp, x0); | 253 __ Mov(cp, x0); |
| 254 __ Str(x0, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 254 __ Str(x0, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 // The stub will rewrite receiver and parameter count if the previous | 294 // The stub will rewrite receiver and parameter count if the previous |
| 295 // stack frame was an arguments adapter frame. | 295 // stack frame was an arguments adapter frame. |
| 296 ArgumentsAccessStub::Type type; | 296 ArgumentsAccessStub::Type type; |
| 297 if (strict_mode() == STRICT) { | 297 if (strict_mode() == STRICT) { |
| 298 type = ArgumentsAccessStub::NEW_STRICT; | 298 type = ArgumentsAccessStub::NEW_STRICT; |
| 299 } else if (function()->has_duplicate_parameters()) { | 299 } else if (function()->has_duplicate_parameters()) { |
| 300 type = ArgumentsAccessStub::NEW_SLOPPY_SLOW; | 300 type = ArgumentsAccessStub::NEW_SLOPPY_SLOW; |
| 301 } else { | 301 } else { |
| 302 type = ArgumentsAccessStub::NEW_SLOPPY_FAST; | 302 type = ArgumentsAccessStub::NEW_SLOPPY_FAST; |
| 303 } | 303 } |
| 304 ArgumentsAccessStub stub(type); | 304 ArgumentsAccessStub stub(isolate(), type); |
| 305 __ CallStub(&stub); | 305 __ CallStub(&stub); |
| 306 | 306 |
| 307 SetVar(arguments, x0, x1, x2); | 307 SetVar(arguments, x0, x1, x2); |
| 308 } | 308 } |
| 309 | 309 |
| 310 if (FLAG_trace) { | 310 if (FLAG_trace) { |
| 311 __ CallRuntime(Runtime::kTraceEnter, 0); | 311 __ CallRuntime(Runtime::kTraceEnter, 0); |
| 312 } | 312 } |
| 313 | 313 |
| 314 | 314 |
| (...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1356 // nested functions that don't need literals cloning. If we're running with | 1356 // nested functions that don't need literals cloning. If we're running with |
| 1357 // the --always-opt or the --prepare-always-opt flag, we need to use the | 1357 // the --always-opt or the --prepare-always-opt flag, we need to use the |
| 1358 // runtime function so that the new function we are creating here gets a | 1358 // runtime function so that the new function we are creating here gets a |
| 1359 // chance to have its code optimized and doesn't just get a copy of the | 1359 // chance to have its code optimized and doesn't just get a copy of the |
| 1360 // existing unoptimized code. | 1360 // existing unoptimized code. |
| 1361 if (!FLAG_always_opt && | 1361 if (!FLAG_always_opt && |
| 1362 !FLAG_prepare_always_opt && | 1362 !FLAG_prepare_always_opt && |
| 1363 !pretenure && | 1363 !pretenure && |
| 1364 scope()->is_function_scope() && | 1364 scope()->is_function_scope() && |
| 1365 info->num_literals() == 0) { | 1365 info->num_literals() == 0) { |
| 1366 FastNewClosureStub stub(info->strict_mode(), info->is_generator()); | 1366 FastNewClosureStub stub(isolate(), |
| 1367 info->strict_mode(), |
| 1368 info->is_generator()); |
| 1367 __ Mov(x2, Operand(info)); | 1369 __ Mov(x2, Operand(info)); |
| 1368 __ CallStub(&stub); | 1370 __ CallStub(&stub); |
| 1369 } else { | 1371 } else { |
| 1370 __ Mov(x11, Operand(info)); | 1372 __ Mov(x11, Operand(info)); |
| 1371 __ LoadRoot(x10, pretenure ? Heap::kTrueValueRootIndex | 1373 __ LoadRoot(x10, pretenure ? Heap::kTrueValueRootIndex |
| 1372 : Heap::kFalseValueRootIndex); | 1374 : Heap::kFalseValueRootIndex); |
| 1373 __ Push(cp, x11, x10); | 1375 __ Push(cp, x11, x10); |
| 1374 __ CallRuntime(Runtime::kHiddenNewClosure, 3); | 1376 __ CallRuntime(Runtime::kHiddenNewClosure, 3); |
| 1375 } | 1377 } |
| 1376 context()->Plug(x0); | 1378 context()->Plug(x0); |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1675 __ Mov(x0, Smi::FromInt(flags)); | 1677 __ Mov(x0, Smi::FromInt(flags)); |
| 1676 int properties_count = constant_properties->length() / 2; | 1678 int properties_count = constant_properties->length() / 2; |
| 1677 const int max_cloned_properties = | 1679 const int max_cloned_properties = |
| 1678 FastCloneShallowObjectStub::kMaximumClonedProperties; | 1680 FastCloneShallowObjectStub::kMaximumClonedProperties; |
| 1679 if (expr->may_store_doubles() || expr->depth() > 1 || Serializer::enabled() || | 1681 if (expr->may_store_doubles() || expr->depth() > 1 || Serializer::enabled() || |
| 1680 flags != ObjectLiteral::kFastElements || | 1682 flags != ObjectLiteral::kFastElements || |
| 1681 properties_count > max_cloned_properties) { | 1683 properties_count > max_cloned_properties) { |
| 1682 __ Push(x3, x2, x1, x0); | 1684 __ Push(x3, x2, x1, x0); |
| 1683 __ CallRuntime(Runtime::kHiddenCreateObjectLiteral, 4); | 1685 __ CallRuntime(Runtime::kHiddenCreateObjectLiteral, 4); |
| 1684 } else { | 1686 } else { |
| 1685 FastCloneShallowObjectStub stub(properties_count); | 1687 FastCloneShallowObjectStub stub(isolate(), properties_count); |
| 1686 __ CallStub(&stub); | 1688 __ CallStub(&stub); |
| 1687 } | 1689 } |
| 1688 | 1690 |
| 1689 // If result_saved is true the result is on top of the stack. If | 1691 // If result_saved is true the result is on top of the stack. If |
| 1690 // result_saved is false the result is in x0. | 1692 // result_saved is false the result is in x0. |
| 1691 bool result_saved = false; | 1693 bool result_saved = false; |
| 1692 | 1694 |
| 1693 // Mark all computed expressions that are bound to a key that | 1695 // Mark all computed expressions that are bound to a key that |
| 1694 // is shadowed by a later occurrence of the same key. For the | 1696 // is shadowed by a later occurrence of the same key. For the |
| 1695 // marked expressions, no store code is emitted. | 1697 // marked expressions, no store code is emitted. |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1813 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; | 1815 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; |
| 1814 } | 1816 } |
| 1815 | 1817 |
| 1816 __ Ldr(x3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 1818 __ Ldr(x3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 1817 __ Ldr(x3, FieldMemOperand(x3, JSFunction::kLiteralsOffset)); | 1819 __ Ldr(x3, FieldMemOperand(x3, JSFunction::kLiteralsOffset)); |
| 1818 __ Mov(x2, Smi::FromInt(expr->literal_index())); | 1820 __ Mov(x2, Smi::FromInt(expr->literal_index())); |
| 1819 __ Mov(x1, Operand(constant_elements)); | 1821 __ Mov(x1, Operand(constant_elements)); |
| 1820 if (has_fast_elements && constant_elements_values->map() == | 1822 if (has_fast_elements && constant_elements_values->map() == |
| 1821 isolate()->heap()->fixed_cow_array_map()) { | 1823 isolate()->heap()->fixed_cow_array_map()) { |
| 1822 FastCloneShallowArrayStub stub( | 1824 FastCloneShallowArrayStub stub( |
| 1825 isolate(), |
| 1823 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, | 1826 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, |
| 1824 allocation_site_mode, | 1827 allocation_site_mode, |
| 1825 length); | 1828 length); |
| 1826 __ CallStub(&stub); | 1829 __ CallStub(&stub); |
| 1827 __ IncrementCounter( | 1830 __ IncrementCounter( |
| 1828 isolate()->counters()->cow_arrays_created_stub(), 1, x10, x11); | 1831 isolate()->counters()->cow_arrays_created_stub(), 1, x10, x11); |
| 1829 } else if ((expr->depth() > 1) || Serializer::enabled() || | 1832 } else if ((expr->depth() > 1) || Serializer::enabled() || |
| 1830 length > FastCloneShallowArrayStub::kMaximumClonedLength) { | 1833 length > FastCloneShallowArrayStub::kMaximumClonedLength) { |
| 1831 __ Mov(x0, Smi::FromInt(flags)); | 1834 __ Mov(x0, Smi::FromInt(flags)); |
| 1832 __ Push(x3, x2, x1, x0); | 1835 __ Push(x3, x2, x1, x0); |
| 1833 __ CallRuntime(Runtime::kHiddenCreateArrayLiteral, 4); | 1836 __ CallRuntime(Runtime::kHiddenCreateArrayLiteral, 4); |
| 1834 } else { | 1837 } else { |
| 1835 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || | 1838 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || |
| 1836 FLAG_smi_only_arrays); | 1839 FLAG_smi_only_arrays); |
| 1837 FastCloneShallowArrayStub::Mode mode = | 1840 FastCloneShallowArrayStub::Mode mode = |
| 1838 FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS; | 1841 FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS; |
| 1839 | 1842 |
| 1840 if (has_fast_elements) { | 1843 if (has_fast_elements) { |
| 1841 mode = FastCloneShallowArrayStub::CLONE_ELEMENTS; | 1844 mode = FastCloneShallowArrayStub::CLONE_ELEMENTS; |
| 1842 } | 1845 } |
| 1843 | 1846 |
| 1844 FastCloneShallowArrayStub stub(mode, allocation_site_mode, length); | 1847 FastCloneShallowArrayStub stub(isolate(), |
| 1848 mode, |
| 1849 allocation_site_mode, |
| 1850 length); |
| 1845 __ CallStub(&stub); | 1851 __ CallStub(&stub); |
| 1846 } | 1852 } |
| 1847 | 1853 |
| 1848 bool result_saved = false; // Is the result saved to the stack? | 1854 bool result_saved = false; // Is the result saved to the stack? |
| 1849 | 1855 |
| 1850 // Emit code to evaluate all the non-constant subexpressions and to store | 1856 // Emit code to evaluate all the non-constant subexpressions and to store |
| 1851 // them into the newly cloned array. | 1857 // them into the newly cloned array. |
| 1852 for (int i = 0; i < length; i++) { | 1858 for (int i = 0; i < length; i++) { |
| 1853 Expression* subexpr = subexprs->at(i); | 1859 Expression* subexpr = subexprs->at(i); |
| 1854 // If the subexpression is a literal or a simple materialized literal it | 1860 // If the subexpression is a literal or a simple materialized literal it |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1866 int offset = FixedArray::kHeaderSize + (i * kPointerSize); | 1872 int offset = FixedArray::kHeaderSize + (i * kPointerSize); |
| 1867 __ Peek(x6, kPointerSize); // Copy of array literal. | 1873 __ Peek(x6, kPointerSize); // Copy of array literal. |
| 1868 __ Ldr(x1, FieldMemOperand(x6, JSObject::kElementsOffset)); | 1874 __ Ldr(x1, FieldMemOperand(x6, JSObject::kElementsOffset)); |
| 1869 __ Str(result_register(), FieldMemOperand(x1, offset)); | 1875 __ Str(result_register(), FieldMemOperand(x1, offset)); |
| 1870 // Update the write barrier for the array store. | 1876 // Update the write barrier for the array store. |
| 1871 __ RecordWriteField(x1, offset, result_register(), x10, | 1877 __ RecordWriteField(x1, offset, result_register(), x10, |
| 1872 kLRHasBeenSaved, kDontSaveFPRegs, | 1878 kLRHasBeenSaved, kDontSaveFPRegs, |
| 1873 EMIT_REMEMBERED_SET, INLINE_SMI_CHECK); | 1879 EMIT_REMEMBERED_SET, INLINE_SMI_CHECK); |
| 1874 } else { | 1880 } else { |
| 1875 __ Mov(x3, Smi::FromInt(i)); | 1881 __ Mov(x3, Smi::FromInt(i)); |
| 1876 StoreArrayLiteralElementStub stub; | 1882 StoreArrayLiteralElementStub stub(isolate()); |
| 1877 __ CallStub(&stub); | 1883 __ CallStub(&stub); |
| 1878 } | 1884 } |
| 1879 | 1885 |
| 1880 PrepareForBailoutForId(expr->GetIdForElement(i), NO_REGISTERS); | 1886 PrepareForBailoutForId(expr->GetIdForElement(i), NO_REGISTERS); |
| 1881 } | 1887 } |
| 1882 | 1888 |
| 1883 if (result_saved) { | 1889 if (result_saved) { |
| 1884 __ Drop(1); // literal index | 1890 __ Drop(1); // literal index |
| 1885 context()->PlugTOS(); | 1891 context()->PlugTOS(); |
| 1886 } else { | 1892 } else { |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2027 Register right = x0; | 2033 Register right = x0; |
| 2028 Register result = x0; | 2034 Register result = x0; |
| 2029 __ Pop(left); | 2035 __ Pop(left); |
| 2030 | 2036 |
| 2031 // Perform combined smi check on both operands. | 2037 // Perform combined smi check on both operands. |
| 2032 __ Orr(x10, left, right); | 2038 __ Orr(x10, left, right); |
| 2033 JumpPatchSite patch_site(masm_); | 2039 JumpPatchSite patch_site(masm_); |
| 2034 patch_site.EmitJumpIfSmi(x10, &both_smis); | 2040 patch_site.EmitJumpIfSmi(x10, &both_smis); |
| 2035 | 2041 |
| 2036 __ Bind(&stub_call); | 2042 __ Bind(&stub_call); |
| 2037 BinaryOpICStub stub(op, mode); | 2043 BinaryOpICStub stub(isolate(), op, mode); |
| 2038 { | 2044 { |
| 2039 Assembler::BlockPoolsScope scope(masm_); | 2045 Assembler::BlockPoolsScope scope(masm_); |
| 2040 CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId()); | 2046 CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId()); |
| 2041 patch_site.EmitPatchInfo(); | 2047 patch_site.EmitPatchInfo(); |
| 2042 } | 2048 } |
| 2043 __ B(&done); | 2049 __ B(&done); |
| 2044 | 2050 |
| 2045 __ Bind(&both_smis); | 2051 __ Bind(&both_smis); |
| 2046 // Smi case. This code works in the same way as the smi-smi case in the type | 2052 // Smi case. This code works in the same way as the smi-smi case in the type |
| 2047 // recording binary operation stub, see | 2053 // recording binary operation stub, see |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2112 | 2118 |
| 2113 __ Bind(&done); | 2119 __ Bind(&done); |
| 2114 context()->Plug(x0); | 2120 context()->Plug(x0); |
| 2115 } | 2121 } |
| 2116 | 2122 |
| 2117 | 2123 |
| 2118 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, | 2124 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, |
| 2119 Token::Value op, | 2125 Token::Value op, |
| 2120 OverwriteMode mode) { | 2126 OverwriteMode mode) { |
| 2121 __ Pop(x1); | 2127 __ Pop(x1); |
| 2122 BinaryOpICStub stub(op, mode); | 2128 BinaryOpICStub stub(isolate(), op, mode); |
| 2123 JumpPatchSite patch_site(masm_); // Unbound, signals no inlined smi code. | 2129 JumpPatchSite patch_site(masm_); // Unbound, signals no inlined smi code. |
| 2124 { | 2130 { |
| 2125 Assembler::BlockPoolsScope scope(masm_); | 2131 Assembler::BlockPoolsScope scope(masm_); |
| 2126 CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId()); | 2132 CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId()); |
| 2127 patch_site.EmitPatchInfo(); | 2133 patch_site.EmitPatchInfo(); |
| 2128 } | 2134 } |
| 2129 context()->Plug(x0); | 2135 context()->Plug(x0); |
| 2130 } | 2136 } |
| 2131 | 2137 |
| 2132 | 2138 |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2369 | 2375 |
| 2370 // Load the arguments. | 2376 // Load the arguments. |
| 2371 { PreservePositionScope scope(masm()->positions_recorder()); | 2377 { PreservePositionScope scope(masm()->positions_recorder()); |
| 2372 for (int i = 0; i < arg_count; i++) { | 2378 for (int i = 0; i < arg_count; i++) { |
| 2373 VisitForStackValue(args->at(i)); | 2379 VisitForStackValue(args->at(i)); |
| 2374 } | 2380 } |
| 2375 } | 2381 } |
| 2376 | 2382 |
| 2377 // Record source position for debugger. | 2383 // Record source position for debugger. |
| 2378 SetSourcePosition(expr->position()); | 2384 SetSourcePosition(expr->position()); |
| 2379 CallFunctionStub stub(arg_count, flags); | 2385 CallFunctionStub stub(isolate(), arg_count, flags); |
| 2380 __ Peek(x1, (arg_count + 1) * kPointerSize); | 2386 __ Peek(x1, (arg_count + 1) * kPointerSize); |
| 2381 __ CallStub(&stub); | 2387 __ CallStub(&stub); |
| 2382 | 2388 |
| 2383 RecordJSReturnSite(expr); | 2389 RecordJSReturnSite(expr); |
| 2384 | 2390 |
| 2385 // Restore context register. | 2391 // Restore context register. |
| 2386 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2392 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 2387 | 2393 |
| 2388 context()->DropAndPlug(1, x0); | 2394 context()->DropAndPlug(1, x0); |
| 2389 } | 2395 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 2410 __ Push(x0, x10); | 2416 __ Push(x0, x10); |
| 2411 | 2417 |
| 2412 { PreservePositionScope scope(masm()->positions_recorder()); | 2418 { PreservePositionScope scope(masm()->positions_recorder()); |
| 2413 for (int i = 0; i < arg_count; i++) { | 2419 for (int i = 0; i < arg_count; i++) { |
| 2414 VisitForStackValue(args->at(i)); | 2420 VisitForStackValue(args->at(i)); |
| 2415 } | 2421 } |
| 2416 } | 2422 } |
| 2417 | 2423 |
| 2418 // Record source position for debugger. | 2424 // Record source position for debugger. |
| 2419 SetSourcePosition(expr->position()); | 2425 SetSourcePosition(expr->position()); |
| 2420 CallFunctionStub stub(arg_count, CALL_AS_METHOD); | 2426 CallFunctionStub stub(isolate(), arg_count, CALL_AS_METHOD); |
| 2421 __ Peek(x1, (arg_count + 1) * kPointerSize); | 2427 __ Peek(x1, (arg_count + 1) * kPointerSize); |
| 2422 __ CallStub(&stub); | 2428 __ CallStub(&stub); |
| 2423 | 2429 |
| 2424 RecordJSReturnSite(expr); | 2430 RecordJSReturnSite(expr); |
| 2425 // Restore context register. | 2431 // Restore context register. |
| 2426 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2432 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 2427 | 2433 |
| 2428 context()->DropAndPlug(1, x0); | 2434 context()->DropAndPlug(1, x0); |
| 2429 } | 2435 } |
| 2430 | 2436 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 2441 // Record source position for debugger. | 2447 // Record source position for debugger. |
| 2442 SetSourcePosition(expr->position()); | 2448 SetSourcePosition(expr->position()); |
| 2443 | 2449 |
| 2444 Handle<Object> uninitialized = | 2450 Handle<Object> uninitialized = |
| 2445 TypeFeedbackInfo::UninitializedSentinel(isolate()); | 2451 TypeFeedbackInfo::UninitializedSentinel(isolate()); |
| 2446 StoreFeedbackVectorSlot(expr->CallFeedbackSlot(), uninitialized); | 2452 StoreFeedbackVectorSlot(expr->CallFeedbackSlot(), uninitialized); |
| 2447 __ LoadObject(x2, FeedbackVector()); | 2453 __ LoadObject(x2, FeedbackVector()); |
| 2448 __ Mov(x3, Smi::FromInt(expr->CallFeedbackSlot())); | 2454 __ Mov(x3, Smi::FromInt(expr->CallFeedbackSlot())); |
| 2449 | 2455 |
| 2450 // Record call targets in unoptimized code. | 2456 // Record call targets in unoptimized code. |
| 2451 CallFunctionStub stub(arg_count, RECORD_CALL_TARGET); | 2457 CallFunctionStub stub(isolate(), arg_count, RECORD_CALL_TARGET); |
| 2452 __ Peek(x1, (arg_count + 1) * kXRegSize); | 2458 __ Peek(x1, (arg_count + 1) * kXRegSize); |
| 2453 __ CallStub(&stub); | 2459 __ CallStub(&stub); |
| 2454 RecordJSReturnSite(expr); | 2460 RecordJSReturnSite(expr); |
| 2455 // Restore context register. | 2461 // Restore context register. |
| 2456 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2462 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 2457 context()->DropAndPlug(1, x0); | 2463 context()->DropAndPlug(1, x0); |
| 2458 } | 2464 } |
| 2459 | 2465 |
| 2460 | 2466 |
| 2461 void FullCodeGenerator::EmitResolvePossiblyDirectEval(int arg_count) { | 2467 void FullCodeGenerator::EmitResolvePossiblyDirectEval(int arg_count) { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2526 | 2532 |
| 2527 // The runtime call returns a pair of values in x0 (function) and | 2533 // The runtime call returns a pair of values in x0 (function) and |
| 2528 // x1 (receiver). Touch up the stack with the right values. | 2534 // x1 (receiver). Touch up the stack with the right values. |
| 2529 __ PokePair(x1, x0, arg_count * kPointerSize); | 2535 __ PokePair(x1, x0, arg_count * kPointerSize); |
| 2530 } | 2536 } |
| 2531 | 2537 |
| 2532 // Record source position for debugger. | 2538 // Record source position for debugger. |
| 2533 SetSourcePosition(expr->position()); | 2539 SetSourcePosition(expr->position()); |
| 2534 | 2540 |
| 2535 // Call the evaluated function. | 2541 // Call the evaluated function. |
| 2536 CallFunctionStub stub(arg_count, NO_CALL_FUNCTION_FLAGS); | 2542 CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS); |
| 2537 __ Peek(x1, (arg_count + 1) * kXRegSize); | 2543 __ Peek(x1, (arg_count + 1) * kXRegSize); |
| 2538 __ CallStub(&stub); | 2544 __ CallStub(&stub); |
| 2539 RecordJSReturnSite(expr); | 2545 RecordJSReturnSite(expr); |
| 2540 // Restore context register. | 2546 // Restore context register. |
| 2541 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2547 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 2542 context()->DropAndPlug(1, x0); | 2548 context()->DropAndPlug(1, x0); |
| 2543 | 2549 |
| 2544 } else if (call_type == Call::GLOBAL_CALL) { | 2550 } else if (call_type == Call::GLOBAL_CALL) { |
| 2545 EmitCallWithIC(expr); | 2551 EmitCallWithIC(expr); |
| 2546 | 2552 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2646 if (FLAG_pretenuring_call_new) { | 2652 if (FLAG_pretenuring_call_new) { |
| 2647 StoreFeedbackVectorSlot(expr->AllocationSiteFeedbackSlot(), | 2653 StoreFeedbackVectorSlot(expr->AllocationSiteFeedbackSlot(), |
| 2648 isolate()->factory()->NewAllocationSite()); | 2654 isolate()->factory()->NewAllocationSite()); |
| 2649 ASSERT(expr->AllocationSiteFeedbackSlot() == | 2655 ASSERT(expr->AllocationSiteFeedbackSlot() == |
| 2650 expr->CallNewFeedbackSlot() + 1); | 2656 expr->CallNewFeedbackSlot() + 1); |
| 2651 } | 2657 } |
| 2652 | 2658 |
| 2653 __ LoadObject(x2, FeedbackVector()); | 2659 __ LoadObject(x2, FeedbackVector()); |
| 2654 __ Mov(x3, Smi::FromInt(expr->CallNewFeedbackSlot())); | 2660 __ Mov(x3, Smi::FromInt(expr->CallNewFeedbackSlot())); |
| 2655 | 2661 |
| 2656 CallConstructStub stub(RECORD_CALL_TARGET); | 2662 CallConstructStub stub(isolate(), RECORD_CALL_TARGET); |
| 2657 __ Call(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL); | 2663 __ Call(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL); |
| 2658 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); | 2664 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); |
| 2659 context()->Plug(x0); | 2665 context()->Plug(x0); |
| 2660 } | 2666 } |
| 2661 | 2667 |
| 2662 | 2668 |
| 2663 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { | 2669 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { |
| 2664 ZoneList<Expression*>* args = expr->arguments(); | 2670 ZoneList<Expression*>* args = expr->arguments(); |
| 2665 ASSERT(args->length() == 1); | 2671 ASSERT(args->length() == 1); |
| 2666 | 2672 |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3030 | 3036 |
| 3031 | 3037 |
| 3032 void FullCodeGenerator::EmitArguments(CallRuntime* expr) { | 3038 void FullCodeGenerator::EmitArguments(CallRuntime* expr) { |
| 3033 ZoneList<Expression*>* args = expr->arguments(); | 3039 ZoneList<Expression*>* args = expr->arguments(); |
| 3034 ASSERT(args->length() == 1); | 3040 ASSERT(args->length() == 1); |
| 3035 | 3041 |
| 3036 // ArgumentsAccessStub expects the key in x1. | 3042 // ArgumentsAccessStub expects the key in x1. |
| 3037 VisitForAccumulatorValue(args->at(0)); | 3043 VisitForAccumulatorValue(args->at(0)); |
| 3038 __ Mov(x1, x0); | 3044 __ Mov(x1, x0); |
| 3039 __ Mov(x0, Smi::FromInt(info_->scope()->num_parameters())); | 3045 __ Mov(x0, Smi::FromInt(info_->scope()->num_parameters())); |
| 3040 ArgumentsAccessStub stub(ArgumentsAccessStub::READ_ELEMENT); | 3046 ArgumentsAccessStub stub(isolate(), ArgumentsAccessStub::READ_ELEMENT); |
| 3041 __ CallStub(&stub); | 3047 __ CallStub(&stub); |
| 3042 context()->Plug(x0); | 3048 context()->Plug(x0); |
| 3043 } | 3049 } |
| 3044 | 3050 |
| 3045 | 3051 |
| 3046 void FullCodeGenerator::EmitArgumentsLength(CallRuntime* expr) { | 3052 void FullCodeGenerator::EmitArgumentsLength(CallRuntime* expr) { |
| 3047 ASSERT(expr->arguments()->length() == 0); | 3053 ASSERT(expr->arguments()->length() == 0); |
| 3048 Label exit; | 3054 Label exit; |
| 3049 // Get the number of formal parameters. | 3055 // Get the number of formal parameters. |
| 3050 __ Mov(x0, Smi::FromInt(info_->scope()->num_parameters())); | 3056 __ Mov(x0, Smi::FromInt(info_->scope()->num_parameters())); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3145 } | 3151 } |
| 3146 | 3152 |
| 3147 // Finally, we're expected to leave a value on the top of the stack. | 3153 // Finally, we're expected to leave a value on the top of the stack. |
| 3148 __ LoadRoot(x0, Heap::kUndefinedValueRootIndex); | 3154 __ LoadRoot(x0, Heap::kUndefinedValueRootIndex); |
| 3149 context()->Plug(x0); | 3155 context()->Plug(x0); |
| 3150 } | 3156 } |
| 3151 | 3157 |
| 3152 | 3158 |
| 3153 void FullCodeGenerator::EmitSubString(CallRuntime* expr) { | 3159 void FullCodeGenerator::EmitSubString(CallRuntime* expr) { |
| 3154 // Load the arguments on the stack and call the stub. | 3160 // Load the arguments on the stack and call the stub. |
| 3155 SubStringStub stub; | 3161 SubStringStub stub(isolate()); |
| 3156 ZoneList<Expression*>* args = expr->arguments(); | 3162 ZoneList<Expression*>* args = expr->arguments(); |
| 3157 ASSERT(args->length() == 3); | 3163 ASSERT(args->length() == 3); |
| 3158 VisitForStackValue(args->at(0)); | 3164 VisitForStackValue(args->at(0)); |
| 3159 VisitForStackValue(args->at(1)); | 3165 VisitForStackValue(args->at(1)); |
| 3160 VisitForStackValue(args->at(2)); | 3166 VisitForStackValue(args->at(2)); |
| 3161 __ CallStub(&stub); | 3167 __ CallStub(&stub); |
| 3162 context()->Plug(x0); | 3168 context()->Plug(x0); |
| 3163 } | 3169 } |
| 3164 | 3170 |
| 3165 | 3171 |
| 3166 void FullCodeGenerator::EmitRegExpExec(CallRuntime* expr) { | 3172 void FullCodeGenerator::EmitRegExpExec(CallRuntime* expr) { |
| 3167 // Load the arguments on the stack and call the stub. | 3173 // Load the arguments on the stack and call the stub. |
| 3168 RegExpExecStub stub; | 3174 RegExpExecStub stub(isolate()); |
| 3169 ZoneList<Expression*>* args = expr->arguments(); | 3175 ZoneList<Expression*>* args = expr->arguments(); |
| 3170 ASSERT(args->length() == 4); | 3176 ASSERT(args->length() == 4); |
| 3171 VisitForStackValue(args->at(0)); | 3177 VisitForStackValue(args->at(0)); |
| 3172 VisitForStackValue(args->at(1)); | 3178 VisitForStackValue(args->at(1)); |
| 3173 VisitForStackValue(args->at(2)); | 3179 VisitForStackValue(args->at(2)); |
| 3174 VisitForStackValue(args->at(3)); | 3180 VisitForStackValue(args->at(3)); |
| 3175 __ CallStub(&stub); | 3181 __ CallStub(&stub); |
| 3176 context()->Plug(x0); | 3182 context()->Plug(x0); |
| 3177 } | 3183 } |
| 3178 | 3184 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3300 context()->Plug(string); | 3306 context()->Plug(string); |
| 3301 } | 3307 } |
| 3302 | 3308 |
| 3303 | 3309 |
| 3304 void FullCodeGenerator::EmitMathPow(CallRuntime* expr) { | 3310 void FullCodeGenerator::EmitMathPow(CallRuntime* expr) { |
| 3305 // Load the arguments on the stack and call the MathPow stub. | 3311 // Load the arguments on the stack and call the MathPow stub. |
| 3306 ZoneList<Expression*>* args = expr->arguments(); | 3312 ZoneList<Expression*>* args = expr->arguments(); |
| 3307 ASSERT(args->length() == 2); | 3313 ASSERT(args->length() == 2); |
| 3308 VisitForStackValue(args->at(0)); | 3314 VisitForStackValue(args->at(0)); |
| 3309 VisitForStackValue(args->at(1)); | 3315 VisitForStackValue(args->at(1)); |
| 3310 MathPowStub stub(MathPowStub::ON_STACK); | 3316 MathPowStub stub(isolate(), MathPowStub::ON_STACK); |
| 3311 __ CallStub(&stub); | 3317 __ CallStub(&stub); |
| 3312 context()->Plug(x0); | 3318 context()->Plug(x0); |
| 3313 } | 3319 } |
| 3314 | 3320 |
| 3315 | 3321 |
| 3316 void FullCodeGenerator::EmitSetValueOf(CallRuntime* expr) { | 3322 void FullCodeGenerator::EmitSetValueOf(CallRuntime* expr) { |
| 3317 ZoneList<Expression*>* args = expr->arguments(); | 3323 ZoneList<Expression*>* args = expr->arguments(); |
| 3318 ASSERT(args->length() == 2); | 3324 ASSERT(args->length() == 2); |
| 3319 VisitForStackValue(args->at(0)); // Load the object. | 3325 VisitForStackValue(args->at(0)); // Load the object. |
| 3320 VisitForAccumulatorValue(args->at(1)); // Load the value. | 3326 VisitForAccumulatorValue(args->at(1)); // Load the value. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 3342 } | 3348 } |
| 3343 | 3349 |
| 3344 | 3350 |
| 3345 void FullCodeGenerator::EmitNumberToString(CallRuntime* expr) { | 3351 void FullCodeGenerator::EmitNumberToString(CallRuntime* expr) { |
| 3346 ZoneList<Expression*>* args = expr->arguments(); | 3352 ZoneList<Expression*>* args = expr->arguments(); |
| 3347 ASSERT_EQ(args->length(), 1); | 3353 ASSERT_EQ(args->length(), 1); |
| 3348 | 3354 |
| 3349 // Load the argument into x0 and call the stub. | 3355 // Load the argument into x0 and call the stub. |
| 3350 VisitForAccumulatorValue(args->at(0)); | 3356 VisitForAccumulatorValue(args->at(0)); |
| 3351 | 3357 |
| 3352 NumberToStringStub stub; | 3358 NumberToStringStub stub(isolate()); |
| 3353 __ CallStub(&stub); | 3359 __ CallStub(&stub); |
| 3354 context()->Plug(x0); | 3360 context()->Plug(x0); |
| 3355 } | 3361 } |
| 3356 | 3362 |
| 3357 | 3363 |
| 3358 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { | 3364 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { |
| 3359 ZoneList<Expression*>* args = expr->arguments(); | 3365 ZoneList<Expression*>* args = expr->arguments(); |
| 3360 ASSERT(args->length() == 1); | 3366 ASSERT(args->length() == 1); |
| 3361 | 3367 |
| 3362 VisitForAccumulatorValue(args->at(0)); | 3368 VisitForAccumulatorValue(args->at(0)); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3470 | 3476 |
| 3471 void FullCodeGenerator::EmitStringAdd(CallRuntime* expr) { | 3477 void FullCodeGenerator::EmitStringAdd(CallRuntime* expr) { |
| 3472 ASM_LOCATION("FullCodeGenerator::EmitStringAdd"); | 3478 ASM_LOCATION("FullCodeGenerator::EmitStringAdd"); |
| 3473 ZoneList<Expression*>* args = expr->arguments(); | 3479 ZoneList<Expression*>* args = expr->arguments(); |
| 3474 ASSERT_EQ(2, args->length()); | 3480 ASSERT_EQ(2, args->length()); |
| 3475 | 3481 |
| 3476 VisitForStackValue(args->at(0)); | 3482 VisitForStackValue(args->at(0)); |
| 3477 VisitForAccumulatorValue(args->at(1)); | 3483 VisitForAccumulatorValue(args->at(1)); |
| 3478 | 3484 |
| 3479 __ Pop(x1); | 3485 __ Pop(x1); |
| 3480 StringAddStub stub(STRING_ADD_CHECK_BOTH, NOT_TENURED); | 3486 StringAddStub stub(isolate(), STRING_ADD_CHECK_BOTH, NOT_TENURED); |
| 3481 __ CallStub(&stub); | 3487 __ CallStub(&stub); |
| 3482 | 3488 |
| 3483 context()->Plug(x0); | 3489 context()->Plug(x0); |
| 3484 } | 3490 } |
| 3485 | 3491 |
| 3486 | 3492 |
| 3487 void FullCodeGenerator::EmitStringCompare(CallRuntime* expr) { | 3493 void FullCodeGenerator::EmitStringCompare(CallRuntime* expr) { |
| 3488 ZoneList<Expression*>* args = expr->arguments(); | 3494 ZoneList<Expression*>* args = expr->arguments(); |
| 3489 ASSERT_EQ(2, args->length()); | 3495 ASSERT_EQ(2, args->length()); |
| 3490 VisitForStackValue(args->at(0)); | 3496 VisitForStackValue(args->at(0)); |
| 3491 VisitForStackValue(args->at(1)); | 3497 VisitForStackValue(args->at(1)); |
| 3492 | 3498 |
| 3493 StringCompareStub stub; | 3499 StringCompareStub stub(isolate()); |
| 3494 __ CallStub(&stub); | 3500 __ CallStub(&stub); |
| 3495 context()->Plug(x0); | 3501 context()->Plug(x0); |
| 3496 } | 3502 } |
| 3497 | 3503 |
| 3498 | 3504 |
| 3499 void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) { | 3505 void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) { |
| 3500 ASM_LOCATION("FullCodeGenerator::EmitCallFunction"); | 3506 ASM_LOCATION("FullCodeGenerator::EmitCallFunction"); |
| 3501 ZoneList<Expression*>* args = expr->arguments(); | 3507 ZoneList<Expression*>* args = expr->arguments(); |
| 3502 ASSERT(args->length() >= 2); | 3508 ASSERT(args->length() >= 2); |
| 3503 | 3509 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 3522 __ Bind(&runtime); | 3528 __ Bind(&runtime); |
| 3523 __ Push(x0); | 3529 __ Push(x0); |
| 3524 __ CallRuntime(Runtime::kCall, args->length()); | 3530 __ CallRuntime(Runtime::kCall, args->length()); |
| 3525 __ Bind(&done); | 3531 __ Bind(&done); |
| 3526 | 3532 |
| 3527 context()->Plug(x0); | 3533 context()->Plug(x0); |
| 3528 } | 3534 } |
| 3529 | 3535 |
| 3530 | 3536 |
| 3531 void FullCodeGenerator::EmitRegExpConstructResult(CallRuntime* expr) { | 3537 void FullCodeGenerator::EmitRegExpConstructResult(CallRuntime* expr) { |
| 3532 RegExpConstructResultStub stub; | 3538 RegExpConstructResultStub stub(isolate()); |
| 3533 ZoneList<Expression*>* args = expr->arguments(); | 3539 ZoneList<Expression*>* args = expr->arguments(); |
| 3534 ASSERT(args->length() == 3); | 3540 ASSERT(args->length() == 3); |
| 3535 VisitForStackValue(args->at(0)); | 3541 VisitForStackValue(args->at(0)); |
| 3536 VisitForStackValue(args->at(1)); | 3542 VisitForStackValue(args->at(1)); |
| 3537 VisitForAccumulatorValue(args->at(2)); | 3543 VisitForAccumulatorValue(args->at(2)); |
| 3538 __ Pop(x1, x2); | 3544 __ Pop(x1, x2); |
| 3539 __ CallStub(&stub); | 3545 __ CallStub(&stub); |
| 3540 context()->Plug(x0); | 3546 context()->Plug(x0); |
| 3541 } | 3547 } |
| 3542 | 3548 |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3866 __ Pop(x10); | 3872 __ Pop(x10); |
| 3867 __ Push(x0, x10); | 3873 __ Push(x0, x10); |
| 3868 | 3874 |
| 3869 int arg_count = args->length(); | 3875 int arg_count = args->length(); |
| 3870 for (int i = 0; i < arg_count; i++) { | 3876 for (int i = 0; i < arg_count; i++) { |
| 3871 VisitForStackValue(args->at(i)); | 3877 VisitForStackValue(args->at(i)); |
| 3872 } | 3878 } |
| 3873 | 3879 |
| 3874 // Record source position of the IC call. | 3880 // Record source position of the IC call. |
| 3875 SetSourcePosition(expr->position()); | 3881 SetSourcePosition(expr->position()); |
| 3876 CallFunctionStub stub(arg_count, NO_CALL_FUNCTION_FLAGS); | 3882 CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS); |
| 3877 __ Peek(x1, (arg_count + 1) * kPointerSize); | 3883 __ Peek(x1, (arg_count + 1) * kPointerSize); |
| 3878 __ CallStub(&stub); | 3884 __ CallStub(&stub); |
| 3879 | 3885 |
| 3880 // Restore context register. | 3886 // Restore context register. |
| 3881 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 3887 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 3882 | 3888 |
| 3883 context()->DropAndPlug(1, x0); | 3889 context()->DropAndPlug(1, x0); |
| 3884 } else { | 3890 } else { |
| 3885 // Push the arguments ("left-to-right"). | 3891 // Push the arguments ("left-to-right"). |
| 3886 for (int i = 0; i < arg_count; i++) { | 3892 for (int i = 0; i < arg_count; i++) { |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4084 } | 4090 } |
| 4085 } | 4091 } |
| 4086 | 4092 |
| 4087 __ Adds(x0, x0, Smi::FromInt(count_value)); | 4093 __ Adds(x0, x0, Smi::FromInt(count_value)); |
| 4088 __ B(vc, &done); | 4094 __ B(vc, &done); |
| 4089 // Call stub. Undo operation first. | 4095 // Call stub. Undo operation first. |
| 4090 __ Sub(x0, x0, Smi::FromInt(count_value)); | 4096 __ Sub(x0, x0, Smi::FromInt(count_value)); |
| 4091 __ B(&stub_call); | 4097 __ B(&stub_call); |
| 4092 __ Bind(&slow); | 4098 __ Bind(&slow); |
| 4093 } | 4099 } |
| 4094 ToNumberStub convert_stub; | 4100 ToNumberStub convert_stub(isolate()); |
| 4095 __ CallStub(&convert_stub); | 4101 __ CallStub(&convert_stub); |
| 4096 | 4102 |
| 4097 // Save result for postfix expressions. | 4103 // Save result for postfix expressions. |
| 4098 if (expr->is_postfix()) { | 4104 if (expr->is_postfix()) { |
| 4099 if (!context()->IsEffect()) { | 4105 if (!context()->IsEffect()) { |
| 4100 // Save the result on the stack. If we have a named or keyed property | 4106 // Save the result on the stack. If we have a named or keyed property |
| 4101 // we store the result under the receiver that is currently on top | 4107 // we store the result under the receiver that is currently on top |
| 4102 // of the stack. | 4108 // of the stack. |
| 4103 switch (assign_type) { | 4109 switch (assign_type) { |
| 4104 case VARIABLE: | 4110 case VARIABLE: |
| (...skipping 11 matching lines...) Expand all Loading... |
| 4116 | 4122 |
| 4117 __ Bind(&stub_call); | 4123 __ Bind(&stub_call); |
| 4118 __ Mov(x1, x0); | 4124 __ Mov(x1, x0); |
| 4119 __ Mov(x0, Smi::FromInt(count_value)); | 4125 __ Mov(x0, Smi::FromInt(count_value)); |
| 4120 | 4126 |
| 4121 // Record position before stub call. | 4127 // Record position before stub call. |
| 4122 SetSourcePosition(expr->position()); | 4128 SetSourcePosition(expr->position()); |
| 4123 | 4129 |
| 4124 { | 4130 { |
| 4125 Assembler::BlockPoolsScope scope(masm_); | 4131 Assembler::BlockPoolsScope scope(masm_); |
| 4126 BinaryOpICStub stub(Token::ADD, NO_OVERWRITE); | 4132 BinaryOpICStub stub(isolate(), Token::ADD, NO_OVERWRITE); |
| 4127 CallIC(stub.GetCode(isolate()), expr->CountBinOpFeedbackId()); | 4133 CallIC(stub.GetCode(isolate()), expr->CountBinOpFeedbackId()); |
| 4128 patch_site.EmitPatchInfo(); | 4134 patch_site.EmitPatchInfo(); |
| 4129 } | 4135 } |
| 4130 __ Bind(&done); | 4136 __ Bind(&done); |
| 4131 | 4137 |
| 4132 // Store the value returned in x0. | 4138 // Store the value returned in x0. |
| 4133 switch (assign_type) { | 4139 switch (assign_type) { |
| 4134 case VARIABLE: | 4140 case VARIABLE: |
| 4135 if (expr->is_postfix()) { | 4141 if (expr->is_postfix()) { |
| 4136 { EffectContext context(this); | 4142 { EffectContext context(this); |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4338 case Token::IN: | 4344 case Token::IN: |
| 4339 VisitForStackValue(expr->right()); | 4345 VisitForStackValue(expr->right()); |
| 4340 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION); | 4346 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION); |
| 4341 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 4347 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
| 4342 __ CompareRoot(x0, Heap::kTrueValueRootIndex); | 4348 __ CompareRoot(x0, Heap::kTrueValueRootIndex); |
| 4343 Split(eq, if_true, if_false, fall_through); | 4349 Split(eq, if_true, if_false, fall_through); |
| 4344 break; | 4350 break; |
| 4345 | 4351 |
| 4346 case Token::INSTANCEOF: { | 4352 case Token::INSTANCEOF: { |
| 4347 VisitForStackValue(expr->right()); | 4353 VisitForStackValue(expr->right()); |
| 4348 InstanceofStub stub(InstanceofStub::kNoFlags); | 4354 InstanceofStub stub(isolate(), InstanceofStub::kNoFlags); |
| 4349 __ CallStub(&stub); | 4355 __ CallStub(&stub); |
| 4350 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 4356 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 4351 // The stub returns 0 for true. | 4357 // The stub returns 0 for true. |
| 4352 __ CompareAndSplit(x0, 0, eq, if_true, if_false, fall_through); | 4358 __ CompareAndSplit(x0, 0, eq, if_true, if_false, fall_through); |
| 4353 break; | 4359 break; |
| 4354 } | 4360 } |
| 4355 | 4361 |
| 4356 default: { | 4362 default: { |
| 4357 VisitForAccumulatorValue(expr->right()); | 4363 VisitForAccumulatorValue(expr->right()); |
| 4358 Condition cond = CompareIC::ComputeCondition(op); | 4364 Condition cond = CompareIC::ComputeCondition(op); |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4546 __ Push(x2, x3, x0); // "next", iter, received | 4552 __ Push(x2, x3, x0); // "next", iter, received |
| 4547 | 4553 |
| 4548 // result = receiver[f](arg); | 4554 // result = receiver[f](arg); |
| 4549 __ Bind(&l_call); | 4555 __ Bind(&l_call); |
| 4550 __ Peek(x1, 1 * kPointerSize); | 4556 __ Peek(x1, 1 * kPointerSize); |
| 4551 __ Peek(x0, 2 * kPointerSize); | 4557 __ Peek(x0, 2 * kPointerSize); |
| 4552 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); | 4558 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); |
| 4553 CallIC(ic, TypeFeedbackId::None()); | 4559 CallIC(ic, TypeFeedbackId::None()); |
| 4554 __ Mov(x1, x0); | 4560 __ Mov(x1, x0); |
| 4555 __ Poke(x1, 2 * kPointerSize); | 4561 __ Poke(x1, 2 * kPointerSize); |
| 4556 CallFunctionStub stub(1, CALL_AS_METHOD); | 4562 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); |
| 4557 __ CallStub(&stub); | 4563 __ CallStub(&stub); |
| 4558 | 4564 |
| 4559 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 4565 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 4560 __ Drop(1); // The function is still on the stack; drop it. | 4566 __ Drop(1); // The function is still on the stack; drop it. |
| 4561 | 4567 |
| 4562 // if (!result.done) goto l_try; | 4568 // if (!result.done) goto l_try; |
| 4563 __ Bind(&l_loop); | 4569 __ Bind(&l_loop); |
| 4564 __ Push(x0); // save result | 4570 __ Push(x0); // save result |
| 4565 __ LoadRoot(x2, Heap::kdone_stringRootIndex); // "done" | 4571 __ LoadRoot(x2, Heap::kdone_stringRootIndex); // "done" |
| 4566 CallLoadIC(NOT_CONTEXTUAL); // result.done in x0 | 4572 CallLoadIC(NOT_CONTEXTUAL); // result.done in x0 |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4994 return previous_; | 5000 return previous_; |
| 4995 } | 5001 } |
| 4996 | 5002 |
| 4997 | 5003 |
| 4998 #undef __ | 5004 #undef __ |
| 4999 | 5005 |
| 5000 | 5006 |
| 5001 } } // namespace v8::internal | 5007 } } // namespace v8::internal |
| 5002 | 5008 |
| 5003 #endif // V8_TARGET_ARCH_ARM64 | 5009 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |