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

Side by Side Diff: src/ic.cc

Issue 240053010: Return Object* instead of MaybeObject* from runtime calls. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: cmpp Created 6 years, 8 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/ic.h ('k') | src/isolate.h » ('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 // 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 1813 matching lines...) Expand 10 before | Expand all | Expand 10 after
1824 1824
1825 #undef TRACE_IC 1825 #undef TRACE_IC
1826 1826
1827 1827
1828 // ---------------------------------------------------------------------------- 1828 // ----------------------------------------------------------------------------
1829 // Static IC stub generators. 1829 // Static IC stub generators.
1830 // 1830 //
1831 1831
1832 // Used from ic-<arch>.cc. 1832 // Used from ic-<arch>.cc.
1833 // Used from ic-<arch>.cc. 1833 // Used from ic-<arch>.cc.
1834 RUNTIME_FUNCTION(MaybeObject*, LoadIC_Miss) { 1834 RUNTIME_FUNCTION(LoadIC_Miss) {
1835 HandleScope scope(isolate); 1835 HandleScope scope(isolate);
1836 ASSERT(args.length() == 2); 1836 ASSERT(args.length() == 2);
1837 LoadIC ic(IC::NO_EXTRA_FRAME, isolate); 1837 LoadIC ic(IC::NO_EXTRA_FRAME, isolate);
1838 Handle<Object> receiver = args.at<Object>(0); 1838 Handle<Object> receiver = args.at<Object>(0);
1839 Handle<String> key = args.at<String>(1); 1839 Handle<String> key = args.at<String>(1);
1840 ic.UpdateState(receiver, key); 1840 ic.UpdateState(receiver, key);
1841 Handle<Object> result; 1841 Handle<Object> result;
1842 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); 1842 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key));
1843 return *result; 1843 return *result;
1844 } 1844 }
1845 1845
1846 1846
1847 // Used from ic-<arch>.cc 1847 // Used from ic-<arch>.cc
1848 RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_Miss) { 1848 RUNTIME_FUNCTION(KeyedLoadIC_Miss) {
1849 HandleScope scope(isolate); 1849 HandleScope scope(isolate);
1850 ASSERT(args.length() == 2); 1850 ASSERT(args.length() == 2);
1851 KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate); 1851 KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate);
1852 Handle<Object> receiver = args.at<Object>(0); 1852 Handle<Object> receiver = args.at<Object>(0);
1853 Handle<Object> key = args.at<Object>(1); 1853 Handle<Object> key = args.at<Object>(1);
1854 ic.UpdateState(receiver, key); 1854 ic.UpdateState(receiver, key);
1855 Handle<Object> result; 1855 Handle<Object> result;
1856 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); 1856 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key));
1857 return *result; 1857 return *result;
1858 } 1858 }
1859 1859
1860 1860
1861 RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure) { 1861 RUNTIME_FUNCTION(KeyedLoadIC_MissFromStubFailure) {
1862 HandleScope scope(isolate); 1862 HandleScope scope(isolate);
1863 ASSERT(args.length() == 2); 1863 ASSERT(args.length() == 2);
1864 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate); 1864 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate);
1865 Handle<Object> receiver = args.at<Object>(0); 1865 Handle<Object> receiver = args.at<Object>(0);
1866 Handle<Object> key = args.at<Object>(1); 1866 Handle<Object> key = args.at<Object>(1);
1867 ic.UpdateState(receiver, key); 1867 ic.UpdateState(receiver, key);
1868 Handle<Object> result; 1868 Handle<Object> result;
1869 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); 1869 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key));
1870 return *result; 1870 return *result;
1871 } 1871 }
1872 1872
1873 1873
1874 // Used from ic-<arch>.cc. 1874 // Used from ic-<arch>.cc.
1875 RUNTIME_FUNCTION(MaybeObject*, StoreIC_Miss) { 1875 RUNTIME_FUNCTION(StoreIC_Miss) {
1876 HandleScope scope(isolate); 1876 HandleScope scope(isolate);
1877 ASSERT(args.length() == 3); 1877 ASSERT(args.length() == 3);
1878 StoreIC ic(IC::NO_EXTRA_FRAME, isolate); 1878 StoreIC ic(IC::NO_EXTRA_FRAME, isolate);
1879 Handle<Object> receiver = args.at<Object>(0); 1879 Handle<Object> receiver = args.at<Object>(0);
1880 Handle<String> key = args.at<String>(1); 1880 Handle<String> key = args.at<String>(1);
1881 ic.UpdateState(receiver, key); 1881 ic.UpdateState(receiver, key);
1882 Handle<Object> result; 1882 Handle<Object> result;
1883 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 1883 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
1884 isolate, 1884 isolate,
1885 result, 1885 result,
1886 ic.Store(receiver, key, args.at<Object>(2))); 1886 ic.Store(receiver, key, args.at<Object>(2)));
1887 return *result; 1887 return *result;
1888 } 1888 }
1889 1889
1890 1890
1891 RUNTIME_FUNCTION(MaybeObject*, StoreIC_MissFromStubFailure) { 1891 RUNTIME_FUNCTION(StoreIC_MissFromStubFailure) {
1892 HandleScope scope(isolate); 1892 HandleScope scope(isolate);
1893 ASSERT(args.length() == 3); 1893 ASSERT(args.length() == 3);
1894 StoreIC ic(IC::EXTRA_CALL_FRAME, isolate); 1894 StoreIC ic(IC::EXTRA_CALL_FRAME, isolate);
1895 Handle<Object> receiver = args.at<Object>(0); 1895 Handle<Object> receiver = args.at<Object>(0);
1896 Handle<String> key = args.at<String>(1); 1896 Handle<String> key = args.at<String>(1);
1897 ic.UpdateState(receiver, key); 1897 ic.UpdateState(receiver, key);
1898 Handle<Object> result; 1898 Handle<Object> result;
1899 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 1899 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
1900 isolate, 1900 isolate,
1901 result, 1901 result,
1902 ic.Store(receiver, key, args.at<Object>(2))); 1902 ic.Store(receiver, key, args.at<Object>(2)));
1903 return *result; 1903 return *result;
1904 } 1904 }
1905 1905
1906 1906
1907 RUNTIME_FUNCTION(MaybeObject*, StoreIC_ArrayLength) { 1907 RUNTIME_FUNCTION(StoreIC_ArrayLength) {
1908 HandleScope scope(isolate); 1908 HandleScope scope(isolate);
1909 1909
1910 ASSERT(args.length() == 2); 1910 ASSERT(args.length() == 2);
1911 Handle<JSArray> receiver = args.at<JSArray>(0); 1911 Handle<JSArray> receiver = args.at<JSArray>(0);
1912 Handle<Object> len = args.at<Object>(1); 1912 Handle<Object> len = args.at<Object>(1);
1913 1913
1914 // The generated code should filter out non-Smis before we get here. 1914 // The generated code should filter out non-Smis before we get here.
1915 ASSERT(len->IsSmi()); 1915 ASSERT(len->IsSmi());
1916 1916
1917 #ifdef DEBUG 1917 #ifdef DEBUG
1918 // The length property has to be a writable callback property. 1918 // The length property has to be a writable callback property.
1919 LookupResult debug_lookup(isolate); 1919 LookupResult debug_lookup(isolate);
1920 receiver->LocalLookup(isolate->heap()->length_string(), &debug_lookup); 1920 receiver->LocalLookup(isolate->heap()->length_string(), &debug_lookup);
1921 ASSERT(debug_lookup.IsPropertyCallbacks() && !debug_lookup.IsReadOnly()); 1921 ASSERT(debug_lookup.IsPropertyCallbacks() && !debug_lookup.IsReadOnly());
1922 #endif 1922 #endif
1923 1923
1924 RETURN_FAILURE_ON_EXCEPTION( 1924 RETURN_FAILURE_ON_EXCEPTION(
1925 isolate, JSArray::SetElementsLength(receiver, len)); 1925 isolate, JSArray::SetElementsLength(receiver, len));
1926 return *len; 1926 return *len;
1927 } 1927 }
1928 1928
1929 1929
1930 // Extend storage is called in a store inline cache when 1930 // Extend storage is called in a store inline cache when
1931 // it is necessary to extend the properties array of a 1931 // it is necessary to extend the properties array of a
1932 // JSObject. 1932 // JSObject.
1933 RUNTIME_FUNCTION(MaybeObject*, SharedStoreIC_ExtendStorage) { 1933 RUNTIME_FUNCTION(SharedStoreIC_ExtendStorage) {
1934 HandleScope shs(isolate); 1934 HandleScope shs(isolate);
1935 ASSERT(args.length() == 3); 1935 ASSERT(args.length() == 3);
1936 1936
1937 // Convert the parameters 1937 // Convert the parameters
1938 Handle<JSObject> object = args.at<JSObject>(0); 1938 Handle<JSObject> object = args.at<JSObject>(0);
1939 Handle<Map> transition = args.at<Map>(1); 1939 Handle<Map> transition = args.at<Map>(1);
1940 Handle<Object> value = args.at<Object>(2); 1940 Handle<Object> value = args.at<Object>(2);
1941 1941
1942 // Check the object has run out out property space. 1942 // Check the object has run out out property space.
1943 ASSERT(object->HasFastProperties()); 1943 ASSERT(object->HasFastProperties());
(...skipping 20 matching lines...) Expand all
1964 // Set the new property value and do the map transition. 1964 // Set the new property value and do the map transition.
1965 object->set_properties(*new_storage); 1965 object->set_properties(*new_storage);
1966 object->set_map(*transition); 1966 object->set_map(*transition);
1967 1967
1968 // Return the stored value. 1968 // Return the stored value.
1969 return *value; 1969 return *value;
1970 } 1970 }
1971 1971
1972 1972
1973 // Used from ic-<arch>.cc. 1973 // Used from ic-<arch>.cc.
1974 RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_Miss) { 1974 RUNTIME_FUNCTION(KeyedStoreIC_Miss) {
1975 HandleScope scope(isolate); 1975 HandleScope scope(isolate);
1976 ASSERT(args.length() == 3); 1976 ASSERT(args.length() == 3);
1977 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate); 1977 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate);
1978 Handle<Object> receiver = args.at<Object>(0); 1978 Handle<Object> receiver = args.at<Object>(0);
1979 Handle<Object> key = args.at<Object>(1); 1979 Handle<Object> key = args.at<Object>(1);
1980 ic.UpdateState(receiver, key); 1980 ic.UpdateState(receiver, key);
1981 Handle<Object> result; 1981 Handle<Object> result;
1982 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 1982 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
1983 isolate, 1983 isolate,
1984 result, 1984 result,
1985 ic.Store(receiver, key, args.at<Object>(2))); 1985 ic.Store(receiver, key, args.at<Object>(2)));
1986 return *result; 1986 return *result;
1987 } 1987 }
1988 1988
1989 1989
1990 RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_MissFromStubFailure) { 1990 RUNTIME_FUNCTION(KeyedStoreIC_MissFromStubFailure) {
1991 HandleScope scope(isolate); 1991 HandleScope scope(isolate);
1992 ASSERT(args.length() == 3); 1992 ASSERT(args.length() == 3);
1993 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate); 1993 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate);
1994 Handle<Object> receiver = args.at<Object>(0); 1994 Handle<Object> receiver = args.at<Object>(0);
1995 Handle<Object> key = args.at<Object>(1); 1995 Handle<Object> key = args.at<Object>(1);
1996 ic.UpdateState(receiver, key); 1996 ic.UpdateState(receiver, key);
1997 Handle<Object> result; 1997 Handle<Object> result;
1998 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 1998 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
1999 isolate, 1999 isolate,
2000 result, 2000 result,
2001 ic.Store(receiver, key, args.at<Object>(2))); 2001 ic.Store(receiver, key, args.at<Object>(2)));
2002 return *result; 2002 return *result;
2003 } 2003 }
2004 2004
2005 2005
2006 RUNTIME_FUNCTION(MaybeObject*, StoreIC_Slow) { 2006 RUNTIME_FUNCTION(StoreIC_Slow) {
2007 HandleScope scope(isolate); 2007 HandleScope scope(isolate);
2008 ASSERT(args.length() == 3); 2008 ASSERT(args.length() == 3);
2009 StoreIC ic(IC::NO_EXTRA_FRAME, isolate); 2009 StoreIC ic(IC::NO_EXTRA_FRAME, isolate);
2010 Handle<Object> object = args.at<Object>(0); 2010 Handle<Object> object = args.at<Object>(0);
2011 Handle<Object> key = args.at<Object>(1); 2011 Handle<Object> key = args.at<Object>(1);
2012 Handle<Object> value = args.at<Object>(2); 2012 Handle<Object> value = args.at<Object>(2);
2013 StrictMode strict_mode = ic.strict_mode(); 2013 StrictMode strict_mode = ic.strict_mode();
2014 Handle<Object> result; 2014 Handle<Object> result;
2015 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 2015 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
2016 isolate, result, 2016 isolate, result,
2017 Runtime::SetObjectProperty( 2017 Runtime::SetObjectProperty(
2018 isolate, object, key, value, NONE, strict_mode)); 2018 isolate, object, key, value, NONE, strict_mode));
2019 return *result; 2019 return *result;
2020 } 2020 }
2021 2021
2022 2022
2023 RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_Slow) { 2023 RUNTIME_FUNCTION(KeyedStoreIC_Slow) {
2024 HandleScope scope(isolate); 2024 HandleScope scope(isolate);
2025 ASSERT(args.length() == 3); 2025 ASSERT(args.length() == 3);
2026 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate); 2026 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate);
2027 Handle<Object> object = args.at<Object>(0); 2027 Handle<Object> object = args.at<Object>(0);
2028 Handle<Object> key = args.at<Object>(1); 2028 Handle<Object> key = args.at<Object>(1);
2029 Handle<Object> value = args.at<Object>(2); 2029 Handle<Object> value = args.at<Object>(2);
2030 StrictMode strict_mode = ic.strict_mode(); 2030 StrictMode strict_mode = ic.strict_mode();
2031 Handle<Object> result; 2031 Handle<Object> result;
2032 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 2032 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
2033 isolate, result, 2033 isolate, result,
2034 Runtime::SetObjectProperty( 2034 Runtime::SetObjectProperty(
2035 isolate, object, key, value, NONE, strict_mode)); 2035 isolate, object, key, value, NONE, strict_mode));
2036 return *result; 2036 return *result;
2037 } 2037 }
2038 2038
2039 2039
2040 RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss) { 2040 RUNTIME_FUNCTION(ElementsTransitionAndStoreIC_Miss) {
2041 HandleScope scope(isolate); 2041 HandleScope scope(isolate);
2042 ASSERT(args.length() == 4); 2042 ASSERT(args.length() == 4);
2043 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate); 2043 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate);
2044 Handle<Object> value = args.at<Object>(0); 2044 Handle<Object> value = args.at<Object>(0);
2045 Handle<Map> map = args.at<Map>(1); 2045 Handle<Map> map = args.at<Map>(1);
2046 Handle<Object> key = args.at<Object>(2); 2046 Handle<Object> key = args.at<Object>(2);
2047 Handle<Object> object = args.at<Object>(3); 2047 Handle<Object> object = args.at<Object>(3);
2048 StrictMode strict_mode = ic.strict_mode(); 2048 StrictMode strict_mode = ic.strict_mode();
2049 if (object->IsJSObject()) { 2049 if (object->IsJSObject()) {
2050 JSObject::TransitionElementsKind(Handle<JSObject>::cast(object), 2050 JSObject::TransitionElementsKind(Handle<JSObject>::cast(object),
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
2549 if (!old_state.UseInlinedSmiCode() && state.UseInlinedSmiCode()) { 2549 if (!old_state.UseInlinedSmiCode() && state.UseInlinedSmiCode()) {
2550 PatchInlinedSmiCode(address(), ENABLE_INLINED_SMI_CHECK); 2550 PatchInlinedSmiCode(address(), ENABLE_INLINED_SMI_CHECK);
2551 } else if (old_state.UseInlinedSmiCode() && !state.UseInlinedSmiCode()) { 2551 } else if (old_state.UseInlinedSmiCode() && !state.UseInlinedSmiCode()) {
2552 PatchInlinedSmiCode(address(), DISABLE_INLINED_SMI_CHECK); 2552 PatchInlinedSmiCode(address(), DISABLE_INLINED_SMI_CHECK);
2553 } 2553 }
2554 2554
2555 return result; 2555 return result;
2556 } 2556 }
2557 2557
2558 2558
2559 RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_Miss) { 2559 RUNTIME_FUNCTION(BinaryOpIC_Miss) {
2560 HandleScope scope(isolate); 2560 HandleScope scope(isolate);
2561 ASSERT_EQ(2, args.length()); 2561 ASSERT_EQ(2, args.length());
2562 Handle<Object> left = args.at<Object>(BinaryOpICStub::kLeft); 2562 Handle<Object> left = args.at<Object>(BinaryOpICStub::kLeft);
2563 Handle<Object> right = args.at<Object>(BinaryOpICStub::kRight); 2563 Handle<Object> right = args.at<Object>(BinaryOpICStub::kRight);
2564 BinaryOpIC ic(isolate); 2564 BinaryOpIC ic(isolate);
2565 Handle<Object> result; 2565 Handle<Object> result;
2566 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 2566 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
2567 isolate, 2567 isolate,
2568 result, 2568 result,
2569 ic.Transition(Handle<AllocationSite>::null(), left, right)); 2569 ic.Transition(Handle<AllocationSite>::null(), left, right));
2570 return *result; 2570 return *result;
2571 } 2571 }
2572 2572
2573 2573
2574 RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_MissWithAllocationSite) { 2574 RUNTIME_FUNCTION(BinaryOpIC_MissWithAllocationSite) {
2575 HandleScope scope(isolate); 2575 HandleScope scope(isolate);
2576 ASSERT_EQ(3, args.length()); 2576 ASSERT_EQ(3, args.length());
2577 Handle<AllocationSite> allocation_site = args.at<AllocationSite>( 2577 Handle<AllocationSite> allocation_site = args.at<AllocationSite>(
2578 BinaryOpWithAllocationSiteStub::kAllocationSite); 2578 BinaryOpWithAllocationSiteStub::kAllocationSite);
2579 Handle<Object> left = args.at<Object>( 2579 Handle<Object> left = args.at<Object>(
2580 BinaryOpWithAllocationSiteStub::kLeft); 2580 BinaryOpWithAllocationSiteStub::kLeft);
2581 Handle<Object> right = args.at<Object>( 2581 Handle<Object> right = args.at<Object>(
2582 BinaryOpWithAllocationSiteStub::kRight); 2582 BinaryOpWithAllocationSiteStub::kRight);
2583 BinaryOpIC ic(isolate); 2583 BinaryOpIC ic(isolate);
2584 Handle<Object> result; 2584 Handle<Object> result;
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
2797 // Activate inlined smi code. 2797 // Activate inlined smi code.
2798 if (previous_state == UNINITIALIZED) { 2798 if (previous_state == UNINITIALIZED) {
2799 PatchInlinedSmiCode(address(), ENABLE_INLINED_SMI_CHECK); 2799 PatchInlinedSmiCode(address(), ENABLE_INLINED_SMI_CHECK);
2800 } 2800 }
2801 2801
2802 return *new_target; 2802 return *new_target;
2803 } 2803 }
2804 2804
2805 2805
2806 // Used from ICCompareStub::GenerateMiss in code-stubs-<arch>.cc. 2806 // Used from ICCompareStub::GenerateMiss in code-stubs-<arch>.cc.
2807 RUNTIME_FUNCTION(Code*, CompareIC_Miss) { 2807 RUNTIME_FUNCTION(CompareIC_Miss) {
2808 HandleScope scope(isolate); 2808 HandleScope scope(isolate);
2809 ASSERT(args.length() == 3); 2809 ASSERT(args.length() == 3);
2810 CompareIC ic(isolate, static_cast<Token::Value>(args.smi_at(2))); 2810 CompareIC ic(isolate, static_cast<Token::Value>(args.smi_at(2)));
2811 return ic.UpdateCaches(args.at<Object>(0), args.at<Object>(1)); 2811 return ic.UpdateCaches(args.at<Object>(0), args.at<Object>(1));
2812 } 2812 }
2813 2813
2814 2814
2815 void CompareNilIC::Clear(Address address, 2815 void CompareNilIC::Clear(Address address,
2816 Code* target, 2816 Code* target,
2817 ConstantPoolArray* constant_pool) { 2817 ConstantPoolArray* constant_pool) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
2859 : HeapObject::cast(*object)->map()); 2859 : HeapObject::cast(*object)->map());
2860 code = isolate()->stub_cache()->ComputeCompareNil(monomorphic_map, stub); 2860 code = isolate()->stub_cache()->ComputeCompareNil(monomorphic_map, stub);
2861 } else { 2861 } else {
2862 code = stub.GetCode(isolate()); 2862 code = stub.GetCode(isolate());
2863 } 2863 }
2864 set_target(*code); 2864 set_target(*code);
2865 return DoCompareNilSlow(isolate(), nil, object); 2865 return DoCompareNilSlow(isolate(), nil, object);
2866 } 2866 }
2867 2867
2868 2868
2869 RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss) { 2869 RUNTIME_FUNCTION(CompareNilIC_Miss) {
2870 HandleScope scope(isolate); 2870 HandleScope scope(isolate);
2871 Handle<Object> object = args.at<Object>(0); 2871 Handle<Object> object = args.at<Object>(0);
2872 CompareNilIC ic(isolate); 2872 CompareNilIC ic(isolate);
2873 return *ic.CompareNil(object); 2873 return *ic.CompareNil(object);
2874 } 2874 }
2875 2875
2876 2876
2877 RUNTIME_FUNCTION(MaybeObject*, Unreachable) { 2877 RUNTIME_FUNCTION(Unreachable) {
2878 UNREACHABLE(); 2878 UNREACHABLE();
2879 CHECK(false); 2879 CHECK(false);
2880 return isolate->heap()->undefined_value(); 2880 return isolate->heap()->undefined_value();
2881 } 2881 }
2882 2882
2883 2883
2884 Builtins::JavaScript BinaryOpIC::TokenToJSBuiltin(Token::Value op) { 2884 Builtins::JavaScript BinaryOpIC::TokenToJSBuiltin(Token::Value op) {
2885 switch (op) { 2885 switch (op) {
2886 default: 2886 default:
2887 UNREACHABLE(); 2887 UNREACHABLE();
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
2924 2924
2925 Handle<Object> ToBooleanIC::ToBoolean(Handle<Object> object) { 2925 Handle<Object> ToBooleanIC::ToBoolean(Handle<Object> object) {
2926 ToBooleanStub stub(target()->extra_ic_state()); 2926 ToBooleanStub stub(target()->extra_ic_state());
2927 bool to_boolean_value = stub.UpdateStatus(object); 2927 bool to_boolean_value = stub.UpdateStatus(object);
2928 Handle<Code> code = stub.GetCode(isolate()); 2928 Handle<Code> code = stub.GetCode(isolate());
2929 set_target(*code); 2929 set_target(*code);
2930 return handle(Smi::FromInt(to_boolean_value ? 1 : 0), isolate()); 2930 return handle(Smi::FromInt(to_boolean_value ? 1 : 0), isolate());
2931 } 2931 }
2932 2932
2933 2933
2934 RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss) { 2934 RUNTIME_FUNCTION(ToBooleanIC_Miss) {
2935 ASSERT(args.length() == 1); 2935 ASSERT(args.length() == 1);
2936 HandleScope scope(isolate); 2936 HandleScope scope(isolate);
2937 Handle<Object> object = args.at<Object>(0); 2937 Handle<Object> object = args.at<Object>(0);
2938 ToBooleanIC ic(isolate); 2938 ToBooleanIC ic(isolate);
2939 return *ic.ToBoolean(object); 2939 return *ic.ToBoolean(object);
2940 } 2940 }
2941 2941
2942 2942
2943 static const Address IC_utilities[] = { 2943 static const Address IC_utilities[] = {
2944 #define ADDR(name) FUNCTION_ADDR(name), 2944 #define ADDR(name) FUNCTION_ADDR(name),
2945 IC_UTIL_LIST(ADDR) 2945 IC_UTIL_LIST(ADDR)
2946 NULL 2946 NULL
2947 #undef ADDR 2947 #undef ADDR
2948 }; 2948 };
2949 2949
2950 2950
2951 Address IC::AddressFromUtilityId(IC::UtilityId id) { 2951 Address IC::AddressFromUtilityId(IC::UtilityId id) {
2952 return IC_utilities[id]; 2952 return IC_utilities[id];
2953 } 2953 }
2954 2954
2955 2955
2956 } } // namespace v8::internal 2956 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ic.h ('k') | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698