| 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 1913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1924 | 1924 |
| 1925 #undef TRACE_IC | 1925 #undef TRACE_IC |
| 1926 | 1926 |
| 1927 | 1927 |
| 1928 // ---------------------------------------------------------------------------- | 1928 // ---------------------------------------------------------------------------- |
| 1929 // Static IC stub generators. | 1929 // Static IC stub generators. |
| 1930 // | 1930 // |
| 1931 | 1931 |
| 1932 // Used from ic-<arch>.cc. | 1932 // Used from ic-<arch>.cc. |
| 1933 RUNTIME_FUNCTION(CallIC_Miss) { | 1933 RUNTIME_FUNCTION(CallIC_Miss) { |
| 1934 Logger::TimerEventScope timer( | 1934 Logger::ExternalTimerEventScope timer( |
| 1935 isolate, Logger::TimerEventScope::v8_ic_miss); | 1935 isolate, Logger::TimerEventScope::v8_ic_miss); |
| 1936 HandleScope scope(isolate); | 1936 HandleScope scope(isolate); |
| 1937 ASSERT(args.length() == 4); | 1937 ASSERT(args.length() == 4); |
| 1938 CallIC ic(isolate); | 1938 CallIC ic(isolate); |
| 1939 Handle<Object> receiver = args.at<Object>(0); | 1939 Handle<Object> receiver = args.at<Object>(0); |
| 1940 Handle<Object> function = args.at<Object>(1); | 1940 Handle<Object> function = args.at<Object>(1); |
| 1941 Handle<FixedArray> vector = args.at<FixedArray>(2); | 1941 Handle<FixedArray> vector = args.at<FixedArray>(2); |
| 1942 Handle<Smi> slot = args.at<Smi>(3); | 1942 Handle<Smi> slot = args.at<Smi>(3); |
| 1943 ic.HandleMiss(receiver, function, vector, slot); | 1943 ic.HandleMiss(receiver, function, vector, slot); |
| 1944 return *function; | 1944 return *function; |
| 1945 } | 1945 } |
| 1946 | 1946 |
| 1947 | 1947 |
| 1948 RUNTIME_FUNCTION(CallIC_Customization_Miss) { | 1948 RUNTIME_FUNCTION(CallIC_Customization_Miss) { |
| 1949 Logger::TimerEventScope timer( | 1949 Logger::ExternalTimerEventScope timer( |
| 1950 isolate, Logger::TimerEventScope::v8_ic_miss); | 1950 isolate, Logger::TimerEventScope::v8_ic_miss); |
| 1951 HandleScope scope(isolate); | 1951 HandleScope scope(isolate); |
| 1952 ASSERT(args.length() == 4); | 1952 ASSERT(args.length() == 4); |
| 1953 // A miss on a custom call ic always results in going megamorphic. | 1953 // A miss on a custom call ic always results in going megamorphic. |
| 1954 CallIC ic(isolate); | 1954 CallIC ic(isolate); |
| 1955 Handle<Object> function = args.at<Object>(1); | 1955 Handle<Object> function = args.at<Object>(1); |
| 1956 Handle<FixedArray> vector = args.at<FixedArray>(2); | 1956 Handle<FixedArray> vector = args.at<FixedArray>(2); |
| 1957 Handle<Smi> slot = args.at<Smi>(3); | 1957 Handle<Smi> slot = args.at<Smi>(3); |
| 1958 ic.PatchMegamorphic(vector, slot); | 1958 ic.PatchMegamorphic(vector, slot); |
| 1959 return *function; | 1959 return *function; |
| 1960 } | 1960 } |
| 1961 | 1961 |
| 1962 | 1962 |
| 1963 // Used from ic-<arch>.cc. | 1963 // Used from ic-<arch>.cc. |
| 1964 RUNTIME_FUNCTION(LoadIC_Miss) { | 1964 RUNTIME_FUNCTION(LoadIC_Miss) { |
| 1965 Logger::TimerEventScope timer( | 1965 Logger::ExternalTimerEventScope timer( |
| 1966 isolate, Logger::TimerEventScope::v8_ic_miss); | 1966 isolate, Logger::TimerEventScope::v8_ic_miss); |
| 1967 HandleScope scope(isolate); | 1967 HandleScope scope(isolate); |
| 1968 ASSERT(args.length() == 2); | 1968 ASSERT(args.length() == 2); |
| 1969 LoadIC ic(IC::NO_EXTRA_FRAME, isolate); | 1969 LoadIC ic(IC::NO_EXTRA_FRAME, isolate); |
| 1970 Handle<Object> receiver = args.at<Object>(0); | 1970 Handle<Object> receiver = args.at<Object>(0); |
| 1971 Handle<String> key = args.at<String>(1); | 1971 Handle<String> key = args.at<String>(1); |
| 1972 ic.UpdateState(receiver, key); | 1972 ic.UpdateState(receiver, key); |
| 1973 Handle<Object> result; | 1973 Handle<Object> result; |
| 1974 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); | 1974 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); |
| 1975 return *result; | 1975 return *result; |
| 1976 } | 1976 } |
| 1977 | 1977 |
| 1978 | 1978 |
| 1979 // Used from ic-<arch>.cc | 1979 // Used from ic-<arch>.cc |
| 1980 RUNTIME_FUNCTION(KeyedLoadIC_Miss) { | 1980 RUNTIME_FUNCTION(KeyedLoadIC_Miss) { |
| 1981 Logger::TimerEventScope timer( | 1981 Logger::ExternalTimerEventScope timer( |
| 1982 isolate, Logger::TimerEventScope::v8_ic_miss); | 1982 isolate, Logger::TimerEventScope::v8_ic_miss); |
| 1983 HandleScope scope(isolate); | 1983 HandleScope scope(isolate); |
| 1984 ASSERT(args.length() == 2); | 1984 ASSERT(args.length() == 2); |
| 1985 KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate); | 1985 KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate); |
| 1986 Handle<Object> receiver = args.at<Object>(0); | 1986 Handle<Object> receiver = args.at<Object>(0); |
| 1987 Handle<Object> key = args.at<Object>(1); | 1987 Handle<Object> key = args.at<Object>(1); |
| 1988 ic.UpdateState(receiver, key); | 1988 ic.UpdateState(receiver, key); |
| 1989 Handle<Object> result; | 1989 Handle<Object> result; |
| 1990 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); | 1990 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); |
| 1991 return *result; | 1991 return *result; |
| 1992 } | 1992 } |
| 1993 | 1993 |
| 1994 | 1994 |
| 1995 RUNTIME_FUNCTION(KeyedLoadIC_MissFromStubFailure) { | 1995 RUNTIME_FUNCTION(KeyedLoadIC_MissFromStubFailure) { |
| 1996 Logger::TimerEventScope timer( | 1996 Logger::ExternalTimerEventScope timer( |
| 1997 isolate, Logger::TimerEventScope::v8_ic_miss); | 1997 isolate, Logger::TimerEventScope::v8_ic_miss); |
| 1998 HandleScope scope(isolate); | 1998 HandleScope scope(isolate); |
| 1999 ASSERT(args.length() == 2); | 1999 ASSERT(args.length() == 2); |
| 2000 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate); | 2000 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate); |
| 2001 Handle<Object> receiver = args.at<Object>(0); | 2001 Handle<Object> receiver = args.at<Object>(0); |
| 2002 Handle<Object> key = args.at<Object>(1); | 2002 Handle<Object> key = args.at<Object>(1); |
| 2003 ic.UpdateState(receiver, key); | 2003 ic.UpdateState(receiver, key); |
| 2004 Handle<Object> result; | 2004 Handle<Object> result; |
| 2005 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); | 2005 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); |
| 2006 return *result; | 2006 return *result; |
| 2007 } | 2007 } |
| 2008 | 2008 |
| 2009 | 2009 |
| 2010 // Used from ic-<arch>.cc. | 2010 // Used from ic-<arch>.cc. |
| 2011 RUNTIME_FUNCTION(StoreIC_Miss) { | 2011 RUNTIME_FUNCTION(StoreIC_Miss) { |
| 2012 Logger::TimerEventScope timer( | 2012 Logger::ExternalTimerEventScope timer( |
| 2013 isolate, Logger::TimerEventScope::v8_ic_miss); | 2013 isolate, Logger::TimerEventScope::v8_ic_miss); |
| 2014 HandleScope scope(isolate); | 2014 HandleScope scope(isolate); |
| 2015 ASSERT(args.length() == 3); | 2015 ASSERT(args.length() == 3); |
| 2016 StoreIC ic(IC::NO_EXTRA_FRAME, isolate); | 2016 StoreIC ic(IC::NO_EXTRA_FRAME, isolate); |
| 2017 Handle<Object> receiver = args.at<Object>(0); | 2017 Handle<Object> receiver = args.at<Object>(0); |
| 2018 Handle<String> key = args.at<String>(1); | 2018 Handle<String> key = args.at<String>(1); |
| 2019 ic.UpdateState(receiver, key); | 2019 ic.UpdateState(receiver, key); |
| 2020 Handle<Object> result; | 2020 Handle<Object> result; |
| 2021 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 2021 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 2022 isolate, | 2022 isolate, |
| 2023 result, | 2023 result, |
| 2024 ic.Store(receiver, key, args.at<Object>(2))); | 2024 ic.Store(receiver, key, args.at<Object>(2))); |
| 2025 return *result; | 2025 return *result; |
| 2026 } | 2026 } |
| 2027 | 2027 |
| 2028 | 2028 |
| 2029 RUNTIME_FUNCTION(StoreIC_MissFromStubFailure) { | 2029 RUNTIME_FUNCTION(StoreIC_MissFromStubFailure) { |
| 2030 Logger::TimerEventScope timer( | 2030 Logger::ExternalTimerEventScope timer( |
| 2031 isolate, Logger::TimerEventScope::v8_ic_miss); | 2031 isolate, Logger::TimerEventScope::v8_ic_miss); |
| 2032 HandleScope scope(isolate); | 2032 HandleScope scope(isolate); |
| 2033 ASSERT(args.length() == 3); | 2033 ASSERT(args.length() == 3); |
| 2034 StoreIC ic(IC::EXTRA_CALL_FRAME, isolate); | 2034 StoreIC ic(IC::EXTRA_CALL_FRAME, isolate); |
| 2035 Handle<Object> receiver = args.at<Object>(0); | 2035 Handle<Object> receiver = args.at<Object>(0); |
| 2036 Handle<String> key = args.at<String>(1); | 2036 Handle<String> key = args.at<String>(1); |
| 2037 ic.UpdateState(receiver, key); | 2037 ic.UpdateState(receiver, key); |
| 2038 Handle<Object> result; | 2038 Handle<Object> result; |
| 2039 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 2039 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 2040 isolate, | 2040 isolate, |
| 2041 result, | 2041 result, |
| 2042 ic.Store(receiver, key, args.at<Object>(2))); | 2042 ic.Store(receiver, key, args.at<Object>(2))); |
| 2043 return *result; | 2043 return *result; |
| 2044 } | 2044 } |
| 2045 | 2045 |
| 2046 | 2046 |
| 2047 RUNTIME_FUNCTION(StoreIC_ArrayLength) { | 2047 RUNTIME_FUNCTION(StoreIC_ArrayLength) { |
| 2048 Logger::TimerEventScope timer( | 2048 Logger::ExternalTimerEventScope timer( |
| 2049 isolate, Logger::TimerEventScope::v8_ic_miss); | 2049 isolate, Logger::TimerEventScope::v8_ic_miss); |
| 2050 HandleScope scope(isolate); | 2050 HandleScope scope(isolate); |
| 2051 | 2051 |
| 2052 ASSERT(args.length() == 2); | 2052 ASSERT(args.length() == 2); |
| 2053 Handle<JSArray> receiver = args.at<JSArray>(0); | 2053 Handle<JSArray> receiver = args.at<JSArray>(0); |
| 2054 Handle<Object> len = args.at<Object>(1); | 2054 Handle<Object> len = args.at<Object>(1); |
| 2055 | 2055 |
| 2056 // The generated code should filter out non-Smis before we get here. | 2056 // The generated code should filter out non-Smis before we get here. |
| 2057 ASSERT(len->IsSmi()); | 2057 ASSERT(len->IsSmi()); |
| 2058 | 2058 |
| 2059 #ifdef DEBUG | 2059 #ifdef DEBUG |
| 2060 // The length property has to be a writable callback property. | 2060 // The length property has to be a writable callback property. |
| 2061 LookupResult debug_lookup(isolate); | 2061 LookupResult debug_lookup(isolate); |
| 2062 receiver->LookupOwn(isolate->factory()->length_string(), &debug_lookup); | 2062 receiver->LookupOwn(isolate->factory()->length_string(), &debug_lookup); |
| 2063 ASSERT(debug_lookup.IsPropertyCallbacks() && !debug_lookup.IsReadOnly()); | 2063 ASSERT(debug_lookup.IsPropertyCallbacks() && !debug_lookup.IsReadOnly()); |
| 2064 #endif | 2064 #endif |
| 2065 | 2065 |
| 2066 RETURN_FAILURE_ON_EXCEPTION( | 2066 RETURN_FAILURE_ON_EXCEPTION( |
| 2067 isolate, JSArray::SetElementsLength(receiver, len)); | 2067 isolate, JSArray::SetElementsLength(receiver, len)); |
| 2068 return *len; | 2068 return *len; |
| 2069 } | 2069 } |
| 2070 | 2070 |
| 2071 | 2071 |
| 2072 // Extend storage is called in a store inline cache when | 2072 // Extend storage is called in a store inline cache when |
| 2073 // it is necessary to extend the properties array of a | 2073 // it is necessary to extend the properties array of a |
| 2074 // JSObject. | 2074 // JSObject. |
| 2075 RUNTIME_FUNCTION(SharedStoreIC_ExtendStorage) { | 2075 RUNTIME_FUNCTION(SharedStoreIC_ExtendStorage) { |
| 2076 Logger::TimerEventScope timer( | 2076 Logger::ExternalTimerEventScope timer( |
| 2077 isolate, Logger::TimerEventScope::v8_ic_miss); | 2077 isolate, Logger::TimerEventScope::v8_ic_miss); |
| 2078 HandleScope shs(isolate); | 2078 HandleScope shs(isolate); |
| 2079 ASSERT(args.length() == 3); | 2079 ASSERT(args.length() == 3); |
| 2080 | 2080 |
| 2081 // Convert the parameters | 2081 // Convert the parameters |
| 2082 Handle<JSObject> object = args.at<JSObject>(0); | 2082 Handle<JSObject> object = args.at<JSObject>(0); |
| 2083 Handle<Map> transition = args.at<Map>(1); | 2083 Handle<Map> transition = args.at<Map>(1); |
| 2084 Handle<Object> value = args.at<Object>(2); | 2084 Handle<Object> value = args.at<Object>(2); |
| 2085 | 2085 |
| 2086 // Check the object has run out out property space. | 2086 // Check the object has run out out property space. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 2108 object->set_properties(*new_storage); | 2108 object->set_properties(*new_storage); |
| 2109 object->set_map(*transition); | 2109 object->set_map(*transition); |
| 2110 | 2110 |
| 2111 // Return the stored value. | 2111 // Return the stored value. |
| 2112 return *value; | 2112 return *value; |
| 2113 } | 2113 } |
| 2114 | 2114 |
| 2115 | 2115 |
| 2116 // Used from ic-<arch>.cc. | 2116 // Used from ic-<arch>.cc. |
| 2117 RUNTIME_FUNCTION(KeyedStoreIC_Miss) { | 2117 RUNTIME_FUNCTION(KeyedStoreIC_Miss) { |
| 2118 Logger::TimerEventScope timer( | 2118 Logger::ExternalTimerEventScope timer( |
| 2119 isolate, Logger::TimerEventScope::v8_ic_miss); | 2119 isolate, Logger::TimerEventScope::v8_ic_miss); |
| 2120 HandleScope scope(isolate); | 2120 HandleScope scope(isolate); |
| 2121 ASSERT(args.length() == 3); | 2121 ASSERT(args.length() == 3); |
| 2122 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate); | 2122 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate); |
| 2123 Handle<Object> receiver = args.at<Object>(0); | 2123 Handle<Object> receiver = args.at<Object>(0); |
| 2124 Handle<Object> key = args.at<Object>(1); | 2124 Handle<Object> key = args.at<Object>(1); |
| 2125 ic.UpdateState(receiver, key); | 2125 ic.UpdateState(receiver, key); |
| 2126 Handle<Object> result; | 2126 Handle<Object> result; |
| 2127 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 2127 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 2128 isolate, | 2128 isolate, |
| 2129 result, | 2129 result, |
| 2130 ic.Store(receiver, key, args.at<Object>(2))); | 2130 ic.Store(receiver, key, args.at<Object>(2))); |
| 2131 return *result; | 2131 return *result; |
| 2132 } | 2132 } |
| 2133 | 2133 |
| 2134 | 2134 |
| 2135 RUNTIME_FUNCTION(KeyedStoreIC_MissFromStubFailure) { | 2135 RUNTIME_FUNCTION(KeyedStoreIC_MissFromStubFailure) { |
| 2136 Logger::TimerEventScope timer( | 2136 Logger::ExternalTimerEventScope timer( |
| 2137 isolate, Logger::TimerEventScope::v8_ic_miss); | 2137 isolate, Logger::TimerEventScope::v8_ic_miss); |
| 2138 HandleScope scope(isolate); | 2138 HandleScope scope(isolate); |
| 2139 ASSERT(args.length() == 3); | 2139 ASSERT(args.length() == 3); |
| 2140 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate); | 2140 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate); |
| 2141 Handle<Object> receiver = args.at<Object>(0); | 2141 Handle<Object> receiver = args.at<Object>(0); |
| 2142 Handle<Object> key = args.at<Object>(1); | 2142 Handle<Object> key = args.at<Object>(1); |
| 2143 ic.UpdateState(receiver, key); | 2143 ic.UpdateState(receiver, key); |
| 2144 Handle<Object> result; | 2144 Handle<Object> result; |
| 2145 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 2145 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 2146 isolate, | 2146 isolate, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2178 Handle<Object> result; | 2178 Handle<Object> result; |
| 2179 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 2179 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 2180 isolate, result, | 2180 isolate, result, |
| 2181 Runtime::SetObjectProperty( | 2181 Runtime::SetObjectProperty( |
| 2182 isolate, object, key, value, NONE, strict_mode)); | 2182 isolate, object, key, value, NONE, strict_mode)); |
| 2183 return *result; | 2183 return *result; |
| 2184 } | 2184 } |
| 2185 | 2185 |
| 2186 | 2186 |
| 2187 RUNTIME_FUNCTION(ElementsTransitionAndStoreIC_Miss) { | 2187 RUNTIME_FUNCTION(ElementsTransitionAndStoreIC_Miss) { |
| 2188 Logger::TimerEventScope timer( | 2188 Logger::ExternalTimerEventScope timer( |
| 2189 isolate, Logger::TimerEventScope::v8_ic_miss); | 2189 isolate, Logger::TimerEventScope::v8_ic_miss); |
| 2190 HandleScope scope(isolate); | 2190 HandleScope scope(isolate); |
| 2191 ASSERT(args.length() == 4); | 2191 ASSERT(args.length() == 4); |
| 2192 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate); | 2192 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate); |
| 2193 Handle<Object> value = args.at<Object>(0); | 2193 Handle<Object> value = args.at<Object>(0); |
| 2194 Handle<Map> map = args.at<Map>(1); | 2194 Handle<Map> map = args.at<Map>(1); |
| 2195 Handle<Object> key = args.at<Object>(2); | 2195 Handle<Object> key = args.at<Object>(2); |
| 2196 Handle<Object> object = args.at<Object>(3); | 2196 Handle<Object> object = args.at<Object>(3); |
| 2197 StrictMode strict_mode = ic.strict_mode(); | 2197 StrictMode strict_mode = ic.strict_mode(); |
| 2198 if (object->IsJSObject()) { | 2198 if (object->IsJSObject()) { |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2689 PatchInlinedSmiCode(address(), ENABLE_INLINED_SMI_CHECK); | 2689 PatchInlinedSmiCode(address(), ENABLE_INLINED_SMI_CHECK); |
| 2690 } else if (old_state.UseInlinedSmiCode() && !state.UseInlinedSmiCode()) { | 2690 } else if (old_state.UseInlinedSmiCode() && !state.UseInlinedSmiCode()) { |
| 2691 PatchInlinedSmiCode(address(), DISABLE_INLINED_SMI_CHECK); | 2691 PatchInlinedSmiCode(address(), DISABLE_INLINED_SMI_CHECK); |
| 2692 } | 2692 } |
| 2693 | 2693 |
| 2694 return result; | 2694 return result; |
| 2695 } | 2695 } |
| 2696 | 2696 |
| 2697 | 2697 |
| 2698 RUNTIME_FUNCTION(BinaryOpIC_Miss) { | 2698 RUNTIME_FUNCTION(BinaryOpIC_Miss) { |
| 2699 Logger::TimerEventScope timer( | 2699 Logger::ExternalTimerEventScope timer( |
| 2700 isolate, Logger::TimerEventScope::v8_ic_miss); | 2700 isolate, Logger::TimerEventScope::v8_ic_miss); |
| 2701 HandleScope scope(isolate); | 2701 HandleScope scope(isolate); |
| 2702 ASSERT_EQ(2, args.length()); | 2702 ASSERT_EQ(2, args.length()); |
| 2703 Handle<Object> left = args.at<Object>(BinaryOpICStub::kLeft); | 2703 Handle<Object> left = args.at<Object>(BinaryOpICStub::kLeft); |
| 2704 Handle<Object> right = args.at<Object>(BinaryOpICStub::kRight); | 2704 Handle<Object> right = args.at<Object>(BinaryOpICStub::kRight); |
| 2705 BinaryOpIC ic(isolate); | 2705 BinaryOpIC ic(isolate); |
| 2706 Handle<Object> result; | 2706 Handle<Object> result; |
| 2707 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 2707 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 2708 isolate, | 2708 isolate, |
| 2709 result, | 2709 result, |
| 2710 ic.Transition(Handle<AllocationSite>::null(), left, right)); | 2710 ic.Transition(Handle<AllocationSite>::null(), left, right)); |
| 2711 return *result; | 2711 return *result; |
| 2712 } | 2712 } |
| 2713 | 2713 |
| 2714 | 2714 |
| 2715 RUNTIME_FUNCTION(BinaryOpIC_MissWithAllocationSite) { | 2715 RUNTIME_FUNCTION(BinaryOpIC_MissWithAllocationSite) { |
| 2716 Logger::TimerEventScope timer( | 2716 Logger::ExternalTimerEventScope timer( |
| 2717 isolate, Logger::TimerEventScope::v8_ic_miss); | 2717 isolate, Logger::TimerEventScope::v8_ic_miss); |
| 2718 HandleScope scope(isolate); | 2718 HandleScope scope(isolate); |
| 2719 ASSERT_EQ(3, args.length()); | 2719 ASSERT_EQ(3, args.length()); |
| 2720 Handle<AllocationSite> allocation_site = args.at<AllocationSite>( | 2720 Handle<AllocationSite> allocation_site = args.at<AllocationSite>( |
| 2721 BinaryOpWithAllocationSiteStub::kAllocationSite); | 2721 BinaryOpWithAllocationSiteStub::kAllocationSite); |
| 2722 Handle<Object> left = args.at<Object>( | 2722 Handle<Object> left = args.at<Object>( |
| 2723 BinaryOpWithAllocationSiteStub::kLeft); | 2723 BinaryOpWithAllocationSiteStub::kLeft); |
| 2724 Handle<Object> right = args.at<Object>( | 2724 Handle<Object> right = args.at<Object>( |
| 2725 BinaryOpWithAllocationSiteStub::kRight); | 2725 BinaryOpWithAllocationSiteStub::kRight); |
| 2726 BinaryOpIC ic(isolate); | 2726 BinaryOpIC ic(isolate); |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2941 if (previous_state == UNINITIALIZED) { | 2941 if (previous_state == UNINITIALIZED) { |
| 2942 PatchInlinedSmiCode(address(), ENABLE_INLINED_SMI_CHECK); | 2942 PatchInlinedSmiCode(address(), ENABLE_INLINED_SMI_CHECK); |
| 2943 } | 2943 } |
| 2944 | 2944 |
| 2945 return *new_target; | 2945 return *new_target; |
| 2946 } | 2946 } |
| 2947 | 2947 |
| 2948 | 2948 |
| 2949 // Used from ICCompareStub::GenerateMiss in code-stubs-<arch>.cc. | 2949 // Used from ICCompareStub::GenerateMiss in code-stubs-<arch>.cc. |
| 2950 RUNTIME_FUNCTION(CompareIC_Miss) { | 2950 RUNTIME_FUNCTION(CompareIC_Miss) { |
| 2951 Logger::TimerEventScope timer( | 2951 Logger::ExternalTimerEventScope timer( |
| 2952 isolate, Logger::TimerEventScope::v8_ic_miss); | 2952 isolate, Logger::TimerEventScope::v8_ic_miss); |
| 2953 HandleScope scope(isolate); | 2953 HandleScope scope(isolate); |
| 2954 ASSERT(args.length() == 3); | 2954 ASSERT(args.length() == 3); |
| 2955 CompareIC ic(isolate, static_cast<Token::Value>(args.smi_at(2))); | 2955 CompareIC ic(isolate, static_cast<Token::Value>(args.smi_at(2))); |
| 2956 return ic.UpdateCaches(args.at<Object>(0), args.at<Object>(1)); | 2956 return ic.UpdateCaches(args.at<Object>(0), args.at<Object>(1)); |
| 2957 } | 2957 } |
| 2958 | 2958 |
| 2959 | 2959 |
| 2960 void CompareNilIC::Clear(Address address, | 2960 void CompareNilIC::Clear(Address address, |
| 2961 Code* target, | 2961 Code* target, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3007 code = isolate()->stub_cache()->ComputeCompareNil(monomorphic_map, &stub); | 3007 code = isolate()->stub_cache()->ComputeCompareNil(monomorphic_map, &stub); |
| 3008 } else { | 3008 } else { |
| 3009 code = stub.GetCode(); | 3009 code = stub.GetCode(); |
| 3010 } | 3010 } |
| 3011 set_target(*code); | 3011 set_target(*code); |
| 3012 return DoCompareNilSlow(isolate(), nil, object); | 3012 return DoCompareNilSlow(isolate(), nil, object); |
| 3013 } | 3013 } |
| 3014 | 3014 |
| 3015 | 3015 |
| 3016 RUNTIME_FUNCTION(CompareNilIC_Miss) { | 3016 RUNTIME_FUNCTION(CompareNilIC_Miss) { |
| 3017 Logger::TimerEventScope timer( | 3017 Logger::ExternalTimerEventScope timer( |
| 3018 isolate, Logger::TimerEventScope::v8_ic_miss); | 3018 isolate, Logger::TimerEventScope::v8_ic_miss); |
| 3019 HandleScope scope(isolate); | 3019 HandleScope scope(isolate); |
| 3020 Handle<Object> object = args.at<Object>(0); | 3020 Handle<Object> object = args.at<Object>(0); |
| 3021 CompareNilIC ic(isolate); | 3021 CompareNilIC ic(isolate); |
| 3022 return *ic.CompareNil(object); | 3022 return *ic.CompareNil(object); |
| 3023 } | 3023 } |
| 3024 | 3024 |
| 3025 | 3025 |
| 3026 RUNTIME_FUNCTION(Unreachable) { | 3026 RUNTIME_FUNCTION(Unreachable) { |
| 3027 UNREACHABLE(); | 3027 UNREACHABLE(); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3074 Handle<Object> ToBooleanIC::ToBoolean(Handle<Object> object) { | 3074 Handle<Object> ToBooleanIC::ToBoolean(Handle<Object> object) { |
| 3075 ToBooleanStub stub(isolate(), target()->extra_ic_state()); | 3075 ToBooleanStub stub(isolate(), target()->extra_ic_state()); |
| 3076 bool to_boolean_value = stub.UpdateStatus(object); | 3076 bool to_boolean_value = stub.UpdateStatus(object); |
| 3077 Handle<Code> code = stub.GetCode(); | 3077 Handle<Code> code = stub.GetCode(); |
| 3078 set_target(*code); | 3078 set_target(*code); |
| 3079 return handle(Smi::FromInt(to_boolean_value ? 1 : 0), isolate()); | 3079 return handle(Smi::FromInt(to_boolean_value ? 1 : 0), isolate()); |
| 3080 } | 3080 } |
| 3081 | 3081 |
| 3082 | 3082 |
| 3083 RUNTIME_FUNCTION(ToBooleanIC_Miss) { | 3083 RUNTIME_FUNCTION(ToBooleanIC_Miss) { |
| 3084 Logger::TimerEventScope timer( | 3084 Logger::ExternalTimerEventScope timer( |
| 3085 isolate, Logger::TimerEventScope::v8_ic_miss); | 3085 isolate, Logger::TimerEventScope::v8_ic_miss); |
| 3086 ASSERT(args.length() == 1); | 3086 ASSERT(args.length() == 1); |
| 3087 HandleScope scope(isolate); | 3087 HandleScope scope(isolate); |
| 3088 Handle<Object> object = args.at<Object>(0); | 3088 Handle<Object> object = args.at<Object>(0); |
| 3089 ToBooleanIC ic(isolate); | 3089 ToBooleanIC ic(isolate); |
| 3090 return *ic.ToBoolean(object); | 3090 return *ic.ToBoolean(object); |
| 3091 } | 3091 } |
| 3092 | 3092 |
| 3093 | 3093 |
| 3094 static const Address IC_utilities[] = { | 3094 static const Address IC_utilities[] = { |
| 3095 #define ADDR(name) FUNCTION_ADDR(name), | 3095 #define ADDR(name) FUNCTION_ADDR(name), |
| 3096 IC_UTIL_LIST(ADDR) | 3096 IC_UTIL_LIST(ADDR) |
| 3097 NULL | 3097 NULL |
| 3098 #undef ADDR | 3098 #undef ADDR |
| 3099 }; | 3099 }; |
| 3100 | 3100 |
| 3101 | 3101 |
| 3102 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 3102 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
| 3103 return IC_utilities[id]; | 3103 return IC_utilities[id]; |
| 3104 } | 3104 } |
| 3105 | 3105 |
| 3106 | 3106 |
| 3107 } } // namespace v8::internal | 3107 } } // namespace v8::internal |
| OLD | NEW |