| 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/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 1571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1582 Handle<Object> result; | 1582 Handle<Object> result; |
| 1583 ASSIGN_RETURN_ON_EXCEPTION( | 1583 ASSIGN_RETURN_ON_EXCEPTION( |
| 1584 isolate(), result, | 1584 isolate(), result, |
| 1585 Object::SetProperty(&it, value, strict_mode(), store_mode), Object); | 1585 Object::SetProperty(&it, value, strict_mode(), store_mode), Object); |
| 1586 return result; | 1586 return result; |
| 1587 } | 1587 } |
| 1588 | 1588 |
| 1589 | 1589 |
| 1590 Handle<Code> CallIC::initialize_stub(Isolate* isolate, int argc, | 1590 Handle<Code> CallIC::initialize_stub(Isolate* isolate, int argc, |
| 1591 CallICState::CallType call_type) { | 1591 CallICState::CallType call_type) { |
| 1592 CallICTrampolineStub stub(isolate, CallICState(argc, call_type)); |
| 1593 Handle<Code> code = stub.GetCode(); |
| 1594 return code; |
| 1595 } |
| 1596 |
| 1597 |
| 1598 Handle<Code> CallIC::initialize_stub_in_optimized_code( |
| 1599 Isolate* isolate, int argc, CallICState::CallType call_type) { |
| 1592 CallICStub stub(isolate, CallICState(argc, call_type)); | 1600 CallICStub stub(isolate, CallICState(argc, call_type)); |
| 1593 Handle<Code> code = stub.GetCode(); | 1601 Handle<Code> code = stub.GetCode(); |
| 1594 return code; | 1602 return code; |
| 1595 } | 1603 } |
| 1596 | 1604 |
| 1597 | 1605 |
| 1598 Handle<Code> StoreIC::initialize_stub(Isolate* isolate, | 1606 Handle<Code> StoreIC::initialize_stub(Isolate* isolate, |
| 1599 StrictMode strict_mode) { | 1607 StrictMode strict_mode) { |
| 1600 ExtraICState extra_state = ComputeExtraICState(strict_mode); | 1608 ExtraICState extra_state = ComputeExtraICState(strict_mode); |
| 1601 Handle<Code> ic = | 1609 Handle<Code> ic = |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2127 DCHECK(FLAG_use_ic && function->IsJSFunction()); | 2135 DCHECK(FLAG_use_ic && function->IsJSFunction()); |
| 2128 | 2136 |
| 2129 // Are we the array function? | 2137 // Are we the array function? |
| 2130 Handle<JSFunction> array_function = | 2138 Handle<JSFunction> array_function = |
| 2131 Handle<JSFunction>(isolate()->native_context()->array_function()); | 2139 Handle<JSFunction>(isolate()->native_context()->array_function()); |
| 2132 if (array_function.is_identical_to(Handle<JSFunction>::cast(function))) { | 2140 if (array_function.is_identical_to(Handle<JSFunction>::cast(function))) { |
| 2133 // Alter the slot. | 2141 // Alter the slot. |
| 2134 CallICNexus* nexus = casted_nexus<CallICNexus>(); | 2142 CallICNexus* nexus = casted_nexus<CallICNexus>(); |
| 2135 nexus->ConfigureMonomorphicArray(); | 2143 nexus->ConfigureMonomorphicArray(); |
| 2136 | 2144 |
| 2137 CallIC_ArrayStub stub(isolate(), callic_state); | 2145 CallIC_ArrayTrampolineStub stub(isolate(), callic_state); |
| 2138 set_target(*stub.GetCode()); | 2146 set_target(*stub.GetCode()); |
| 2139 Handle<String> name; | 2147 Handle<String> name; |
| 2140 if (array_function->shared()->name()->IsString()) { | 2148 if (array_function->shared()->name()->IsString()) { |
| 2141 name = Handle<String>(String::cast(array_function->shared()->name()), | 2149 name = Handle<String>(String::cast(array_function->shared()->name()), |
| 2142 isolate()); | 2150 isolate()); |
| 2143 } | 2151 } |
| 2144 TRACE_IC("CallIC", name); | 2152 TRACE_IC("CallIC", name); |
| 2145 OnTypeFeedbackChanged(isolate(), get_host(), nexus->vector(), state(), | 2153 OnTypeFeedbackChanged(isolate(), get_host(), nexus->vector(), state(), |
| 2146 MONOMORPHIC); | 2154 MONOMORPHIC); |
| 2147 return true; | 2155 return true; |
| 2148 } | 2156 } |
| 2149 return false; | 2157 return false; |
| 2150 } | 2158 } |
| 2151 | 2159 |
| 2152 | 2160 |
| 2153 void CallIC::PatchMegamorphic(Handle<Object> function) { | 2161 void CallIC::PatchMegamorphic(Handle<Object> function) { |
| 2154 CallICState callic_state(target()->extra_ic_state()); | 2162 CallICState callic_state(target()->extra_ic_state()); |
| 2155 | 2163 |
| 2156 // We are going generic. | 2164 // We are going generic. |
| 2157 CallICNexus* nexus = casted_nexus<CallICNexus>(); | 2165 CallICNexus* nexus = casted_nexus<CallICNexus>(); |
| 2158 nexus->ConfigureGeneric(); | 2166 nexus->ConfigureGeneric(); |
| 2159 | 2167 |
| 2160 CallICStub stub(isolate(), callic_state); | 2168 CallICTrampolineStub stub(isolate(), callic_state); |
| 2161 Handle<Code> code = stub.GetCode(); | 2169 Handle<Code> code = stub.GetCode(); |
| 2162 set_target(*code); | 2170 set_target(*code); |
| 2163 | 2171 |
| 2164 Handle<Object> name = isolate()->factory()->empty_string(); | 2172 Handle<Object> name = isolate()->factory()->empty_string(); |
| 2165 if (function->IsJSFunction()) { | 2173 if (function->IsJSFunction()) { |
| 2166 Handle<JSFunction> js_function = Handle<JSFunction>::cast(function); | 2174 Handle<JSFunction> js_function = Handle<JSFunction>::cast(function); |
| 2167 name = handle(js_function->shared()->name(), isolate()); | 2175 name = handle(js_function->shared()->name(), isolate()); |
| 2168 } | 2176 } |
| 2169 | 2177 |
| 2170 TRACE_IC("CallIC", name); | 2178 TRACE_IC("CallIC", name); |
| (...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2969 static const Address IC_utilities[] = { | 2977 static const Address IC_utilities[] = { |
| 2970 #define ADDR(name) FUNCTION_ADDR(name), | 2978 #define ADDR(name) FUNCTION_ADDR(name), |
| 2971 IC_UTIL_LIST(ADDR) NULL | 2979 IC_UTIL_LIST(ADDR) NULL |
| 2972 #undef ADDR | 2980 #undef ADDR |
| 2973 }; | 2981 }; |
| 2974 | 2982 |
| 2975 | 2983 |
| 2976 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } | 2984 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } |
| 2977 } | 2985 } |
| 2978 } // namespace v8::internal | 2986 } // namespace v8::internal |
| OLD | NEW |