Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1026)

Side by Side Diff: src/ic.cc

Issue 388783004: Do not expose all timer events to the API callback. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/full-codegen.cc ('k') | src/isolate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1936 matching lines...) Expand 10 before | Expand all | Expand 10 after
1947 1947
1948 #undef TRACE_IC 1948 #undef TRACE_IC
1949 1949
1950 1950
1951 // ---------------------------------------------------------------------------- 1951 // ----------------------------------------------------------------------------
1952 // Static IC stub generators. 1952 // Static IC stub generators.
1953 // 1953 //
1954 1954
1955 // Used from ic-<arch>.cc. 1955 // Used from ic-<arch>.cc.
1956 RUNTIME_FUNCTION(CallIC_Miss) { 1956 RUNTIME_FUNCTION(CallIC_Miss) {
1957 Logger::TimerEventScope timer( 1957 TimerEventScope<TimerEventIcMiss> timer(isolate);
1958 isolate, Logger::TimerEventScope::v8_ic_miss);
1959 HandleScope scope(isolate); 1958 HandleScope scope(isolate);
1960 ASSERT(args.length() == 4); 1959 ASSERT(args.length() == 4);
1961 CallIC ic(isolate); 1960 CallIC ic(isolate);
1962 Handle<Object> receiver = args.at<Object>(0); 1961 Handle<Object> receiver = args.at<Object>(0);
1963 Handle<Object> function = args.at<Object>(1); 1962 Handle<Object> function = args.at<Object>(1);
1964 Handle<FixedArray> vector = args.at<FixedArray>(2); 1963 Handle<FixedArray> vector = args.at<FixedArray>(2);
1965 Handle<Smi> slot = args.at<Smi>(3); 1964 Handle<Smi> slot = args.at<Smi>(3);
1966 ic.HandleMiss(receiver, function, vector, slot); 1965 ic.HandleMiss(receiver, function, vector, slot);
1967 return *function; 1966 return *function;
1968 } 1967 }
1969 1968
1970 1969
1971 RUNTIME_FUNCTION(CallIC_Customization_Miss) { 1970 RUNTIME_FUNCTION(CallIC_Customization_Miss) {
1972 Logger::TimerEventScope timer( 1971 TimerEventScope<TimerEventIcMiss> timer(isolate);
1973 isolate, Logger::TimerEventScope::v8_ic_miss);
1974 HandleScope scope(isolate); 1972 HandleScope scope(isolate);
1975 ASSERT(args.length() == 4); 1973 ASSERT(args.length() == 4);
1976 // A miss on a custom call ic always results in going megamorphic. 1974 // A miss on a custom call ic always results in going megamorphic.
1977 CallIC ic(isolate); 1975 CallIC ic(isolate);
1978 Handle<Object> function = args.at<Object>(1); 1976 Handle<Object> function = args.at<Object>(1);
1979 Handle<FixedArray> vector = args.at<FixedArray>(2); 1977 Handle<FixedArray> vector = args.at<FixedArray>(2);
1980 Handle<Smi> slot = args.at<Smi>(3); 1978 Handle<Smi> slot = args.at<Smi>(3);
1981 ic.PatchMegamorphic(vector, slot); 1979 ic.PatchMegamorphic(vector, slot);
1982 return *function; 1980 return *function;
1983 } 1981 }
1984 1982
1985 1983
1986 // Used from ic-<arch>.cc. 1984 // Used from ic-<arch>.cc.
1987 RUNTIME_FUNCTION(LoadIC_Miss) { 1985 RUNTIME_FUNCTION(LoadIC_Miss) {
1988 Logger::TimerEventScope timer( 1986 TimerEventScope<TimerEventIcMiss> timer(isolate);
1989 isolate, Logger::TimerEventScope::v8_ic_miss);
1990 HandleScope scope(isolate); 1987 HandleScope scope(isolate);
1991 ASSERT(args.length() == 2); 1988 ASSERT(args.length() == 2);
1992 LoadIC ic(IC::NO_EXTRA_FRAME, isolate); 1989 LoadIC ic(IC::NO_EXTRA_FRAME, isolate);
1993 Handle<Object> receiver = args.at<Object>(0); 1990 Handle<Object> receiver = args.at<Object>(0);
1994 Handle<String> key = args.at<String>(1); 1991 Handle<String> key = args.at<String>(1);
1995 ic.UpdateState(receiver, key); 1992 ic.UpdateState(receiver, key);
1996 Handle<Object> result; 1993 Handle<Object> result;
1997 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); 1994 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key));
1998 return *result; 1995 return *result;
1999 } 1996 }
2000 1997
2001 1998
2002 // Used from ic-<arch>.cc 1999 // Used from ic-<arch>.cc
2003 RUNTIME_FUNCTION(KeyedLoadIC_Miss) { 2000 RUNTIME_FUNCTION(KeyedLoadIC_Miss) {
2004 Logger::TimerEventScope timer( 2001 TimerEventScope<TimerEventIcMiss> timer(isolate);
2005 isolate, Logger::TimerEventScope::v8_ic_miss);
2006 HandleScope scope(isolate); 2002 HandleScope scope(isolate);
2007 ASSERT(args.length() == 2); 2003 ASSERT(args.length() == 2);
2008 KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate); 2004 KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate);
2009 Handle<Object> receiver = args.at<Object>(0); 2005 Handle<Object> receiver = args.at<Object>(0);
2010 Handle<Object> key = args.at<Object>(1); 2006 Handle<Object> key = args.at<Object>(1);
2011 ic.UpdateState(receiver, key); 2007 ic.UpdateState(receiver, key);
2012 Handle<Object> result; 2008 Handle<Object> result;
2013 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); 2009 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key));
2014 return *result; 2010 return *result;
2015 } 2011 }
2016 2012
2017 2013
2018 RUNTIME_FUNCTION(KeyedLoadIC_MissFromStubFailure) { 2014 RUNTIME_FUNCTION(KeyedLoadIC_MissFromStubFailure) {
2019 Logger::TimerEventScope timer( 2015 TimerEventScope<TimerEventIcMiss> timer(isolate);
2020 isolate, Logger::TimerEventScope::v8_ic_miss);
2021 HandleScope scope(isolate); 2016 HandleScope scope(isolate);
2022 ASSERT(args.length() == 2); 2017 ASSERT(args.length() == 2);
2023 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate); 2018 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate);
2024 Handle<Object> receiver = args.at<Object>(0); 2019 Handle<Object> receiver = args.at<Object>(0);
2025 Handle<Object> key = args.at<Object>(1); 2020 Handle<Object> key = args.at<Object>(1);
2026 ic.UpdateState(receiver, key); 2021 ic.UpdateState(receiver, key);
2027 Handle<Object> result; 2022 Handle<Object> result;
2028 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); 2023 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key));
2029 return *result; 2024 return *result;
2030 } 2025 }
2031 2026
2032 2027
2033 // Used from ic-<arch>.cc. 2028 // Used from ic-<arch>.cc.
2034 RUNTIME_FUNCTION(StoreIC_Miss) { 2029 RUNTIME_FUNCTION(StoreIC_Miss) {
2035 Logger::TimerEventScope timer( 2030 TimerEventScope<TimerEventIcMiss> timer(isolate);
2036 isolate, Logger::TimerEventScope::v8_ic_miss);
2037 HandleScope scope(isolate); 2031 HandleScope scope(isolate);
2038 ASSERT(args.length() == 3); 2032 ASSERT(args.length() == 3);
2039 StoreIC ic(IC::NO_EXTRA_FRAME, isolate); 2033 StoreIC ic(IC::NO_EXTRA_FRAME, isolate);
2040 Handle<Object> receiver = args.at<Object>(0); 2034 Handle<Object> receiver = args.at<Object>(0);
2041 Handle<String> key = args.at<String>(1); 2035 Handle<String> key = args.at<String>(1);
2042 ic.UpdateState(receiver, key); 2036 ic.UpdateState(receiver, key);
2043 Handle<Object> result; 2037 Handle<Object> result;
2044 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 2038 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
2045 isolate, 2039 isolate,
2046 result, 2040 result,
2047 ic.Store(receiver, key, args.at<Object>(2))); 2041 ic.Store(receiver, key, args.at<Object>(2)));
2048 return *result; 2042 return *result;
2049 } 2043 }
2050 2044
2051 2045
2052 RUNTIME_FUNCTION(StoreIC_MissFromStubFailure) { 2046 RUNTIME_FUNCTION(StoreIC_MissFromStubFailure) {
2053 Logger::TimerEventScope timer( 2047 TimerEventScope<TimerEventIcMiss> timer(isolate);
2054 isolate, Logger::TimerEventScope::v8_ic_miss);
2055 HandleScope scope(isolate); 2048 HandleScope scope(isolate);
2056 ASSERT(args.length() == 3); 2049 ASSERT(args.length() == 3);
2057 StoreIC ic(IC::EXTRA_CALL_FRAME, isolate); 2050 StoreIC ic(IC::EXTRA_CALL_FRAME, isolate);
2058 Handle<Object> receiver = args.at<Object>(0); 2051 Handle<Object> receiver = args.at<Object>(0);
2059 Handle<String> key = args.at<String>(1); 2052 Handle<String> key = args.at<String>(1);
2060 ic.UpdateState(receiver, key); 2053 ic.UpdateState(receiver, key);
2061 Handle<Object> result; 2054 Handle<Object> result;
2062 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 2055 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
2063 isolate, 2056 isolate,
2064 result, 2057 result,
2065 ic.Store(receiver, key, args.at<Object>(2))); 2058 ic.Store(receiver, key, args.at<Object>(2)));
2066 return *result; 2059 return *result;
2067 } 2060 }
2068 2061
2069 2062
2070 RUNTIME_FUNCTION(StoreIC_ArrayLength) { 2063 RUNTIME_FUNCTION(StoreIC_ArrayLength) {
2071 Logger::TimerEventScope timer( 2064 TimerEventScope<TimerEventIcMiss> timer(isolate);
2072 isolate, Logger::TimerEventScope::v8_ic_miss);
2073 HandleScope scope(isolate); 2065 HandleScope scope(isolate);
2074 2066
2075 ASSERT(args.length() == 2); 2067 ASSERT(args.length() == 2);
2076 Handle<JSArray> receiver = args.at<JSArray>(0); 2068 Handle<JSArray> receiver = args.at<JSArray>(0);
2077 Handle<Object> len = args.at<Object>(1); 2069 Handle<Object> len = args.at<Object>(1);
2078 2070
2079 // The generated code should filter out non-Smis before we get here. 2071 // The generated code should filter out non-Smis before we get here.
2080 ASSERT(len->IsSmi()); 2072 ASSERT(len->IsSmi());
2081 2073
2082 #ifdef DEBUG 2074 #ifdef DEBUG
2083 // The length property has to be a writable callback property. 2075 // The length property has to be a writable callback property.
2084 LookupResult debug_lookup(isolate); 2076 LookupResult debug_lookup(isolate);
2085 receiver->LookupOwn(isolate->factory()->length_string(), &debug_lookup); 2077 receiver->LookupOwn(isolate->factory()->length_string(), &debug_lookup);
2086 ASSERT(debug_lookup.IsPropertyCallbacks() && !debug_lookup.IsReadOnly()); 2078 ASSERT(debug_lookup.IsPropertyCallbacks() && !debug_lookup.IsReadOnly());
2087 #endif 2079 #endif
2088 2080
2089 RETURN_FAILURE_ON_EXCEPTION( 2081 RETURN_FAILURE_ON_EXCEPTION(
2090 isolate, JSArray::SetElementsLength(receiver, len)); 2082 isolate, JSArray::SetElementsLength(receiver, len));
2091 return *len; 2083 return *len;
2092 } 2084 }
2093 2085
2094 2086
2095 // Extend storage is called in a store inline cache when 2087 // Extend storage is called in a store inline cache when
2096 // it is necessary to extend the properties array of a 2088 // it is necessary to extend the properties array of a
2097 // JSObject. 2089 // JSObject.
2098 RUNTIME_FUNCTION(SharedStoreIC_ExtendStorage) { 2090 RUNTIME_FUNCTION(SharedStoreIC_ExtendStorage) {
2099 Logger::TimerEventScope timer( 2091 TimerEventScope<TimerEventIcMiss> timer(isolate);
2100 isolate, Logger::TimerEventScope::v8_ic_miss);
2101 HandleScope shs(isolate); 2092 HandleScope shs(isolate);
2102 ASSERT(args.length() == 3); 2093 ASSERT(args.length() == 3);
2103 2094
2104 // Convert the parameters 2095 // Convert the parameters
2105 Handle<JSObject> object = args.at<JSObject>(0); 2096 Handle<JSObject> object = args.at<JSObject>(0);
2106 Handle<Map> transition = args.at<Map>(1); 2097 Handle<Map> transition = args.at<Map>(1);
2107 Handle<Object> value = args.at<Object>(2); 2098 Handle<Object> value = args.at<Object>(2);
2108 2099
2109 // Check the object has run out out property space. 2100 // Check the object has run out out property space.
2110 ASSERT(object->HasFastProperties()); 2101 ASSERT(object->HasFastProperties());
2111 ASSERT(object->map()->unused_property_fields() == 0); 2102 ASSERT(object->map()->unused_property_fields() == 0);
2112 2103
2113 JSObject::MigrateToNewProperty(object, transition, value); 2104 JSObject::MigrateToNewProperty(object, transition, value);
2114 2105
2115 // Return the stored value. 2106 // Return the stored value.
2116 return *value; 2107 return *value;
2117 } 2108 }
2118 2109
2119 2110
2120 // Used from ic-<arch>.cc. 2111 // Used from ic-<arch>.cc.
2121 RUNTIME_FUNCTION(KeyedStoreIC_Miss) { 2112 RUNTIME_FUNCTION(KeyedStoreIC_Miss) {
2122 Logger::TimerEventScope timer( 2113 TimerEventScope<TimerEventIcMiss> timer(isolate);
2123 isolate, Logger::TimerEventScope::v8_ic_miss);
2124 HandleScope scope(isolate); 2114 HandleScope scope(isolate);
2125 ASSERT(args.length() == 3); 2115 ASSERT(args.length() == 3);
2126 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate); 2116 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate);
2127 Handle<Object> receiver = args.at<Object>(0); 2117 Handle<Object> receiver = args.at<Object>(0);
2128 Handle<Object> key = args.at<Object>(1); 2118 Handle<Object> key = args.at<Object>(1);
2129 ic.UpdateState(receiver, key); 2119 ic.UpdateState(receiver, key);
2130 Handle<Object> result; 2120 Handle<Object> result;
2131 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 2121 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
2132 isolate, 2122 isolate,
2133 result, 2123 result,
2134 ic.Store(receiver, key, args.at<Object>(2))); 2124 ic.Store(receiver, key, args.at<Object>(2)));
2135 return *result; 2125 return *result;
2136 } 2126 }
2137 2127
2138 2128
2139 RUNTIME_FUNCTION(KeyedStoreIC_MissFromStubFailure) { 2129 RUNTIME_FUNCTION(KeyedStoreIC_MissFromStubFailure) {
2140 Logger::TimerEventScope timer( 2130 TimerEventScope<TimerEventIcMiss> timer(isolate);
2141 isolate, Logger::TimerEventScope::v8_ic_miss);
2142 HandleScope scope(isolate); 2131 HandleScope scope(isolate);
2143 ASSERT(args.length() == 3); 2132 ASSERT(args.length() == 3);
2144 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate); 2133 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate);
2145 Handle<Object> receiver = args.at<Object>(0); 2134 Handle<Object> receiver = args.at<Object>(0);
2146 Handle<Object> key = args.at<Object>(1); 2135 Handle<Object> key = args.at<Object>(1);
2147 ic.UpdateState(receiver, key); 2136 ic.UpdateState(receiver, key);
2148 Handle<Object> result; 2137 Handle<Object> result;
2149 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 2138 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
2150 isolate, 2139 isolate,
2151 result, 2140 result,
(...skipping 30 matching lines...) Expand all
2182 Handle<Object> result; 2171 Handle<Object> result;
2183 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 2172 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
2184 isolate, result, 2173 isolate, result,
2185 Runtime::SetObjectProperty( 2174 Runtime::SetObjectProperty(
2186 isolate, object, key, value, strict_mode)); 2175 isolate, object, key, value, strict_mode));
2187 return *result; 2176 return *result;
2188 } 2177 }
2189 2178
2190 2179
2191 RUNTIME_FUNCTION(ElementsTransitionAndStoreIC_Miss) { 2180 RUNTIME_FUNCTION(ElementsTransitionAndStoreIC_Miss) {
2192 Logger::TimerEventScope timer( 2181 TimerEventScope<TimerEventIcMiss> timer(isolate);
2193 isolate, Logger::TimerEventScope::v8_ic_miss);
2194 HandleScope scope(isolate); 2182 HandleScope scope(isolate);
2195 ASSERT(args.length() == 4); 2183 ASSERT(args.length() == 4);
2196 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate); 2184 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate);
2197 Handle<Object> value = args.at<Object>(0); 2185 Handle<Object> value = args.at<Object>(0);
2198 Handle<Map> map = args.at<Map>(1); 2186 Handle<Map> map = args.at<Map>(1);
2199 Handle<Object> key = args.at<Object>(2); 2187 Handle<Object> key = args.at<Object>(2);
2200 Handle<Object> object = args.at<Object>(3); 2188 Handle<Object> object = args.at<Object>(3);
2201 StrictMode strict_mode = ic.strict_mode(); 2189 StrictMode strict_mode = ic.strict_mode();
2202 if (object->IsJSObject()) { 2190 if (object->IsJSObject()) {
2203 JSObject::TransitionElementsKind(Handle<JSObject>::cast(object), 2191 JSObject::TransitionElementsKind(Handle<JSObject>::cast(object),
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
2688 PatchInlinedSmiCode(address(), ENABLE_INLINED_SMI_CHECK); 2676 PatchInlinedSmiCode(address(), ENABLE_INLINED_SMI_CHECK);
2689 } else if (old_state.UseInlinedSmiCode() && !state.UseInlinedSmiCode()) { 2677 } else if (old_state.UseInlinedSmiCode() && !state.UseInlinedSmiCode()) {
2690 PatchInlinedSmiCode(address(), DISABLE_INLINED_SMI_CHECK); 2678 PatchInlinedSmiCode(address(), DISABLE_INLINED_SMI_CHECK);
2691 } 2679 }
2692 2680
2693 return result; 2681 return result;
2694 } 2682 }
2695 2683
2696 2684
2697 RUNTIME_FUNCTION(BinaryOpIC_Miss) { 2685 RUNTIME_FUNCTION(BinaryOpIC_Miss) {
2698 Logger::TimerEventScope timer( 2686 TimerEventScope<TimerEventIcMiss> timer(isolate);
2699 isolate, Logger::TimerEventScope::v8_ic_miss);
2700 HandleScope scope(isolate); 2687 HandleScope scope(isolate);
2701 ASSERT_EQ(2, args.length()); 2688 ASSERT_EQ(2, args.length());
2702 Handle<Object> left = args.at<Object>(BinaryOpICStub::kLeft); 2689 Handle<Object> left = args.at<Object>(BinaryOpICStub::kLeft);
2703 Handle<Object> right = args.at<Object>(BinaryOpICStub::kRight); 2690 Handle<Object> right = args.at<Object>(BinaryOpICStub::kRight);
2704 BinaryOpIC ic(isolate); 2691 BinaryOpIC ic(isolate);
2705 Handle<Object> result; 2692 Handle<Object> result;
2706 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 2693 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
2707 isolate, 2694 isolate,
2708 result, 2695 result,
2709 ic.Transition(Handle<AllocationSite>::null(), left, right)); 2696 ic.Transition(Handle<AllocationSite>::null(), left, right));
2710 return *result; 2697 return *result;
2711 } 2698 }
2712 2699
2713 2700
2714 RUNTIME_FUNCTION(BinaryOpIC_MissWithAllocationSite) { 2701 RUNTIME_FUNCTION(BinaryOpIC_MissWithAllocationSite) {
2715 Logger::TimerEventScope timer( 2702 TimerEventScope<TimerEventIcMiss> timer(isolate);
2716 isolate, Logger::TimerEventScope::v8_ic_miss);
2717 HandleScope scope(isolate); 2703 HandleScope scope(isolate);
2718 ASSERT_EQ(3, args.length()); 2704 ASSERT_EQ(3, args.length());
2719 Handle<AllocationSite> allocation_site = args.at<AllocationSite>( 2705 Handle<AllocationSite> allocation_site = args.at<AllocationSite>(
2720 BinaryOpWithAllocationSiteStub::kAllocationSite); 2706 BinaryOpWithAllocationSiteStub::kAllocationSite);
2721 Handle<Object> left = args.at<Object>( 2707 Handle<Object> left = args.at<Object>(
2722 BinaryOpWithAllocationSiteStub::kLeft); 2708 BinaryOpWithAllocationSiteStub::kLeft);
2723 Handle<Object> right = args.at<Object>( 2709 Handle<Object> right = args.at<Object>(
2724 BinaryOpWithAllocationSiteStub::kRight); 2710 BinaryOpWithAllocationSiteStub::kRight);
2725 BinaryOpIC ic(isolate); 2711 BinaryOpIC ic(isolate);
2726 Handle<Object> result; 2712 Handle<Object> result;
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
2940 if (previous_state == UNINITIALIZED) { 2926 if (previous_state == UNINITIALIZED) {
2941 PatchInlinedSmiCode(address(), ENABLE_INLINED_SMI_CHECK); 2927 PatchInlinedSmiCode(address(), ENABLE_INLINED_SMI_CHECK);
2942 } 2928 }
2943 2929
2944 return *new_target; 2930 return *new_target;
2945 } 2931 }
2946 2932
2947 2933
2948 // Used from ICCompareStub::GenerateMiss in code-stubs-<arch>.cc. 2934 // Used from ICCompareStub::GenerateMiss in code-stubs-<arch>.cc.
2949 RUNTIME_FUNCTION(CompareIC_Miss) { 2935 RUNTIME_FUNCTION(CompareIC_Miss) {
2950 Logger::TimerEventScope timer( 2936 TimerEventScope<TimerEventIcMiss> timer(isolate);
2951 isolate, Logger::TimerEventScope::v8_ic_miss);
2952 HandleScope scope(isolate); 2937 HandleScope scope(isolate);
2953 ASSERT(args.length() == 3); 2938 ASSERT(args.length() == 3);
2954 CompareIC ic(isolate, static_cast<Token::Value>(args.smi_at(2))); 2939 CompareIC ic(isolate, static_cast<Token::Value>(args.smi_at(2)));
2955 return ic.UpdateCaches(args.at<Object>(0), args.at<Object>(1)); 2940 return ic.UpdateCaches(args.at<Object>(0), args.at<Object>(1));
2956 } 2941 }
2957 2942
2958 2943
2959 void CompareNilIC::Clear(Address address, 2944 void CompareNilIC::Clear(Address address,
2960 Code* target, 2945 Code* target,
2961 ConstantPoolArray* constant_pool) { 2946 ConstantPoolArray* constant_pool) {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
3006 code = isolate()->stub_cache()->ComputeCompareNil(monomorphic_map, &stub); 2991 code = isolate()->stub_cache()->ComputeCompareNil(monomorphic_map, &stub);
3007 } else { 2992 } else {
3008 code = stub.GetCode(); 2993 code = stub.GetCode();
3009 } 2994 }
3010 set_target(*code); 2995 set_target(*code);
3011 return DoCompareNilSlow(isolate(), nil, object); 2996 return DoCompareNilSlow(isolate(), nil, object);
3012 } 2997 }
3013 2998
3014 2999
3015 RUNTIME_FUNCTION(CompareNilIC_Miss) { 3000 RUNTIME_FUNCTION(CompareNilIC_Miss) {
3016 Logger::TimerEventScope timer( 3001 TimerEventScope<TimerEventIcMiss> timer(isolate);
3017 isolate, Logger::TimerEventScope::v8_ic_miss);
3018 HandleScope scope(isolate); 3002 HandleScope scope(isolate);
3019 Handle<Object> object = args.at<Object>(0); 3003 Handle<Object> object = args.at<Object>(0);
3020 CompareNilIC ic(isolate); 3004 CompareNilIC ic(isolate);
3021 return *ic.CompareNil(object); 3005 return *ic.CompareNil(object);
3022 } 3006 }
3023 3007
3024 3008
3025 RUNTIME_FUNCTION(Unreachable) { 3009 RUNTIME_FUNCTION(Unreachable) {
3026 UNREACHABLE(); 3010 UNREACHABLE();
3027 CHECK(false); 3011 CHECK(false);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
3073 Handle<Object> ToBooleanIC::ToBoolean(Handle<Object> object) { 3057 Handle<Object> ToBooleanIC::ToBoolean(Handle<Object> object) {
3074 ToBooleanStub stub(isolate(), target()->extra_ic_state()); 3058 ToBooleanStub stub(isolate(), target()->extra_ic_state());
3075 bool to_boolean_value = stub.UpdateStatus(object); 3059 bool to_boolean_value = stub.UpdateStatus(object);
3076 Handle<Code> code = stub.GetCode(); 3060 Handle<Code> code = stub.GetCode();
3077 set_target(*code); 3061 set_target(*code);
3078 return handle(Smi::FromInt(to_boolean_value ? 1 : 0), isolate()); 3062 return handle(Smi::FromInt(to_boolean_value ? 1 : 0), isolate());
3079 } 3063 }
3080 3064
3081 3065
3082 RUNTIME_FUNCTION(ToBooleanIC_Miss) { 3066 RUNTIME_FUNCTION(ToBooleanIC_Miss) {
3083 Logger::TimerEventScope timer( 3067 TimerEventScope<TimerEventIcMiss> timer(isolate);
3084 isolate, Logger::TimerEventScope::v8_ic_miss);
3085 ASSERT(args.length() == 1); 3068 ASSERT(args.length() == 1);
3086 HandleScope scope(isolate); 3069 HandleScope scope(isolate);
3087 Handle<Object> object = args.at<Object>(0); 3070 Handle<Object> object = args.at<Object>(0);
3088 ToBooleanIC ic(isolate); 3071 ToBooleanIC ic(isolate);
3089 return *ic.ToBoolean(object); 3072 return *ic.ToBoolean(object);
3090 } 3073 }
3091 3074
3092 3075
3093 static const Address IC_utilities[] = { 3076 static const Address IC_utilities[] = {
3094 #define ADDR(name) FUNCTION_ADDR(name), 3077 #define ADDR(name) FUNCTION_ADDR(name),
3095 IC_UTIL_LIST(ADDR) 3078 IC_UTIL_LIST(ADDR)
3096 NULL 3079 NULL
3097 #undef ADDR 3080 #undef ADDR
3098 }; 3081 };
3099 3082
3100 3083
3101 Address IC::AddressFromUtilityId(IC::UtilityId id) { 3084 Address IC::AddressFromUtilityId(IC::UtilityId id) {
3102 return IC_utilities[id]; 3085 return IC_utilities[id];
3103 } 3086 }
3104 3087
3105 3088
3106 } } // namespace v8::internal 3089 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/full-codegen.cc ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698