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 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1910 | 1910 |
1911 #undef TRACE_IC | 1911 #undef TRACE_IC |
1912 | 1912 |
1913 | 1913 |
1914 // ---------------------------------------------------------------------------- | 1914 // ---------------------------------------------------------------------------- |
1915 // Static IC stub generators. | 1915 // Static IC stub generators. |
1916 // | 1916 // |
1917 | 1917 |
1918 // Used from ic-<arch>.cc. | 1918 // Used from ic-<arch>.cc. |
1919 RUNTIME_FUNCTION(CallIC_Miss) { | 1919 RUNTIME_FUNCTION(CallIC_Miss) { |
| 1920 Logger::TimerEventScope timer( |
| 1921 isolate, Logger::TimerEventScope::v8_ic_miss); |
1920 HandleScope scope(isolate); | 1922 HandleScope scope(isolate); |
1921 ASSERT(args.length() == 4); | 1923 ASSERT(args.length() == 4); |
1922 CallIC ic(isolate); | 1924 CallIC ic(isolate); |
1923 Handle<Object> receiver = args.at<Object>(0); | 1925 Handle<Object> receiver = args.at<Object>(0); |
1924 Handle<Object> function = args.at<Object>(1); | 1926 Handle<Object> function = args.at<Object>(1); |
1925 Handle<FixedArray> vector = args.at<FixedArray>(2); | 1927 Handle<FixedArray> vector = args.at<FixedArray>(2); |
1926 Handle<Smi> slot = args.at<Smi>(3); | 1928 Handle<Smi> slot = args.at<Smi>(3); |
1927 ic.HandleMiss(receiver, function, vector, slot); | 1929 ic.HandleMiss(receiver, function, vector, slot); |
1928 return *function; | 1930 return *function; |
1929 } | 1931 } |
1930 | 1932 |
1931 | 1933 |
1932 RUNTIME_FUNCTION(CallIC_Customization_Miss) { | 1934 RUNTIME_FUNCTION(CallIC_Customization_Miss) { |
| 1935 Logger::TimerEventScope timer( |
| 1936 isolate, Logger::TimerEventScope::v8_ic_miss); |
1933 HandleScope scope(isolate); | 1937 HandleScope scope(isolate); |
1934 ASSERT(args.length() == 4); | 1938 ASSERT(args.length() == 4); |
1935 // A miss on a custom call ic always results in going megamorphic. | 1939 // A miss on a custom call ic always results in going megamorphic. |
1936 CallIC ic(isolate); | 1940 CallIC ic(isolate); |
1937 Handle<Object> function = args.at<Object>(1); | 1941 Handle<Object> function = args.at<Object>(1); |
1938 Handle<FixedArray> vector = args.at<FixedArray>(2); | 1942 Handle<FixedArray> vector = args.at<FixedArray>(2); |
1939 Handle<Smi> slot = args.at<Smi>(3); | 1943 Handle<Smi> slot = args.at<Smi>(3); |
1940 ic.PatchMegamorphic(vector, slot); | 1944 ic.PatchMegamorphic(vector, slot); |
1941 return *function; | 1945 return *function; |
1942 } | 1946 } |
1943 | 1947 |
1944 | 1948 |
1945 // Used from ic-<arch>.cc. | 1949 // Used from ic-<arch>.cc. |
1946 RUNTIME_FUNCTION(LoadIC_Miss) { | 1950 RUNTIME_FUNCTION(LoadIC_Miss) { |
| 1951 Logger::TimerEventScope timer( |
| 1952 isolate, Logger::TimerEventScope::v8_ic_miss); |
1947 HandleScope scope(isolate); | 1953 HandleScope scope(isolate); |
1948 ASSERT(args.length() == 2); | 1954 ASSERT(args.length() == 2); |
1949 LoadIC ic(IC::NO_EXTRA_FRAME, isolate); | 1955 LoadIC ic(IC::NO_EXTRA_FRAME, isolate); |
1950 Handle<Object> receiver = args.at<Object>(0); | 1956 Handle<Object> receiver = args.at<Object>(0); |
1951 Handle<String> key = args.at<String>(1); | 1957 Handle<String> key = args.at<String>(1); |
1952 ic.UpdateState(receiver, key); | 1958 ic.UpdateState(receiver, key); |
1953 Handle<Object> result; | 1959 Handle<Object> result; |
1954 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); | 1960 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); |
1955 return *result; | 1961 return *result; |
1956 } | 1962 } |
1957 | 1963 |
1958 | 1964 |
1959 // Used from ic-<arch>.cc | 1965 // Used from ic-<arch>.cc |
1960 RUNTIME_FUNCTION(KeyedLoadIC_Miss) { | 1966 RUNTIME_FUNCTION(KeyedLoadIC_Miss) { |
| 1967 Logger::TimerEventScope timer( |
| 1968 isolate, Logger::TimerEventScope::v8_ic_miss); |
1961 HandleScope scope(isolate); | 1969 HandleScope scope(isolate); |
1962 ASSERT(args.length() == 2); | 1970 ASSERT(args.length() == 2); |
1963 KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate); | 1971 KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate); |
1964 Handle<Object> receiver = args.at<Object>(0); | 1972 Handle<Object> receiver = args.at<Object>(0); |
1965 Handle<Object> key = args.at<Object>(1); | 1973 Handle<Object> key = args.at<Object>(1); |
1966 ic.UpdateState(receiver, key); | 1974 ic.UpdateState(receiver, key); |
1967 Handle<Object> result; | 1975 Handle<Object> result; |
1968 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); | 1976 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); |
1969 return *result; | 1977 return *result; |
1970 } | 1978 } |
1971 | 1979 |
1972 | 1980 |
1973 RUNTIME_FUNCTION(KeyedLoadIC_MissFromStubFailure) { | 1981 RUNTIME_FUNCTION(KeyedLoadIC_MissFromStubFailure) { |
| 1982 Logger::TimerEventScope timer( |
| 1983 isolate, Logger::TimerEventScope::v8_ic_miss); |
1974 HandleScope scope(isolate); | 1984 HandleScope scope(isolate); |
1975 ASSERT(args.length() == 2); | 1985 ASSERT(args.length() == 2); |
1976 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate); | 1986 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate); |
1977 Handle<Object> receiver = args.at<Object>(0); | 1987 Handle<Object> receiver = args.at<Object>(0); |
1978 Handle<Object> key = args.at<Object>(1); | 1988 Handle<Object> key = args.at<Object>(1); |
1979 ic.UpdateState(receiver, key); | 1989 ic.UpdateState(receiver, key); |
1980 Handle<Object> result; | 1990 Handle<Object> result; |
1981 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); | 1991 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); |
1982 return *result; | 1992 return *result; |
1983 } | 1993 } |
1984 | 1994 |
1985 | 1995 |
1986 // Used from ic-<arch>.cc. | 1996 // Used from ic-<arch>.cc. |
1987 RUNTIME_FUNCTION(StoreIC_Miss) { | 1997 RUNTIME_FUNCTION(StoreIC_Miss) { |
| 1998 Logger::TimerEventScope timer( |
| 1999 isolate, Logger::TimerEventScope::v8_ic_miss); |
1988 HandleScope scope(isolate); | 2000 HandleScope scope(isolate); |
1989 ASSERT(args.length() == 3); | 2001 ASSERT(args.length() == 3); |
1990 StoreIC ic(IC::NO_EXTRA_FRAME, isolate); | 2002 StoreIC ic(IC::NO_EXTRA_FRAME, isolate); |
1991 Handle<Object> receiver = args.at<Object>(0); | 2003 Handle<Object> receiver = args.at<Object>(0); |
1992 Handle<String> key = args.at<String>(1); | 2004 Handle<String> key = args.at<String>(1); |
1993 ic.UpdateState(receiver, key); | 2005 ic.UpdateState(receiver, key); |
1994 Handle<Object> result; | 2006 Handle<Object> result; |
1995 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 2007 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
1996 isolate, | 2008 isolate, |
1997 result, | 2009 result, |
1998 ic.Store(receiver, key, args.at<Object>(2))); | 2010 ic.Store(receiver, key, args.at<Object>(2))); |
1999 return *result; | 2011 return *result; |
2000 } | 2012 } |
2001 | 2013 |
2002 | 2014 |
2003 RUNTIME_FUNCTION(StoreIC_MissFromStubFailure) { | 2015 RUNTIME_FUNCTION(StoreIC_MissFromStubFailure) { |
| 2016 Logger::TimerEventScope timer( |
| 2017 isolate, Logger::TimerEventScope::v8_ic_miss); |
2004 HandleScope scope(isolate); | 2018 HandleScope scope(isolate); |
2005 ASSERT(args.length() == 3); | 2019 ASSERT(args.length() == 3); |
2006 StoreIC ic(IC::EXTRA_CALL_FRAME, isolate); | 2020 StoreIC ic(IC::EXTRA_CALL_FRAME, isolate); |
2007 Handle<Object> receiver = args.at<Object>(0); | 2021 Handle<Object> receiver = args.at<Object>(0); |
2008 Handle<String> key = args.at<String>(1); | 2022 Handle<String> key = args.at<String>(1); |
2009 ic.UpdateState(receiver, key); | 2023 ic.UpdateState(receiver, key); |
2010 Handle<Object> result; | 2024 Handle<Object> result; |
2011 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 2025 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
2012 isolate, | 2026 isolate, |
2013 result, | 2027 result, |
2014 ic.Store(receiver, key, args.at<Object>(2))); | 2028 ic.Store(receiver, key, args.at<Object>(2))); |
2015 return *result; | 2029 return *result; |
2016 } | 2030 } |
2017 | 2031 |
2018 | 2032 |
2019 RUNTIME_FUNCTION(StoreIC_ArrayLength) { | 2033 RUNTIME_FUNCTION(StoreIC_ArrayLength) { |
| 2034 Logger::TimerEventScope timer( |
| 2035 isolate, Logger::TimerEventScope::v8_ic_miss); |
2020 HandleScope scope(isolate); | 2036 HandleScope scope(isolate); |
2021 | 2037 |
2022 ASSERT(args.length() == 2); | 2038 ASSERT(args.length() == 2); |
2023 Handle<JSArray> receiver = args.at<JSArray>(0); | 2039 Handle<JSArray> receiver = args.at<JSArray>(0); |
2024 Handle<Object> len = args.at<Object>(1); | 2040 Handle<Object> len = args.at<Object>(1); |
2025 | 2041 |
2026 // The generated code should filter out non-Smis before we get here. | 2042 // The generated code should filter out non-Smis before we get here. |
2027 ASSERT(len->IsSmi()); | 2043 ASSERT(len->IsSmi()); |
2028 | 2044 |
2029 #ifdef DEBUG | 2045 #ifdef DEBUG |
2030 // The length property has to be a writable callback property. | 2046 // The length property has to be a writable callback property. |
2031 LookupResult debug_lookup(isolate); | 2047 LookupResult debug_lookup(isolate); |
2032 receiver->LookupOwn(isolate->factory()->length_string(), &debug_lookup); | 2048 receiver->LookupOwn(isolate->factory()->length_string(), &debug_lookup); |
2033 ASSERT(debug_lookup.IsPropertyCallbacks() && !debug_lookup.IsReadOnly()); | 2049 ASSERT(debug_lookup.IsPropertyCallbacks() && !debug_lookup.IsReadOnly()); |
2034 #endif | 2050 #endif |
2035 | 2051 |
2036 RETURN_FAILURE_ON_EXCEPTION( | 2052 RETURN_FAILURE_ON_EXCEPTION( |
2037 isolate, JSArray::SetElementsLength(receiver, len)); | 2053 isolate, JSArray::SetElementsLength(receiver, len)); |
2038 return *len; | 2054 return *len; |
2039 } | 2055 } |
2040 | 2056 |
2041 | 2057 |
2042 // Extend storage is called in a store inline cache when | 2058 // Extend storage is called in a store inline cache when |
2043 // it is necessary to extend the properties array of a | 2059 // it is necessary to extend the properties array of a |
2044 // JSObject. | 2060 // JSObject. |
2045 RUNTIME_FUNCTION(SharedStoreIC_ExtendStorage) { | 2061 RUNTIME_FUNCTION(SharedStoreIC_ExtendStorage) { |
| 2062 Logger::TimerEventScope timer( |
| 2063 isolate, Logger::TimerEventScope::v8_ic_miss); |
2046 HandleScope shs(isolate); | 2064 HandleScope shs(isolate); |
2047 ASSERT(args.length() == 3); | 2065 ASSERT(args.length() == 3); |
2048 | 2066 |
2049 // Convert the parameters | 2067 // Convert the parameters |
2050 Handle<JSObject> object = args.at<JSObject>(0); | 2068 Handle<JSObject> object = args.at<JSObject>(0); |
2051 Handle<Map> transition = args.at<Map>(1); | 2069 Handle<Map> transition = args.at<Map>(1); |
2052 Handle<Object> value = args.at<Object>(2); | 2070 Handle<Object> value = args.at<Object>(2); |
2053 | 2071 |
2054 // Check the object has run out out property space. | 2072 // Check the object has run out out property space. |
2055 ASSERT(object->HasFastProperties()); | 2073 ASSERT(object->HasFastProperties()); |
(...skipping 20 matching lines...) Expand all Loading... |
2076 object->set_properties(*new_storage); | 2094 object->set_properties(*new_storage); |
2077 object->set_map(*transition); | 2095 object->set_map(*transition); |
2078 | 2096 |
2079 // Return the stored value. | 2097 // Return the stored value. |
2080 return *value; | 2098 return *value; |
2081 } | 2099 } |
2082 | 2100 |
2083 | 2101 |
2084 // Used from ic-<arch>.cc. | 2102 // Used from ic-<arch>.cc. |
2085 RUNTIME_FUNCTION(KeyedStoreIC_Miss) { | 2103 RUNTIME_FUNCTION(KeyedStoreIC_Miss) { |
| 2104 Logger::TimerEventScope timer( |
| 2105 isolate, Logger::TimerEventScope::v8_ic_miss); |
2086 HandleScope scope(isolate); | 2106 HandleScope scope(isolate); |
2087 ASSERT(args.length() == 3); | 2107 ASSERT(args.length() == 3); |
2088 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate); | 2108 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate); |
2089 Handle<Object> receiver = args.at<Object>(0); | 2109 Handle<Object> receiver = args.at<Object>(0); |
2090 Handle<Object> key = args.at<Object>(1); | 2110 Handle<Object> key = args.at<Object>(1); |
2091 ic.UpdateState(receiver, key); | 2111 ic.UpdateState(receiver, key); |
2092 Handle<Object> result; | 2112 Handle<Object> result; |
2093 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 2113 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
2094 isolate, | 2114 isolate, |
2095 result, | 2115 result, |
2096 ic.Store(receiver, key, args.at<Object>(2))); | 2116 ic.Store(receiver, key, args.at<Object>(2))); |
2097 return *result; | 2117 return *result; |
2098 } | 2118 } |
2099 | 2119 |
2100 | 2120 |
2101 RUNTIME_FUNCTION(KeyedStoreIC_MissFromStubFailure) { | 2121 RUNTIME_FUNCTION(KeyedStoreIC_MissFromStubFailure) { |
| 2122 Logger::TimerEventScope timer( |
| 2123 isolate, Logger::TimerEventScope::v8_ic_miss); |
2102 HandleScope scope(isolate); | 2124 HandleScope scope(isolate); |
2103 ASSERT(args.length() == 3); | 2125 ASSERT(args.length() == 3); |
2104 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate); | 2126 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate); |
2105 Handle<Object> receiver = args.at<Object>(0); | 2127 Handle<Object> receiver = args.at<Object>(0); |
2106 Handle<Object> key = args.at<Object>(1); | 2128 Handle<Object> key = args.at<Object>(1); |
2107 ic.UpdateState(receiver, key); | 2129 ic.UpdateState(receiver, key); |
2108 Handle<Object> result; | 2130 Handle<Object> result; |
2109 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 2131 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
2110 isolate, | 2132 isolate, |
2111 result, | 2133 result, |
(...skipping 30 matching lines...) Expand all Loading... |
2142 Handle<Object> result; | 2164 Handle<Object> result; |
2143 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 2165 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
2144 isolate, result, | 2166 isolate, result, |
2145 Runtime::SetObjectProperty( | 2167 Runtime::SetObjectProperty( |
2146 isolate, object, key, value, NONE, strict_mode)); | 2168 isolate, object, key, value, NONE, strict_mode)); |
2147 return *result; | 2169 return *result; |
2148 } | 2170 } |
2149 | 2171 |
2150 | 2172 |
2151 RUNTIME_FUNCTION(ElementsTransitionAndStoreIC_Miss) { | 2173 RUNTIME_FUNCTION(ElementsTransitionAndStoreIC_Miss) { |
| 2174 Logger::TimerEventScope timer( |
| 2175 isolate, Logger::TimerEventScope::v8_ic_miss); |
2152 HandleScope scope(isolate); | 2176 HandleScope scope(isolate); |
2153 ASSERT(args.length() == 4); | 2177 ASSERT(args.length() == 4); |
2154 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate); | 2178 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate); |
2155 Handle<Object> value = args.at<Object>(0); | 2179 Handle<Object> value = args.at<Object>(0); |
2156 Handle<Map> map = args.at<Map>(1); | 2180 Handle<Map> map = args.at<Map>(1); |
2157 Handle<Object> key = args.at<Object>(2); | 2181 Handle<Object> key = args.at<Object>(2); |
2158 Handle<Object> object = args.at<Object>(3); | 2182 Handle<Object> object = args.at<Object>(3); |
2159 StrictMode strict_mode = ic.strict_mode(); | 2183 StrictMode strict_mode = ic.strict_mode(); |
2160 if (object->IsJSObject()) { | 2184 if (object->IsJSObject()) { |
2161 JSObject::TransitionElementsKind(Handle<JSObject>::cast(object), | 2185 JSObject::TransitionElementsKind(Handle<JSObject>::cast(object), |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2651 PatchInlinedSmiCode(address(), ENABLE_INLINED_SMI_CHECK); | 2675 PatchInlinedSmiCode(address(), ENABLE_INLINED_SMI_CHECK); |
2652 } else if (old_state.UseInlinedSmiCode() && !state.UseInlinedSmiCode()) { | 2676 } else if (old_state.UseInlinedSmiCode() && !state.UseInlinedSmiCode()) { |
2653 PatchInlinedSmiCode(address(), DISABLE_INLINED_SMI_CHECK); | 2677 PatchInlinedSmiCode(address(), DISABLE_INLINED_SMI_CHECK); |
2654 } | 2678 } |
2655 | 2679 |
2656 return result; | 2680 return result; |
2657 } | 2681 } |
2658 | 2682 |
2659 | 2683 |
2660 RUNTIME_FUNCTION(BinaryOpIC_Miss) { | 2684 RUNTIME_FUNCTION(BinaryOpIC_Miss) { |
| 2685 Logger::TimerEventScope timer( |
| 2686 isolate, Logger::TimerEventScope::v8_ic_miss); |
2661 HandleScope scope(isolate); | 2687 HandleScope scope(isolate); |
2662 ASSERT_EQ(2, args.length()); | 2688 ASSERT_EQ(2, args.length()); |
2663 Handle<Object> left = args.at<Object>(BinaryOpICStub::kLeft); | 2689 Handle<Object> left = args.at<Object>(BinaryOpICStub::kLeft); |
2664 Handle<Object> right = args.at<Object>(BinaryOpICStub::kRight); | 2690 Handle<Object> right = args.at<Object>(BinaryOpICStub::kRight); |
2665 BinaryOpIC ic(isolate); | 2691 BinaryOpIC ic(isolate); |
2666 Handle<Object> result; | 2692 Handle<Object> result; |
2667 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 2693 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
2668 isolate, | 2694 isolate, |
2669 result, | 2695 result, |
2670 ic.Transition(Handle<AllocationSite>::null(), left, right)); | 2696 ic.Transition(Handle<AllocationSite>::null(), left, right)); |
2671 return *result; | 2697 return *result; |
2672 } | 2698 } |
2673 | 2699 |
2674 | 2700 |
2675 RUNTIME_FUNCTION(BinaryOpIC_MissWithAllocationSite) { | 2701 RUNTIME_FUNCTION(BinaryOpIC_MissWithAllocationSite) { |
| 2702 Logger::TimerEventScope timer( |
| 2703 isolate, Logger::TimerEventScope::v8_ic_miss); |
2676 HandleScope scope(isolate); | 2704 HandleScope scope(isolate); |
2677 ASSERT_EQ(3, args.length()); | 2705 ASSERT_EQ(3, args.length()); |
2678 Handle<AllocationSite> allocation_site = args.at<AllocationSite>( | 2706 Handle<AllocationSite> allocation_site = args.at<AllocationSite>( |
2679 BinaryOpWithAllocationSiteStub::kAllocationSite); | 2707 BinaryOpWithAllocationSiteStub::kAllocationSite); |
2680 Handle<Object> left = args.at<Object>( | 2708 Handle<Object> left = args.at<Object>( |
2681 BinaryOpWithAllocationSiteStub::kLeft); | 2709 BinaryOpWithAllocationSiteStub::kLeft); |
2682 Handle<Object> right = args.at<Object>( | 2710 Handle<Object> right = args.at<Object>( |
2683 BinaryOpWithAllocationSiteStub::kRight); | 2711 BinaryOpWithAllocationSiteStub::kRight); |
2684 BinaryOpIC ic(isolate); | 2712 BinaryOpIC ic(isolate); |
2685 Handle<Object> result; | 2713 Handle<Object> result; |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2899 if (previous_state == UNINITIALIZED) { | 2927 if (previous_state == UNINITIALIZED) { |
2900 PatchInlinedSmiCode(address(), ENABLE_INLINED_SMI_CHECK); | 2928 PatchInlinedSmiCode(address(), ENABLE_INLINED_SMI_CHECK); |
2901 } | 2929 } |
2902 | 2930 |
2903 return *new_target; | 2931 return *new_target; |
2904 } | 2932 } |
2905 | 2933 |
2906 | 2934 |
2907 // Used from ICCompareStub::GenerateMiss in code-stubs-<arch>.cc. | 2935 // Used from ICCompareStub::GenerateMiss in code-stubs-<arch>.cc. |
2908 RUNTIME_FUNCTION(CompareIC_Miss) { | 2936 RUNTIME_FUNCTION(CompareIC_Miss) { |
| 2937 Logger::TimerEventScope timer( |
| 2938 isolate, Logger::TimerEventScope::v8_ic_miss); |
2909 HandleScope scope(isolate); | 2939 HandleScope scope(isolate); |
2910 ASSERT(args.length() == 3); | 2940 ASSERT(args.length() == 3); |
2911 CompareIC ic(isolate, static_cast<Token::Value>(args.smi_at(2))); | 2941 CompareIC ic(isolate, static_cast<Token::Value>(args.smi_at(2))); |
2912 return ic.UpdateCaches(args.at<Object>(0), args.at<Object>(1)); | 2942 return ic.UpdateCaches(args.at<Object>(0), args.at<Object>(1)); |
2913 } | 2943 } |
2914 | 2944 |
2915 | 2945 |
2916 void CompareNilIC::Clear(Address address, | 2946 void CompareNilIC::Clear(Address address, |
2917 Code* target, | 2947 Code* target, |
2918 ConstantPoolArray* constant_pool) { | 2948 ConstantPoolArray* constant_pool) { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2963 code = isolate()->stub_cache()->ComputeCompareNil(monomorphic_map, &stub); | 2993 code = isolate()->stub_cache()->ComputeCompareNil(monomorphic_map, &stub); |
2964 } else { | 2994 } else { |
2965 code = stub.GetCode(); | 2995 code = stub.GetCode(); |
2966 } | 2996 } |
2967 set_target(*code); | 2997 set_target(*code); |
2968 return DoCompareNilSlow(isolate(), nil, object); | 2998 return DoCompareNilSlow(isolate(), nil, object); |
2969 } | 2999 } |
2970 | 3000 |
2971 | 3001 |
2972 RUNTIME_FUNCTION(CompareNilIC_Miss) { | 3002 RUNTIME_FUNCTION(CompareNilIC_Miss) { |
| 3003 Logger::TimerEventScope timer( |
| 3004 isolate, Logger::TimerEventScope::v8_ic_miss); |
2973 HandleScope scope(isolate); | 3005 HandleScope scope(isolate); |
2974 Handle<Object> object = args.at<Object>(0); | 3006 Handle<Object> object = args.at<Object>(0); |
2975 CompareNilIC ic(isolate); | 3007 CompareNilIC ic(isolate); |
2976 return *ic.CompareNil(object); | 3008 return *ic.CompareNil(object); |
2977 } | 3009 } |
2978 | 3010 |
2979 | 3011 |
2980 RUNTIME_FUNCTION(Unreachable) { | 3012 RUNTIME_FUNCTION(Unreachable) { |
2981 UNREACHABLE(); | 3013 UNREACHABLE(); |
2982 CHECK(false); | 3014 CHECK(false); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3028 Handle<Object> ToBooleanIC::ToBoolean(Handle<Object> object) { | 3060 Handle<Object> ToBooleanIC::ToBoolean(Handle<Object> object) { |
3029 ToBooleanStub stub(isolate(), target()->extra_ic_state()); | 3061 ToBooleanStub stub(isolate(), target()->extra_ic_state()); |
3030 bool to_boolean_value = stub.UpdateStatus(object); | 3062 bool to_boolean_value = stub.UpdateStatus(object); |
3031 Handle<Code> code = stub.GetCode(); | 3063 Handle<Code> code = stub.GetCode(); |
3032 set_target(*code); | 3064 set_target(*code); |
3033 return handle(Smi::FromInt(to_boolean_value ? 1 : 0), isolate()); | 3065 return handle(Smi::FromInt(to_boolean_value ? 1 : 0), isolate()); |
3034 } | 3066 } |
3035 | 3067 |
3036 | 3068 |
3037 RUNTIME_FUNCTION(ToBooleanIC_Miss) { | 3069 RUNTIME_FUNCTION(ToBooleanIC_Miss) { |
| 3070 Logger::TimerEventScope timer( |
| 3071 isolate, Logger::TimerEventScope::v8_ic_miss); |
3038 ASSERT(args.length() == 1); | 3072 ASSERT(args.length() == 1); |
3039 HandleScope scope(isolate); | 3073 HandleScope scope(isolate); |
3040 Handle<Object> object = args.at<Object>(0); | 3074 Handle<Object> object = args.at<Object>(0); |
3041 ToBooleanIC ic(isolate); | 3075 ToBooleanIC ic(isolate); |
3042 return *ic.ToBoolean(object); | 3076 return *ic.ToBoolean(object); |
3043 } | 3077 } |
3044 | 3078 |
3045 | 3079 |
3046 static const Address IC_utilities[] = { | 3080 static const Address IC_utilities[] = { |
3047 #define ADDR(name) FUNCTION_ADDR(name), | 3081 #define ADDR(name) FUNCTION_ADDR(name), |
3048 IC_UTIL_LIST(ADDR) | 3082 IC_UTIL_LIST(ADDR) |
3049 NULL | 3083 NULL |
3050 #undef ADDR | 3084 #undef ADDR |
3051 }; | 3085 }; |
3052 | 3086 |
3053 | 3087 |
3054 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 3088 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
3055 return IC_utilities[id]; | 3089 return IC_utilities[id]; |
3056 } | 3090 } |
3057 | 3091 |
3058 | 3092 |
3059 } } // namespace v8::internal | 3093 } } // namespace v8::internal |
OLD | NEW |