| 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/ic/ic.h" | 5 #include "src/ic/ic.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/api-arguments.h" | 9 #include "src/api-arguments.h" |
| 10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 for (; it->IsFound(); it->Next()) { | 228 for (; it->IsFound(); it->Next()) { |
| 229 switch (it->state()) { | 229 switch (it->state()) { |
| 230 case LookupIterator::NOT_FOUND: | 230 case LookupIterator::NOT_FOUND: |
| 231 case LookupIterator::TRANSITION: | 231 case LookupIterator::TRANSITION: |
| 232 UNREACHABLE(); | 232 UNREACHABLE(); |
| 233 case LookupIterator::JSPROXY: | 233 case LookupIterator::JSPROXY: |
| 234 return; | 234 return; |
| 235 case LookupIterator::INTERCEPTOR: { | 235 case LookupIterator::INTERCEPTOR: { |
| 236 // If there is a getter, return; otherwise loop to perform the lookup. | 236 // If there is a getter, return; otherwise loop to perform the lookup. |
| 237 Handle<JSObject> holder = it->GetHolder<JSObject>(); | 237 Handle<JSObject> holder = it->GetHolder<JSObject>(); |
| 238 if (!holder->GetNamedInterceptor()->getter()->IsUndefined()) { | 238 if (!holder->GetNamedInterceptor()->getter()->IsUndefined( |
| 239 it->isolate())) { |
| 239 return; | 240 return; |
| 240 } | 241 } |
| 241 break; | 242 break; |
| 242 } | 243 } |
| 243 case LookupIterator::ACCESS_CHECK: | 244 case LookupIterator::ACCESS_CHECK: |
| 244 // PropertyHandlerCompiler::CheckPrototypes() knows how to emit | 245 // PropertyHandlerCompiler::CheckPrototypes() knows how to emit |
| 245 // access checks for global proxies. | 246 // access checks for global proxies. |
| 246 if (it->GetHolder<JSObject>()->IsJSGlobalProxy() && it->HasAccess()) { | 247 if (it->GetHolder<JSObject>()->IsJSGlobalProxy() && it->HasAccess()) { |
| 247 break; | 248 break; |
| 248 } | 249 } |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 } | 298 } |
| 298 | 299 |
| 299 return true; | 300 return true; |
| 300 } | 301 } |
| 301 | 302 |
| 302 | 303 |
| 303 void IC::UpdateState(Handle<Object> receiver, Handle<Object> name) { | 304 void IC::UpdateState(Handle<Object> receiver, Handle<Object> name) { |
| 304 update_receiver_map(receiver); | 305 update_receiver_map(receiver); |
| 305 if (!name->IsString()) return; | 306 if (!name->IsString()) return; |
| 306 if (state() != MONOMORPHIC && state() != POLYMORPHIC) return; | 307 if (state() != MONOMORPHIC && state() != POLYMORPHIC) return; |
| 307 if (receiver->IsUndefined() || receiver->IsNull()) return; | 308 if (receiver->IsUndefined(isolate()) || receiver->IsNull()) return; |
| 308 | 309 |
| 309 // Remove the target from the code cache if it became invalid | 310 // Remove the target from the code cache if it became invalid |
| 310 // because of changes in the prototype chain to avoid hitting it | 311 // because of changes in the prototype chain to avoid hitting it |
| 311 // again. | 312 // again. |
| 312 if (ShouldRecomputeHandler(receiver, Handle<String>::cast(name))) { | 313 if (ShouldRecomputeHandler(receiver, Handle<String>::cast(name))) { |
| 313 MarkRecomputeHandler(name); | 314 MarkRecomputeHandler(name); |
| 314 } | 315 } |
| 315 } | 316 } |
| 316 | 317 |
| 317 | 318 |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 nexus->ConfigurePolymorphic(maps, transitioned_maps, handlers); | 582 nexus->ConfigurePolymorphic(maps, transitioned_maps, handlers); |
| 582 | 583 |
| 583 vector_set_ = true; | 584 vector_set_ = true; |
| 584 OnTypeFeedbackChanged(isolate(), get_host()); | 585 OnTypeFeedbackChanged(isolate(), get_host()); |
| 585 } | 586 } |
| 586 | 587 |
| 587 | 588 |
| 588 MaybeHandle<Object> LoadIC::Load(Handle<Object> object, Handle<Name> name) { | 589 MaybeHandle<Object> LoadIC::Load(Handle<Object> object, Handle<Name> name) { |
| 589 // If the object is undefined or null it's illegal to try to get any | 590 // If the object is undefined or null it's illegal to try to get any |
| 590 // of its properties; throw a TypeError in that case. | 591 // of its properties; throw a TypeError in that case. |
| 591 if (object->IsUndefined() || object->IsNull()) { | 592 if (object->IsUndefined(isolate()) || object->IsNull()) { |
| 592 return TypeError(MessageTemplate::kNonObjectPropertyLoad, object, name); | 593 return TypeError(MessageTemplate::kNonObjectPropertyLoad, object, name); |
| 593 } | 594 } |
| 594 | 595 |
| 595 // Check if the name is trivially convertible to an index and get | 596 // Check if the name is trivially convertible to an index and get |
| 596 // the element or char if so. | 597 // the element or char if so. |
| 597 uint32_t index; | 598 uint32_t index; |
| 598 if (kind() == Code::KEYED_LOAD_IC && name->AsArrayIndex(&index)) { | 599 if (kind() == Code::KEYED_LOAD_IC && name->AsArrayIndex(&index)) { |
| 599 // Rewrite to the generic keyed load stub. | 600 // Rewrite to the generic keyed load stub. |
| 600 if (FLAG_use_ic) { | 601 if (FLAG_use_ic) { |
| 601 DCHECK(UseVector()); | 602 DCHECK(UseVector()); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 618 Handle<JSGlobalObject> global = Handle<JSGlobalObject>::cast(object); | 619 Handle<JSGlobalObject> global = Handle<JSGlobalObject>::cast(object); |
| 619 Handle<ScriptContextTable> script_contexts( | 620 Handle<ScriptContextTable> script_contexts( |
| 620 global->native_context()->script_context_table()); | 621 global->native_context()->script_context_table()); |
| 621 | 622 |
| 622 ScriptContextTable::LookupResult lookup_result; | 623 ScriptContextTable::LookupResult lookup_result; |
| 623 if (ScriptContextTable::Lookup(script_contexts, str_name, &lookup_result)) { | 624 if (ScriptContextTable::Lookup(script_contexts, str_name, &lookup_result)) { |
| 624 Handle<Object> result = | 625 Handle<Object> result = |
| 625 FixedArray::get(*ScriptContextTable::GetContext( | 626 FixedArray::get(*ScriptContextTable::GetContext( |
| 626 script_contexts, lookup_result.context_index), | 627 script_contexts, lookup_result.context_index), |
| 627 lookup_result.slot_index, isolate()); | 628 lookup_result.slot_index, isolate()); |
| 628 if (*result == *isolate()->factory()->the_hole_value()) { | 629 if (result->IsTheHole(isolate())) { |
| 629 // Do not install stubs and stay pre-monomorphic for | 630 // Do not install stubs and stay pre-monomorphic for |
| 630 // uninitialized accesses. | 631 // uninitialized accesses. |
| 631 return ReferenceError(name); | 632 return ReferenceError(name); |
| 632 } | 633 } |
| 633 | 634 |
| 634 if (use_ic && LoadScriptContextFieldStub::Accepted(&lookup_result)) { | 635 if (use_ic && LoadScriptContextFieldStub::Accepted(&lookup_result)) { |
| 635 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadScriptContextFieldStub); | 636 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadScriptContextFieldStub); |
| 636 LoadScriptContextFieldStub stub(isolate(), &lookup_result); | 637 LoadScriptContextFieldStub stub(isolate(), &lookup_result); |
| 637 PatchCache(name, stub.GetCode()); | 638 PatchCache(name, stub.GetCode()); |
| 638 } | 639 } |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1144 receiver->IsJSFunction() && | 1145 receiver->IsJSFunction() && |
| 1145 Name::Equals(isolate()->factory()->prototype_string(), lookup->name()) && | 1146 Name::Equals(isolate()->factory()->prototype_string(), lookup->name()) && |
| 1146 receiver->IsConstructor() && | 1147 receiver->IsConstructor() && |
| 1147 !Handle<JSFunction>::cast(receiver) | 1148 !Handle<JSFunction>::cast(receiver) |
| 1148 ->map() | 1149 ->map() |
| 1149 ->has_non_instance_prototype())); | 1150 ->has_non_instance_prototype())); |
| 1150 | 1151 |
| 1151 Handle<Map> map = receiver_map(); | 1152 Handle<Map> map = receiver_map(); |
| 1152 switch (lookup->state()) { | 1153 switch (lookup->state()) { |
| 1153 case LookupIterator::INTERCEPTOR: { | 1154 case LookupIterator::INTERCEPTOR: { |
| 1154 DCHECK(!holder->GetNamedInterceptor()->getter()->IsUndefined()); | 1155 DCHECK(!holder->GetNamedInterceptor()->getter()->IsUndefined(isolate())); |
| 1155 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadInterceptor); | 1156 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadInterceptor); |
| 1156 NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder); | 1157 NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder); |
| 1157 // Perform a lookup behind the interceptor. Copy the LookupIterator since | 1158 // Perform a lookup behind the interceptor. Copy the LookupIterator since |
| 1158 // the original iterator will be used to fetch the value. | 1159 // the original iterator will be used to fetch the value. |
| 1159 LookupIterator it = *lookup; | 1160 LookupIterator it = *lookup; |
| 1160 it.Next(); | 1161 it.Next(); |
| 1161 LookupForRead(&it); | 1162 LookupForRead(&it); |
| 1162 return compiler.CompileLoadInterceptor(&it); | 1163 return compiler.CompileLoadInterceptor(&it); |
| 1163 } | 1164 } |
| 1164 | 1165 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1257 if (key->IsHeapNumber()) { | 1258 if (key->IsHeapNumber()) { |
| 1258 double value = Handle<HeapNumber>::cast(key)->value(); | 1259 double value = Handle<HeapNumber>::cast(key)->value(); |
| 1259 if (std::isnan(value)) { | 1260 if (std::isnan(value)) { |
| 1260 key = isolate->factory()->nan_string(); | 1261 key = isolate->factory()->nan_string(); |
| 1261 } else { | 1262 } else { |
| 1262 int int_value = FastD2I(value); | 1263 int int_value = FastD2I(value); |
| 1263 if (value == int_value && Smi::IsValid(int_value)) { | 1264 if (value == int_value && Smi::IsValid(int_value)) { |
| 1264 key = handle(Smi::FromInt(int_value), isolate); | 1265 key = handle(Smi::FromInt(int_value), isolate); |
| 1265 } | 1266 } |
| 1266 } | 1267 } |
| 1267 } else if (key->IsUndefined()) { | 1268 } else if (key->IsUndefined(isolate)) { |
| 1268 key = isolate->factory()->undefined_string(); | 1269 key = isolate->factory()->undefined_string(); |
| 1269 } | 1270 } |
| 1270 return key; | 1271 return key; |
| 1271 } | 1272 } |
| 1272 | 1273 |
| 1273 void KeyedLoadIC::UpdateLoadElement(Handle<HeapObject> receiver) { | 1274 void KeyedLoadIC::UpdateLoadElement(Handle<HeapObject> receiver) { |
| 1274 Handle<Map> receiver_map(receiver->map(), isolate()); | 1275 Handle<Map> receiver_map(receiver->map(), isolate()); |
| 1275 DCHECK(receiver_map->instance_type() != JS_VALUE_TYPE && | 1276 DCHECK(receiver_map->instance_type() != JS_VALUE_TYPE && |
| 1276 receiver_map->instance_type() != JS_PROXY_TYPE); // Checked by caller. | 1277 receiver_map->instance_type() != JS_PROXY_TYPE); // Checked by caller. |
| 1277 MapHandleList target_receiver_maps; | 1278 MapHandleList target_receiver_maps; |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1397 case LookupIterator::NOT_FOUND: | 1398 case LookupIterator::NOT_FOUND: |
| 1398 case LookupIterator::TRANSITION: | 1399 case LookupIterator::TRANSITION: |
| 1399 UNREACHABLE(); | 1400 UNREACHABLE(); |
| 1400 case LookupIterator::JSPROXY: | 1401 case LookupIterator::JSPROXY: |
| 1401 return false; | 1402 return false; |
| 1402 case LookupIterator::INTERCEPTOR: { | 1403 case LookupIterator::INTERCEPTOR: { |
| 1403 Handle<JSObject> holder = it->GetHolder<JSObject>(); | 1404 Handle<JSObject> holder = it->GetHolder<JSObject>(); |
| 1404 InterceptorInfo* info = holder->GetNamedInterceptor(); | 1405 InterceptorInfo* info = holder->GetNamedInterceptor(); |
| 1405 if (it->HolderIsReceiverOrHiddenPrototype()) { | 1406 if (it->HolderIsReceiverOrHiddenPrototype()) { |
| 1406 return !info->non_masking() && receiver.is_identical_to(holder) && | 1407 return !info->non_masking() && receiver.is_identical_to(holder) && |
| 1407 !info->setter()->IsUndefined(); | 1408 !info->setter()->IsUndefined(it->isolate()); |
| 1408 } else if (!info->getter()->IsUndefined() || | 1409 } else if (!info->getter()->IsUndefined(it->isolate()) || |
| 1409 !info->query()->IsUndefined()) { | 1410 !info->query()->IsUndefined(it->isolate())) { |
| 1410 return false; | 1411 return false; |
| 1411 } | 1412 } |
| 1412 break; | 1413 break; |
| 1413 } | 1414 } |
| 1414 case LookupIterator::ACCESS_CHECK: | 1415 case LookupIterator::ACCESS_CHECK: |
| 1415 if (it->GetHolder<JSObject>()->IsAccessCheckNeeded()) return false; | 1416 if (it->GetHolder<JSObject>()->IsAccessCheckNeeded()) return false; |
| 1416 break; | 1417 break; |
| 1417 case LookupIterator::ACCESSOR: | 1418 case LookupIterator::ACCESSOR: |
| 1418 return !it->IsReadOnly(); | 1419 return !it->IsReadOnly(); |
| 1419 case LookupIterator::INTEGER_INDEXED_EXOTIC: | 1420 case LookupIterator::INTEGER_INDEXED_EXOTIC: |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1484 if (ScriptContextTable::Lookup(script_contexts, str_name, &lookup_result)) { | 1485 if (ScriptContextTable::Lookup(script_contexts, str_name, &lookup_result)) { |
| 1485 Handle<Context> script_context = ScriptContextTable::GetContext( | 1486 Handle<Context> script_context = ScriptContextTable::GetContext( |
| 1486 script_contexts, lookup_result.context_index); | 1487 script_contexts, lookup_result.context_index); |
| 1487 if (lookup_result.mode == CONST) { | 1488 if (lookup_result.mode == CONST) { |
| 1488 return TypeError(MessageTemplate::kConstAssign, object, name); | 1489 return TypeError(MessageTemplate::kConstAssign, object, name); |
| 1489 } | 1490 } |
| 1490 | 1491 |
| 1491 Handle<Object> previous_value = | 1492 Handle<Object> previous_value = |
| 1492 FixedArray::get(*script_context, lookup_result.slot_index, isolate()); | 1493 FixedArray::get(*script_context, lookup_result.slot_index, isolate()); |
| 1493 | 1494 |
| 1494 if (*previous_value == *isolate()->factory()->the_hole_value()) { | 1495 if (previous_value->IsTheHole(isolate())) { |
| 1495 // Do not install stubs and stay pre-monomorphic for | 1496 // Do not install stubs and stay pre-monomorphic for |
| 1496 // uninitialized accesses. | 1497 // uninitialized accesses. |
| 1497 return ReferenceError(name); | 1498 return ReferenceError(name); |
| 1498 } | 1499 } |
| 1499 | 1500 |
| 1500 if (FLAG_use_ic && | 1501 if (FLAG_use_ic && |
| 1501 StoreScriptContextFieldStub::Accepted(&lookup_result)) { | 1502 StoreScriptContextFieldStub::Accepted(&lookup_result)) { |
| 1502 TRACE_HANDLER_STATS(isolate(), StoreIC_StoreScriptContextFieldStub); | 1503 TRACE_HANDLER_STATS(isolate(), StoreIC_StoreScriptContextFieldStub); |
| 1503 StoreScriptContextFieldStub stub(isolate(), &lookup_result); | 1504 StoreScriptContextFieldStub stub(isolate(), &lookup_result); |
| 1504 PatchCache(name, stub.GetCode()); | 1505 PatchCache(name, stub.GetCode()); |
| 1505 } | 1506 } |
| 1506 | 1507 |
| 1507 script_context->set(lookup_result.slot_index, *value); | 1508 script_context->set(lookup_result.slot_index, *value); |
| 1508 return value; | 1509 return value; |
| 1509 } | 1510 } |
| 1510 } | 1511 } |
| 1511 | 1512 |
| 1512 // TODO(verwaest): Let SetProperty do the migration, since storing a property | 1513 // TODO(verwaest): Let SetProperty do the migration, since storing a property |
| 1513 // might deprecate the current map again, if value does not fit. | 1514 // might deprecate the current map again, if value does not fit. |
| 1514 if (MigrateDeprecated(object) || object->IsJSProxy()) { | 1515 if (MigrateDeprecated(object) || object->IsJSProxy()) { |
| 1515 Handle<Object> result; | 1516 Handle<Object> result; |
| 1516 ASSIGN_RETURN_ON_EXCEPTION( | 1517 ASSIGN_RETURN_ON_EXCEPTION( |
| 1517 isolate(), result, | 1518 isolate(), result, |
| 1518 Object::SetProperty(object, name, value, language_mode()), Object); | 1519 Object::SetProperty(object, name, value, language_mode()), Object); |
| 1519 return result; | 1520 return result; |
| 1520 } | 1521 } |
| 1521 | 1522 |
| 1522 // If the object is undefined or null it's illegal to try to set any | 1523 // If the object is undefined or null it's illegal to try to set any |
| 1523 // properties on it; throw a TypeError in that case. | 1524 // properties on it; throw a TypeError in that case. |
| 1524 if (object->IsUndefined() || object->IsNull()) { | 1525 if (object->IsUndefined(isolate()) || object->IsNull()) { |
| 1525 return TypeError(MessageTemplate::kNonObjectPropertyStore, object, name); | 1526 return TypeError(MessageTemplate::kNonObjectPropertyStore, object, name); |
| 1526 } | 1527 } |
| 1527 | 1528 |
| 1528 LookupIterator it(object, name); | 1529 LookupIterator it(object, name); |
| 1529 if (FLAG_use_ic) UpdateCaches(&it, value, store_mode); | 1530 if (FLAG_use_ic) UpdateCaches(&it, value, store_mode); |
| 1530 | 1531 |
| 1531 MAYBE_RETURN_NULL( | 1532 MAYBE_RETURN_NULL( |
| 1532 Object::SetProperty(&it, value, language_mode(), store_mode)); | 1533 Object::SetProperty(&it, value, language_mode(), store_mode)); |
| 1533 return value; | 1534 return value; |
| 1534 } | 1535 } |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1607 TRACE_GENERIC_IC(isolate(), "StoreIC", "transition from slow"); | 1608 TRACE_GENERIC_IC(isolate(), "StoreIC", "transition from slow"); |
| 1608 TRACE_HANDLER_STATS(isolate(), StoreIC_SlowStub); | 1609 TRACE_HANDLER_STATS(isolate(), StoreIC_SlowStub); |
| 1609 return slow_stub(); | 1610 return slow_stub(); |
| 1610 } | 1611 } |
| 1611 | 1612 |
| 1612 DCHECK(lookup->IsCacheableTransition()); | 1613 DCHECK(lookup->IsCacheableTransition()); |
| 1613 break; // Custom-compiled handler. | 1614 break; // Custom-compiled handler. |
| 1614 } | 1615 } |
| 1615 | 1616 |
| 1616 case LookupIterator::INTERCEPTOR: { | 1617 case LookupIterator::INTERCEPTOR: { |
| 1617 DCHECK(!holder->GetNamedInterceptor()->setter()->IsUndefined()); | 1618 DCHECK(!holder->GetNamedInterceptor()->setter()->IsUndefined(isolate())); |
| 1618 TRACE_HANDLER_STATS(isolate(), StoreIC_StoreInterceptorStub); | 1619 TRACE_HANDLER_STATS(isolate(), StoreIC_StoreInterceptorStub); |
| 1619 StoreInterceptorStub stub(isolate()); | 1620 StoreInterceptorStub stub(isolate()); |
| 1620 return stub.GetCode(); | 1621 return stub.GetCode(); |
| 1621 } | 1622 } |
| 1622 | 1623 |
| 1623 case LookupIterator::ACCESSOR: { | 1624 case LookupIterator::ACCESSOR: { |
| 1624 if (!holder->HasFastProperties()) { | 1625 if (!holder->HasFastProperties()) { |
| 1625 TRACE_GENERIC_IC(isolate(), "StoreIC", "accessor on slow map"); | 1626 TRACE_GENERIC_IC(isolate(), "StoreIC", "accessor on slow map"); |
| 1626 TRACE_HANDLER_STATS(isolate(), StoreIC_SlowStub); | 1627 TRACE_HANDLER_STATS(isolate(), StoreIC_SlowStub); |
| 1627 return slow_stub(); | 1628 return slow_stub(); |
| (...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2639 | 2640 |
| 2640 | 2641 |
| 2641 Code* CompareIC::UpdateCaches(Handle<Object> x, Handle<Object> y) { | 2642 Code* CompareIC::UpdateCaches(Handle<Object> x, Handle<Object> y) { |
| 2642 HandleScope scope(isolate()); | 2643 HandleScope scope(isolate()); |
| 2643 CompareICStub old_stub(target()->stub_key(), isolate()); | 2644 CompareICStub old_stub(target()->stub_key(), isolate()); |
| 2644 CompareICState::State new_left = | 2645 CompareICState::State new_left = |
| 2645 CompareICState::NewInputState(old_stub.left(), x); | 2646 CompareICState::NewInputState(old_stub.left(), x); |
| 2646 CompareICState::State new_right = | 2647 CompareICState::State new_right = |
| 2647 CompareICState::NewInputState(old_stub.right(), y); | 2648 CompareICState::NewInputState(old_stub.right(), y); |
| 2648 CompareICState::State state = CompareICState::TargetState( | 2649 CompareICState::State state = CompareICState::TargetState( |
| 2649 old_stub.state(), old_stub.left(), old_stub.right(), op_, | 2650 isolate(), old_stub.state(), old_stub.left(), old_stub.right(), op_, |
| 2650 HasInlinedSmiCode(address()), x, y); | 2651 HasInlinedSmiCode(address()), x, y); |
| 2651 CompareICStub stub(isolate(), op_, new_left, new_right, state); | 2652 CompareICStub stub(isolate(), op_, new_left, new_right, state); |
| 2652 if (state == CompareICState::KNOWN_RECEIVER) { | 2653 if (state == CompareICState::KNOWN_RECEIVER) { |
| 2653 stub.set_known_map( | 2654 stub.set_known_map( |
| 2654 Handle<Map>(Handle<JSReceiver>::cast(x)->map(), isolate())); | 2655 Handle<Map>(Handle<JSReceiver>::cast(x)->map(), isolate())); |
| 2655 } | 2656 } |
| 2656 Handle<Code> new_target = stub.GetCode(); | 2657 Handle<Code> new_target = stub.GetCode(); |
| 2657 set_target(*new_target); | 2658 set_target(*new_target); |
| 2658 | 2659 |
| 2659 if (FLAG_trace_ic) { | 2660 if (FLAG_trace_ic) { |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2933 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, | 2934 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, |
| 2934 vector->GetKind(vector_slot)); | 2935 vector->GetKind(vector_slot)); |
| 2935 KeyedLoadICNexus nexus(vector, vector_slot); | 2936 KeyedLoadICNexus nexus(vector, vector_slot); |
| 2936 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2937 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
| 2937 ic.UpdateState(receiver, key); | 2938 ic.UpdateState(receiver, key); |
| 2938 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); | 2939 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); |
| 2939 } | 2940 } |
| 2940 } | 2941 } |
| 2941 } // namespace internal | 2942 } // namespace internal |
| 2942 } // namespace v8 | 2943 } // namespace v8 |
| OLD | NEW |