| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 Code::HANDLER, extra_ic_state, cache_holder, Code::NORMAL, kind); | 127 Code::HANDLER, extra_ic_state, cache_holder, Code::NORMAL, kind); |
| 128 | 128 |
| 129 Handle<Object> probe(stub_holder->map()->FindInCodeCache(*name, flags), | 129 Handle<Object> probe(stub_holder->map()->FindInCodeCache(*name, flags), |
| 130 isolate_); | 130 isolate_); |
| 131 if (probe->IsCode()) return Handle<Code>::cast(probe); | 131 if (probe->IsCode()) return Handle<Code>::cast(probe); |
| 132 return Handle<Code>::null(); | 132 return Handle<Code>::null(); |
| 133 } | 133 } |
| 134 | 134 |
| 135 | 135 |
| 136 Handle<Code> StubCache::ComputeMonomorphicIC(Handle<Name> name, | 136 Handle<Code> StubCache::ComputeMonomorphicIC(Handle<Name> name, |
| 137 Handle<HeapObject> object, | 137 Handle<Object> object, |
| 138 Handle<Code> handler, | 138 Handle<Code> handler, |
| 139 StrictModeFlag strict_mode) { | 139 StrictModeFlag strict_mode) { |
| 140 Code::Kind kind = handler->handler_kind(); | 140 Code::Kind kind = handler->handler_kind(); |
| 141 // Use the same cache holder for the IC as for the handler. | 141 // Use the same cache holder for the IC as for the handler. |
| 142 InlineCacheHolderFlag cache_holder = | 142 InlineCacheHolderFlag cache_holder = |
| 143 Code::ExtractCacheHolderFromFlags(handler->flags()); | 143 Code::ExtractCacheHolderFromFlags(handler->flags()); |
| 144 Handle<HeapObject> stub_holder(IC::GetCodeCacheHolder( | 144 Handle<HeapObject> stub_holder(IC::GetCodeCacheHolder( |
| 145 isolate(), *object, cache_holder)); | 145 isolate(), *object, cache_holder)); |
| 146 Handle<Map> stub_holder_map(stub_holder->map()); | 146 Handle<Map> stub_holder_map(stub_holder->map()); |
| 147 Handle<Code> ic = FindIC( | 147 Handle<Code> ic = FindIC( |
| 148 name, stub_holder_map, kind, strict_mode, cache_holder); | 148 name, stub_holder_map, kind, strict_mode, cache_holder); |
| 149 if (!ic.is_null()) return ic; | 149 if (!ic.is_null()) return ic; |
| 150 | 150 |
| 151 Handle<Map> map(object->map()); | 151 Handle<Map> map(object->GetMarkerMap(isolate())); |
| 152 if (kind == Code::LOAD_IC) { | 152 if (kind == Code::LOAD_IC) { |
| 153 LoadStubCompiler ic_compiler(isolate(), cache_holder); | 153 LoadStubCompiler ic_compiler(isolate(), cache_holder); |
| 154 ic = ic_compiler.CompileMonomorphicIC(map, handler, name); | 154 ic = ic_compiler.CompileMonomorphicIC(map, handler, name); |
| 155 } else if (kind == Code::KEYED_LOAD_IC) { | 155 } else if (kind == Code::KEYED_LOAD_IC) { |
| 156 KeyedLoadStubCompiler ic_compiler(isolate(), cache_holder); | 156 KeyedLoadStubCompiler ic_compiler(isolate(), cache_holder); |
| 157 ic = ic_compiler.CompileMonomorphicIC(map, handler, name); | 157 ic = ic_compiler.CompileMonomorphicIC(map, handler, name); |
| 158 } else if (kind == Code::STORE_IC) { | 158 } else if (kind == Code::STORE_IC) { |
| 159 StoreStubCompiler ic_compiler(isolate(), strict_mode); | 159 StoreStubCompiler ic_compiler(isolate(), strict_mode); |
| 160 ic = ic_compiler.CompileMonomorphicIC(map, handler, name); | 160 ic = ic_compiler.CompileMonomorphicIC(map, handler, name); |
| 161 } else { | 161 } else { |
| (...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1174 Register object_reg, | 1174 Register object_reg, |
| 1175 Handle<JSObject> holder, | 1175 Handle<JSObject> holder, |
| 1176 Handle<Name> name, | 1176 Handle<Name> name, |
| 1177 Label* miss) { | 1177 Label* miss) { |
| 1178 return CheckPrototypes(Handle<JSObject>::cast(object), object_reg, holder, | 1178 return CheckPrototypes(Handle<JSObject>::cast(object), object_reg, holder, |
| 1179 this->name(), scratch1(), scratch2(), | 1179 this->name(), scratch1(), scratch2(), |
| 1180 name, miss, SKIP_RECEIVER); | 1180 name, miss, SKIP_RECEIVER); |
| 1181 } | 1181 } |
| 1182 | 1182 |
| 1183 | 1183 |
| 1184 bool BaseLoadStoreStubCompiler::HasHeapNumberMap(MapHandleList* receiver_maps) { |
| 1185 for (int i = 0; i < receiver_maps->length(); ++i) { |
| 1186 Handle<Map> map = receiver_maps->at(i); |
| 1187 if (map.is_identical_to(isolate()->factory()->heap_number_map())) { |
| 1188 return true; |
| 1189 } |
| 1190 } |
| 1191 return false; |
| 1192 } |
| 1193 |
| 1194 |
| 1184 Register BaseLoadStoreStubCompiler::HandlerFrontend(Handle<Object> object, | 1195 Register BaseLoadStoreStubCompiler::HandlerFrontend(Handle<Object> object, |
| 1185 Register object_reg, | 1196 Register object_reg, |
| 1186 Handle<JSObject> holder, | 1197 Handle<JSObject> holder, |
| 1187 Handle<Name> name) { | 1198 Handle<Name> name) { |
| 1188 Label miss; | 1199 Label miss; |
| 1189 | 1200 |
| 1190 Register reg = HandlerFrontendHeader(object, object_reg, holder, name, &miss); | 1201 Register reg = HandlerFrontendHeader(object, object_reg, holder, name, &miss); |
| 1191 | 1202 |
| 1192 HandlerFrontendFooter(name, &miss); | 1203 HandlerFrontendFooter(name, &miss); |
| 1193 | 1204 |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1812 Handle<FunctionTemplateInfo>( | 1823 Handle<FunctionTemplateInfo>( |
| 1813 FunctionTemplateInfo::cast(signature->receiver())); | 1824 FunctionTemplateInfo::cast(signature->receiver())); |
| 1814 } | 1825 } |
| 1815 } | 1826 } |
| 1816 | 1827 |
| 1817 is_simple_api_call_ = true; | 1828 is_simple_api_call_ = true; |
| 1818 } | 1829 } |
| 1819 | 1830 |
| 1820 | 1831 |
| 1821 } } // namespace v8::internal | 1832 } } // namespace v8::internal |
| OLD | NEW |