OLD | NEW |
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 2035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2046 if (!maybe_result->To(&raw_function)) return maybe_result; | 2046 if (!maybe_result->To(&raw_function)) return maybe_result; |
2047 | 2047 |
2048 // The first time the inline cache is updated may be the first time the | 2048 // The first time the inline cache is updated may be the first time the |
2049 // function it references gets called. If the function is lazily compiled | 2049 // function it references gets called. If the function is lazily compiled |
2050 // then the first call will trigger a compilation. We check for this case | 2050 // then the first call will trigger a compilation. We check for this case |
2051 // and we do the compilation immediately, instead of waiting for the stub | 2051 // and we do the compilation immediately, instead of waiting for the stub |
2052 // currently attached to the JSFunction object to trigger compilation. | 2052 // currently attached to the JSFunction object to trigger compilation. |
2053 if (raw_function->is_compiled()) return raw_function; | 2053 if (raw_function->is_compiled()) return raw_function; |
2054 | 2054 |
2055 Handle<JSFunction> function(raw_function); | 2055 Handle<JSFunction> function(raw_function); |
2056 JSFunction::CompileLazy(function, CLEAR_EXCEPTION); | 2056 Compiler::EnsureCompiled(function, CLEAR_EXCEPTION); |
2057 return *function; | 2057 return *function; |
2058 } | 2058 } |
2059 | 2059 |
2060 | 2060 |
2061 // Used from ic-<arch>.cc. | 2061 // Used from ic-<arch>.cc. |
2062 RUNTIME_FUNCTION(MaybeObject*, KeyedCallIC_Miss) { | 2062 RUNTIME_FUNCTION(MaybeObject*, KeyedCallIC_Miss) { |
2063 HandleScope scope(isolate); | 2063 HandleScope scope(isolate); |
2064 ASSERT(args.length() == 2); | 2064 ASSERT(args.length() == 2); |
2065 KeyedCallIC ic(isolate); | 2065 KeyedCallIC ic(isolate); |
2066 Handle<Object> receiver = args.at<Object>(0); | 2066 Handle<Object> receiver = args.at<Object>(0); |
2067 Handle<Object> key = args.at<Object>(1); | 2067 Handle<Object> key = args.at<Object>(1); |
2068 ic.UpdateState(receiver, key); | 2068 ic.UpdateState(receiver, key); |
2069 MaybeObject* maybe_result = ic.LoadFunction(receiver, key); | 2069 MaybeObject* maybe_result = ic.LoadFunction(receiver, key); |
2070 // Result could be a function or a failure. | 2070 // Result could be a function or a failure. |
2071 JSFunction* raw_function = NULL; | 2071 JSFunction* raw_function = NULL; |
2072 if (!maybe_result->To(&raw_function)) return maybe_result; | 2072 if (!maybe_result->To(&raw_function)) return maybe_result; |
2073 | 2073 |
2074 if (raw_function->is_compiled()) return raw_function; | 2074 if (raw_function->is_compiled()) return raw_function; |
2075 | 2075 |
2076 Handle<JSFunction> function(raw_function, isolate); | 2076 Handle<JSFunction> function(raw_function, isolate); |
2077 JSFunction::CompileLazy(function, CLEAR_EXCEPTION); | 2077 Compiler::EnsureCompiled(function, CLEAR_EXCEPTION); |
2078 return *function; | 2078 return *function; |
2079 } | 2079 } |
2080 | 2080 |
2081 | 2081 |
2082 // Used from ic-<arch>.cc. | 2082 // Used from ic-<arch>.cc. |
2083 RUNTIME_FUNCTION(MaybeObject*, LoadIC_Miss) { | 2083 RUNTIME_FUNCTION(MaybeObject*, LoadIC_Miss) { |
2084 HandleScope scope(isolate); | 2084 HandleScope scope(isolate); |
2085 ASSERT(args.length() == 2); | 2085 ASSERT(args.length() == 2); |
2086 LoadIC ic(IC::NO_EXTRA_FRAME, isolate); | 2086 LoadIC ic(IC::NO_EXTRA_FRAME, isolate); |
2087 Handle<Object> receiver = args.at<Object>(0); | 2087 Handle<Object> receiver = args.at<Object>(0); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2147 | 2147 |
2148 ic.UpdateState(receiver, key); | 2148 ic.UpdateState(receiver, key); |
2149 MaybeObject* maybe_result = ic.LoadFunction(receiver, key); | 2149 MaybeObject* maybe_result = ic.LoadFunction(receiver, key); |
2150 // Result could be a function or a failure. | 2150 // Result could be a function or a failure. |
2151 JSFunction* raw_function = NULL; | 2151 JSFunction* raw_function = NULL; |
2152 if (!maybe_result->To(&raw_function)) return maybe_result; | 2152 if (!maybe_result->To(&raw_function)) return maybe_result; |
2153 | 2153 |
2154 if (raw_function->is_compiled()) return raw_function; | 2154 if (raw_function->is_compiled()) return raw_function; |
2155 | 2155 |
2156 Handle<JSFunction> function(raw_function, isolate); | 2156 Handle<JSFunction> function(raw_function, isolate); |
2157 JSFunction::CompileLazy(function, CLEAR_EXCEPTION); | 2157 Compiler::EnsureCompiled(function, CLEAR_EXCEPTION); |
2158 return *function; | 2158 return *function; |
2159 } | 2159 } |
2160 | 2160 |
2161 | 2161 |
2162 RUNTIME_FUNCTION(MaybeObject*, StoreIC_ArrayLength) { | 2162 RUNTIME_FUNCTION(MaybeObject*, StoreIC_ArrayLength) { |
2163 SealHandleScope shs(isolate); | 2163 SealHandleScope shs(isolate); |
2164 | 2164 |
2165 ASSERT(args.length() == 2); | 2165 ASSERT(args.length() == 2); |
2166 JSArray* receiver = JSArray::cast(args[0]); | 2166 JSArray* receiver = JSArray::cast(args[0]); |
2167 Object* len = args[1]; | 2167 Object* len = args[1]; |
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3138 #undef ADDR | 3138 #undef ADDR |
3139 }; | 3139 }; |
3140 | 3140 |
3141 | 3141 |
3142 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 3142 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
3143 return IC_utilities[id]; | 3143 return IC_utilities[id]; |
3144 } | 3144 } |
3145 | 3145 |
3146 | 3146 |
3147 } } // namespace v8::internal | 3147 } } // namespace v8::internal |
OLD | NEW |