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 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1361 ICMissMode miss_mode) { | 1361 ICMissMode miss_mode) { |
1362 if (MigrateDeprecated(object)) { | 1362 if (MigrateDeprecated(object)) { |
1363 return Runtime::GetObjectPropertyOrFail(isolate(), object, key); | 1363 return Runtime::GetObjectPropertyOrFail(isolate(), object, key); |
1364 } | 1364 } |
1365 | 1365 |
1366 // Check for values that can be converted into an internalized string directly | 1366 // Check for values that can be converted into an internalized string directly |
1367 // or is representable as a smi. | 1367 // or is representable as a smi. |
1368 key = TryConvertKey(key, isolate()); | 1368 key = TryConvertKey(key, isolate()); |
1369 | 1369 |
1370 if (key->IsInternalizedString()) { | 1370 if (key->IsInternalizedString()) { |
1371 return LoadIC::Load(object, Handle<String>::cast(key)); | 1371 return LoadIC::Load(object, Handle<String>::cast(key)); |
danno
2013/10/21 16:35:59
Don't you need to install the generic stub here, t
Hannes Payer (out of office)
2013/10/22 09:29:30
Done.
| |
1372 } | 1372 } |
1373 | 1373 |
1374 if (FLAG_use_ic && !object->IsAccessCheckNeeded()) { | 1374 if (FLAG_use_ic) { |
1375 ASSERT(!object->IsJSGlobalProxy()); | |
1376 Handle<Code> stub = generic_stub(); | 1375 Handle<Code> stub = generic_stub(); |
1377 if (miss_mode == MISS_FORCE_GENERIC) { | 1376 if (!object->IsAccessCheckNeeded()) { |
1377 ASSERT(!object->IsJSGlobalProxy()); | |
1378 if (miss_mode == MISS_FORCE_GENERIC) { | |
1379 TRACE_GENERIC_IC(isolate(), "KeyedLoadIC", "force generic"); | |
1380 } else if (object->IsString() && key->IsNumber()) { | |
1381 if (state() == UNINITIALIZED) stub = string_stub(); | |
danno
2013/10/21 16:35:59
need else here to TRACE_GENERIC
Hannes Payer (out of office)
2013/10/22 09:29:30
Done.
| |
1382 } else if (object->IsJSObject()) { | |
1383 Handle<JSObject> receiver = Handle<JSObject>::cast(object); | |
1384 if (receiver->elements()->map() == | |
1385 isolate()->heap()->non_strict_arguments_elements_map()) { | |
1386 stub = non_strict_arguments_stub(); | |
1387 } else if (receiver->HasIndexedInterceptor()) { | |
1388 stub = indexed_interceptor_stub(); | |
1389 } else if (!key->ToSmi()->IsFailure() && | |
1390 (!target().is_identical_to(non_strict_arguments_stub()))) { | |
1391 stub = LoadElementStub(receiver); | |
1392 } | |
danno
2013/10/21 16:35:59
need else here to TRACE_GENERIC
Hannes Payer (out of office)
2013/10/22 09:29:30
Done.
| |
1393 } | |
1394 } else { | |
1378 TRACE_GENERIC_IC(isolate(), "KeyedLoadIC", "force generic"); | 1395 TRACE_GENERIC_IC(isolate(), "KeyedLoadIC", "force generic"); |
danno
2013/10/21 16:35:59
Comment is wrong. Should not be "force generic", b
Hannes Payer (out of office)
2013/10/22 09:29:30
Done.
| |
1379 } else if (object->IsString() && key->IsNumber()) { | |
1380 if (state() == UNINITIALIZED) stub = string_stub(); | |
1381 } else if (object->IsJSObject()) { | |
1382 Handle<JSObject> receiver = Handle<JSObject>::cast(object); | |
1383 if (receiver->elements()->map() == | |
1384 isolate()->heap()->non_strict_arguments_elements_map()) { | |
1385 stub = non_strict_arguments_stub(); | |
1386 } else if (receiver->HasIndexedInterceptor()) { | |
1387 stub = indexed_interceptor_stub(); | |
1388 } else if (!key->ToSmi()->IsFailure() && | |
1389 (!target().is_identical_to(non_strict_arguments_stub()))) { | |
1390 stub = LoadElementStub(receiver); | |
1391 } | |
1392 } | 1396 } |
1393 | |
1394 ASSERT(!stub.is_null()); | 1397 ASSERT(!stub.is_null()); |
1395 set_target(*stub); | 1398 set_target(*stub); |
1396 TRACE_IC("LoadIC", key); | 1399 TRACE_IC("LoadIC", key); |
1397 } | 1400 } |
1398 | 1401 |
1399 | |
1400 return Runtime::GetObjectPropertyOrFail(isolate(), object, key); | 1402 return Runtime::GetObjectPropertyOrFail(isolate(), object, key); |
1401 } | 1403 } |
1402 | 1404 |
1403 | 1405 |
1404 static bool LookupForWrite(Handle<JSObject> receiver, | 1406 static bool LookupForWrite(Handle<JSObject> receiver, |
1405 Handle<String> name, | 1407 Handle<String> name, |
1406 Handle<Object> value, | 1408 Handle<Object> value, |
1407 LookupResult* lookup, | 1409 LookupResult* lookup, |
1408 IC* ic) { | 1410 IC* ic) { |
1409 Handle<JSObject> holder = receiver; | 1411 Handle<JSObject> holder = receiver; |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1974 } | 1976 } |
1975 } else { | 1977 } else { |
1976 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "not an object"); | 1978 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "not an object"); |
1977 } | 1979 } |
1978 } else { | 1980 } else { |
1979 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "force generic"); | 1981 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "force generic"); |
1980 } | 1982 } |
1981 ASSERT(!stub.is_null()); | 1983 ASSERT(!stub.is_null()); |
1982 set_target(*stub); | 1984 set_target(*stub); |
1983 TRACE_IC("StoreIC", key); | 1985 TRACE_IC("StoreIC", key); |
1986 } else if (FLAG_use_ic) { | |
1987 set_target(*generic_stub()); | |
1988 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "force generic"); | |
1989 TRACE_IC("StoreIC", key); | |
1984 } | 1990 } |
1985 | 1991 |
1986 return Runtime::SetObjectPropertyOrFail( | 1992 return Runtime::SetObjectPropertyOrFail( |
1987 isolate(), object , key, value, NONE, strict_mode()); | 1993 isolate(), object , key, value, NONE, strict_mode()); |
1988 } | 1994 } |
1989 | 1995 |
1990 | 1996 |
1991 #undef TRACE_IC | 1997 #undef TRACE_IC |
1992 | 1998 |
1993 | 1999 |
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2713 #undef ADDR | 2719 #undef ADDR |
2714 }; | 2720 }; |
2715 | 2721 |
2716 | 2722 |
2717 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 2723 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
2718 return IC_utilities[id]; | 2724 return IC_utilities[id]; |
2719 } | 2725 } |
2720 | 2726 |
2721 | 2727 |
2722 } } // namespace v8::internal | 2728 } } // namespace v8::internal |
OLD | NEW |