| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 LoadStubCompiler compiler(isolate_); | 166 LoadStubCompiler compiler(isolate_); |
| 167 Handle<Code> code = | 167 Handle<Code> code = |
| 168 compiler.CompileLoadCallback(name, receiver, holder, callback); | 168 compiler.CompileLoadCallback(name, receiver, holder, callback); |
| 169 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); | 169 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); |
| 170 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); | 170 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); |
| 171 JSObject::UpdateMapCodeCache(receiver, name, code); | 171 JSObject::UpdateMapCodeCache(receiver, name, code); |
| 172 return code; | 172 return code; |
| 173 } | 173 } |
| 174 | 174 |
| 175 | 175 |
| 176 Handle<Code> StubCache::ComputeLoadArrayLength(Handle<String> name, |
| 177 Handle<JSObject> receiver, |
| 178 Handle<JSObject> holder) { |
| 179 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP); |
| 180 Code::Flags flags = |
| 181 Code::ComputeMonomorphicFlags( |
| 182 Code::LOAD_IC, Code::CALLBACKS, |
| 183 Code::ExtraICStateForeignCallbackArrayLength); |
| 184 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags)); |
| 185 if (probe->IsCode()) return Handle<Code>::cast(probe); |
| 186 |
| 187 LoadStubCompiler compiler(isolate_); |
| 188 Handle<Code> code = |
| 189 compiler.CompileLoadArrayLength(name, receiver, holder); |
| 190 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); |
| 191 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); |
| 192 JSObject::UpdateMapCodeCache(receiver, name, code); |
| 193 return code; |
| 194 } |
| 195 |
| 196 |
| 176 Handle<Code> StubCache::ComputeLoadViaGetter(Handle<String> name, | 197 Handle<Code> StubCache::ComputeLoadViaGetter(Handle<String> name, |
| 177 Handle<JSObject> receiver, | 198 Handle<JSObject> receiver, |
| 178 Handle<JSObject> holder, | 199 Handle<JSObject> holder, |
| 179 Handle<JSFunction> getter) { | 200 Handle<JSFunction> getter) { |
| 180 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP); | 201 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP); |
| 181 Code::Flags flags = | 202 Code::Flags flags = |
| 182 Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::CALLBACKS); | 203 Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::CALLBACKS); |
| 183 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags)); | 204 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags)); |
| 184 if (probe->IsCode()) return Handle<Code>::cast(probe); | 205 if (probe->IsCode()) return Handle<Code>::cast(probe); |
| 185 | 206 |
| (...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1366 void StubCompiler::LookupPostInterceptor(Handle<JSObject> holder, | 1387 void StubCompiler::LookupPostInterceptor(Handle<JSObject> holder, |
| 1367 Handle<String> name, | 1388 Handle<String> name, |
| 1368 LookupResult* lookup) { | 1389 LookupResult* lookup) { |
| 1369 holder->LocalLookupRealNamedProperty(*name, lookup); | 1390 holder->LocalLookupRealNamedProperty(*name, lookup); |
| 1370 if (lookup->IsFound()) return; | 1391 if (lookup->IsFound()) return; |
| 1371 if (holder->GetPrototype()->IsNull()) return; | 1392 if (holder->GetPrototype()->IsNull()) return; |
| 1372 holder->GetPrototype()->Lookup(*name, lookup); | 1393 holder->GetPrototype()->Lookup(*name, lookup); |
| 1373 } | 1394 } |
| 1374 | 1395 |
| 1375 | 1396 |
| 1376 Handle<Code> LoadStubCompiler::GetCode(Code::StubType type, | 1397 Handle<Code> LoadStubCompiler::GetCode( |
| 1377 Handle<String> name) { | 1398 Code::StubType type, |
| 1378 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, type); | 1399 Handle<String> name, |
| 1400 Code::ExtraICStateForeignCallback callbackType) { |
| 1401 Code::Flags flags = Code::ComputeMonomorphicFlags( |
| 1402 Code::LOAD_IC, type, Code::ExtraICState(callbackType)); |
| 1379 Handle<Code> code = GetCodeWithFlags(flags, name); | 1403 Handle<Code> code = GetCodeWithFlags(flags, name); |
| 1380 PROFILE(isolate(), CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); | 1404 PROFILE(isolate(), CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); |
| 1381 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); | 1405 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); |
| 1382 return code; | 1406 return code; |
| 1383 } | 1407 } |
| 1384 | 1408 |
| 1385 | 1409 |
| 1386 Handle<Code> KeyedLoadStubCompiler::GetCode(Code::StubType type, | 1410 Handle<Code> KeyedLoadStubCompiler::GetCode(Code::StubType type, |
| 1387 Handle<String> name, | 1411 Handle<String> name, |
| 1388 InlineCacheState state) { | 1412 InlineCacheState state) { |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1579 Handle<FunctionTemplateInfo>( | 1603 Handle<FunctionTemplateInfo>( |
| 1580 FunctionTemplateInfo::cast(signature->receiver())); | 1604 FunctionTemplateInfo::cast(signature->receiver())); |
| 1581 } | 1605 } |
| 1582 } | 1606 } |
| 1583 | 1607 |
| 1584 is_simple_api_call_ = true; | 1608 is_simple_api_call_ = true; |
| 1585 } | 1609 } |
| 1586 | 1610 |
| 1587 | 1611 |
| 1588 } } // namespace v8::internal | 1612 } } // namespace v8::internal |
| OLD | NEW |