| OLD | NEW | 
|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "src/v8.h" | 5 #include "src/v8.h" | 
| 6 | 6 | 
| 7 #if V8_TARGET_ARCH_X87 | 7 #if V8_TARGET_ARCH_X87 | 
| 8 | 8 | 
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" | 
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" | 
| (...skipping 1933 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1944   __ mov(eax, arg_count()); | 1944   __ mov(eax, arg_count()); | 
| 1945   __ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size, | 1945   __ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size, | 
| 1946                            FixedArray::kHeaderSize)); | 1946                            FixedArray::kHeaderSize)); | 
| 1947 | 1947 | 
| 1948   // Verify that ecx contains an AllocationSite | 1948   // Verify that ecx contains an AllocationSite | 
| 1949   Factory* factory = masm->isolate()->factory(); | 1949   Factory* factory = masm->isolate()->factory(); | 
| 1950   __ cmp(FieldOperand(ecx, HeapObject::kMapOffset), | 1950   __ cmp(FieldOperand(ecx, HeapObject::kMapOffset), | 
| 1951          factory->allocation_site_map()); | 1951          factory->allocation_site_map()); | 
| 1952   __ j(not_equal, &miss); | 1952   __ j(not_equal, &miss); | 
| 1953 | 1953 | 
|  | 1954   // Increment the call count for monomorphic function calls. | 
|  | 1955   __ add(FieldOperand(ebx, edx, times_half_pointer_size, | 
|  | 1956                       FixedArray::kHeaderSize + kPointerSize), | 
|  | 1957          Immediate(Smi::FromInt(CallICNexus::kCallCountIncrement))); | 
|  | 1958 | 
| 1954   __ mov(ebx, ecx); | 1959   __ mov(ebx, ecx); | 
| 1955   __ mov(edx, edi); | 1960   __ mov(edx, edi); | 
| 1956   ArrayConstructorStub stub(masm->isolate(), arg_count()); | 1961   ArrayConstructorStub stub(masm->isolate(), arg_count()); | 
| 1957   __ TailCallStub(&stub); | 1962   __ TailCallStub(&stub); | 
| 1958 | 1963 | 
| 1959   __ bind(&miss); | 1964   __ bind(&miss); | 
| 1960   GenerateMiss(masm); | 1965   GenerateMiss(masm); | 
| 1961 | 1966 | 
| 1962   // The slow case, we need this no matter what to complete a call after a miss. | 1967   // The slow case, we need this no matter what to complete a call after a miss. | 
| 1963   CallFunctionNoFeedback(masm, | 1968   CallFunctionNoFeedback(masm, | 
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2003                     WeakCell::kValueOffset && | 2008                     WeakCell::kValueOffset && | 
| 2004                 WeakCell::kValueOffset == Symbol::kHashFieldSlot); | 2009                 WeakCell::kValueOffset == Symbol::kHashFieldSlot); | 
| 2005 | 2010 | 
| 2006   __ cmp(edi, FieldOperand(ecx, WeakCell::kValueOffset)); | 2011   __ cmp(edi, FieldOperand(ecx, WeakCell::kValueOffset)); | 
| 2007   __ j(not_equal, &extra_checks_or_miss); | 2012   __ j(not_equal, &extra_checks_or_miss); | 
| 2008 | 2013 | 
| 2009   // The compare above could have been a SMI/SMI comparison. Guard against this | 2014   // The compare above could have been a SMI/SMI comparison. Guard against this | 
| 2010   // convincing us that we have a monomorphic JSFunction. | 2015   // convincing us that we have a monomorphic JSFunction. | 
| 2011   __ JumpIfSmi(edi, &extra_checks_or_miss); | 2016   __ JumpIfSmi(edi, &extra_checks_or_miss); | 
| 2012 | 2017 | 
|  | 2018   // Increment the call count for monomorphic function calls. | 
|  | 2019   __ add(FieldOperand(ebx, edx, times_half_pointer_size, | 
|  | 2020                       FixedArray::kHeaderSize + kPointerSize), | 
|  | 2021          Immediate(Smi::FromInt(CallICNexus::kCallCountIncrement))); | 
|  | 2022 | 
| 2013   __ bind(&have_js_function); | 2023   __ bind(&have_js_function); | 
| 2014   if (CallAsMethod()) { | 2024   if (CallAsMethod()) { | 
| 2015     EmitContinueIfStrictOrNative(masm, &cont); | 2025     EmitContinueIfStrictOrNative(masm, &cont); | 
| 2016 | 2026 | 
| 2017     // Load the receiver from the stack. | 2027     // Load the receiver from the stack. | 
| 2018     __ mov(eax, Operand(esp, (argc + 1) * kPointerSize)); | 2028     __ mov(eax, Operand(esp, (argc + 1) * kPointerSize)); | 
| 2019 | 2029 | 
| 2020     __ JumpIfSmi(eax, &wrap); | 2030     __ JumpIfSmi(eax, &wrap); | 
| 2021 | 2031 | 
| 2022     __ CmpObjectType(eax, FIRST_SPEC_OBJECT_TYPE, ecx); | 2032     __ CmpObjectType(eax, FIRST_SPEC_OBJECT_TYPE, ecx); | 
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2074 | 2084 | 
| 2075   // Make sure the function is not the Array() function, which requires special | 2085   // Make sure the function is not the Array() function, which requires special | 
| 2076   // behavior on MISS. | 2086   // behavior on MISS. | 
| 2077   __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); | 2087   __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); | 
| 2078   __ cmp(edi, ecx); | 2088   __ cmp(edi, ecx); | 
| 2079   __ j(equal, &miss); | 2089   __ j(equal, &miss); | 
| 2080 | 2090 | 
| 2081   // Update stats. | 2091   // Update stats. | 
| 2082   __ add(FieldOperand(ebx, with_types_offset), Immediate(Smi::FromInt(1))); | 2092   __ add(FieldOperand(ebx, with_types_offset), Immediate(Smi::FromInt(1))); | 
| 2083 | 2093 | 
|  | 2094   // Initialize the call counter. | 
|  | 2095   __ mov(FieldOperand(ebx, edx, times_half_pointer_size, | 
|  | 2096                       FixedArray::kHeaderSize + kPointerSize), | 
|  | 2097          Immediate(Smi::FromInt(CallICNexus::kCallCountIncrement))); | 
|  | 2098 | 
| 2084   // Store the function. Use a stub since we need a frame for allocation. | 2099   // Store the function. Use a stub since we need a frame for allocation. | 
| 2085   // ebx - vector | 2100   // ebx - vector | 
| 2086   // edx - slot | 2101   // edx - slot | 
| 2087   // edi - function | 2102   // edi - function | 
| 2088   { | 2103   { | 
| 2089     FrameScope scope(masm, StackFrame::INTERNAL); | 2104     FrameScope scope(masm, StackFrame::INTERNAL); | 
| 2090     CreateWeakCellStub create_stub(isolate); | 2105     CreateWeakCellStub create_stub(isolate); | 
| 2091     __ push(edi); | 2106     __ push(edi); | 
| 2092     __ CallStub(&create_stub); | 2107     __ CallStub(&create_stub); | 
| 2093     __ pop(edi); | 2108     __ pop(edi); | 
| (...skipping 3044 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 5138                            Operand(ebp, 7 * kPointerSize), NULL); | 5153                            Operand(ebp, 7 * kPointerSize), NULL); | 
| 5139 } | 5154 } | 
| 5140 | 5155 | 
| 5141 | 5156 | 
| 5142 #undef __ | 5157 #undef __ | 
| 5143 | 5158 | 
| 5144 }  // namespace internal | 5159 }  // namespace internal | 
| 5145 }  // namespace v8 | 5160 }  // namespace v8 | 
| 5146 | 5161 | 
| 5147 #endif  // V8_TARGET_ARCH_X87 | 5162 #endif  // V8_TARGET_ARCH_X87 | 
| OLD | NEW | 
|---|