| 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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1145 receiver->IsJSFunction() && | 1146 receiver->IsJSFunction() && |
| 1146 Name::Equals(isolate()->factory()->prototype_string(), lookup->name()) && | 1147 Name::Equals(isolate()->factory()->prototype_string(), lookup->name()) && |
| 1147 receiver->IsConstructor() && | 1148 receiver->IsConstructor() && |
| 1148 !Handle<JSFunction>::cast(receiver) | 1149 !Handle<JSFunction>::cast(receiver) |
| 1149 ->map() | 1150 ->map() |
| 1150 ->has_non_instance_prototype())); | 1151 ->has_non_instance_prototype())); |
| 1151 | 1152 |
| 1152 Handle<Map> map = receiver_map(); | 1153 Handle<Map> map = receiver_map(); |
| 1153 switch (lookup->state()) { | 1154 switch (lookup->state()) { |
| 1154 case LookupIterator::INTERCEPTOR: { | 1155 case LookupIterator::INTERCEPTOR: { |
| 1155 DCHECK(!holder->GetNamedInterceptor()->getter()->IsUndefined()); | 1156 DCHECK(!holder->GetNamedInterceptor()->getter()->IsUndefined(isolate())); |
| 1156 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadInterceptor); | 1157 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadInterceptor); |
| 1157 NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder); | 1158 NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder); |
| 1158 // Perform a lookup behind the interceptor. Copy the LookupIterator since | 1159 // Perform a lookup behind the interceptor. Copy the LookupIterator since |
| 1159 // the original iterator will be used to fetch the value. | 1160 // the original iterator will be used to fetch the value. |
| 1160 LookupIterator it = *lookup; | 1161 LookupIterator it = *lookup; |
| 1161 it.Next(); | 1162 it.Next(); |
| 1162 LookupForRead(&it); | 1163 LookupForRead(&it); |
| 1163 return compiler.CompileLoadInterceptor(&it); | 1164 return compiler.CompileLoadInterceptor(&it); |
| 1164 } | 1165 } |
| 1165 | 1166 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1258 if (key->IsHeapNumber()) { | 1259 if (key->IsHeapNumber()) { |
| 1259 double value = Handle<HeapNumber>::cast(key)->value(); | 1260 double value = Handle<HeapNumber>::cast(key)->value(); |
| 1260 if (std::isnan(value)) { | 1261 if (std::isnan(value)) { |
| 1261 key = isolate->factory()->nan_string(); | 1262 key = isolate->factory()->nan_string(); |
| 1262 } else { | 1263 } else { |
| 1263 int int_value = FastD2I(value); | 1264 int int_value = FastD2I(value); |
| 1264 if (value == int_value && Smi::IsValid(int_value)) { | 1265 if (value == int_value && Smi::IsValid(int_value)) { |
| 1265 key = handle(Smi::FromInt(int_value), isolate); | 1266 key = handle(Smi::FromInt(int_value), isolate); |
| 1266 } | 1267 } |
| 1267 } | 1268 } |
| 1268 } else if (key->IsUndefined()) { | 1269 } else if (key->IsUndefined(isolate)) { |
| 1269 key = isolate->factory()->undefined_string(); | 1270 key = isolate->factory()->undefined_string(); |
| 1270 } | 1271 } |
| 1271 return key; | 1272 return key; |
| 1272 } | 1273 } |
| 1273 | 1274 |
| 1274 void KeyedLoadIC::UpdateLoadElement(Handle<HeapObject> receiver) { | 1275 void KeyedLoadIC::UpdateLoadElement(Handle<HeapObject> receiver) { |
| 1275 Handle<Map> receiver_map(receiver->map(), isolate()); | 1276 Handle<Map> receiver_map(receiver->map(), isolate()); |
| 1276 DCHECK(receiver_map->instance_type() != JS_VALUE_TYPE && | 1277 DCHECK(receiver_map->instance_type() != JS_VALUE_TYPE && |
| 1277 receiver_map->instance_type() != JS_PROXY_TYPE); // Checked by caller. | 1278 receiver_map->instance_type() != JS_PROXY_TYPE); // Checked by caller. |
| 1278 MapHandleList target_receiver_maps; | 1279 MapHandleList target_receiver_maps; |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1398 case LookupIterator::NOT_FOUND: | 1399 case LookupIterator::NOT_FOUND: |
| 1399 case LookupIterator::TRANSITION: | 1400 case LookupIterator::TRANSITION: |
| 1400 UNREACHABLE(); | 1401 UNREACHABLE(); |
| 1401 case LookupIterator::JSPROXY: | 1402 case LookupIterator::JSPROXY: |
| 1402 return false; | 1403 return false; |
| 1403 case LookupIterator::INTERCEPTOR: { | 1404 case LookupIterator::INTERCEPTOR: { |
| 1404 Handle<JSObject> holder = it->GetHolder<JSObject>(); | 1405 Handle<JSObject> holder = it->GetHolder<JSObject>(); |
| 1405 InterceptorInfo* info = holder->GetNamedInterceptor(); | 1406 InterceptorInfo* info = holder->GetNamedInterceptor(); |
| 1406 if (it->HolderIsReceiverOrHiddenPrototype()) { | 1407 if (it->HolderIsReceiverOrHiddenPrototype()) { |
| 1407 return !info->non_masking() && receiver.is_identical_to(holder) && | 1408 return !info->non_masking() && receiver.is_identical_to(holder) && |
| 1408 !info->setter()->IsUndefined(); | 1409 !info->setter()->IsUndefined(it->isolate()); |
| 1409 } else if (!info->getter()->IsUndefined() || | 1410 } else if (!info->getter()->IsUndefined(it->isolate()) || |
| 1410 !info->query()->IsUndefined()) { | 1411 !info->query()->IsUndefined(it->isolate())) { |
| 1411 return false; | 1412 return false; |
| 1412 } | 1413 } |
| 1413 break; | 1414 break; |
| 1414 } | 1415 } |
| 1415 case LookupIterator::ACCESS_CHECK: | 1416 case LookupIterator::ACCESS_CHECK: |
| 1416 if (it->GetHolder<JSObject>()->IsAccessCheckNeeded()) return false; | 1417 if (it->GetHolder<JSObject>()->IsAccessCheckNeeded()) return false; |
| 1417 break; | 1418 break; |
| 1418 case LookupIterator::ACCESSOR: | 1419 case LookupIterator::ACCESSOR: |
| 1419 return !it->IsReadOnly(); | 1420 return !it->IsReadOnly(); |
| 1420 case LookupIterator::INTEGER_INDEXED_EXOTIC: | 1421 case LookupIterator::INTEGER_INDEXED_EXOTIC: |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1485 if (ScriptContextTable::Lookup(script_contexts, str_name, &lookup_result)) { | 1486 if (ScriptContextTable::Lookup(script_contexts, str_name, &lookup_result)) { |
| 1486 Handle<Context> script_context = ScriptContextTable::GetContext( | 1487 Handle<Context> script_context = ScriptContextTable::GetContext( |
| 1487 script_contexts, lookup_result.context_index); | 1488 script_contexts, lookup_result.context_index); |
| 1488 if (lookup_result.mode == CONST) { | 1489 if (lookup_result.mode == CONST) { |
| 1489 return TypeError(MessageTemplate::kConstAssign, object, name); | 1490 return TypeError(MessageTemplate::kConstAssign, object, name); |
| 1490 } | 1491 } |
| 1491 | 1492 |
| 1492 Handle<Object> previous_value = | 1493 Handle<Object> previous_value = |
| 1493 FixedArray::get(*script_context, lookup_result.slot_index, isolate()); | 1494 FixedArray::get(*script_context, lookup_result.slot_index, isolate()); |
| 1494 | 1495 |
| 1495 if (*previous_value == *isolate()->factory()->the_hole_value()) { | 1496 if (previous_value->IsTheHole(isolate())) { |
| 1496 // Do not install stubs and stay pre-monomorphic for | 1497 // Do not install stubs and stay pre-monomorphic for |
| 1497 // uninitialized accesses. | 1498 // uninitialized accesses. |
| 1498 return ReferenceError(name); | 1499 return ReferenceError(name); |
| 1499 } | 1500 } |
| 1500 | 1501 |
| 1501 if (FLAG_use_ic && | 1502 if (FLAG_use_ic && |
| 1502 StoreScriptContextFieldStub::Accepted(&lookup_result)) { | 1503 StoreScriptContextFieldStub::Accepted(&lookup_result)) { |
| 1503 TRACE_HANDLER_STATS(isolate(), StoreIC_StoreScriptContextFieldStub); | 1504 TRACE_HANDLER_STATS(isolate(), StoreIC_StoreScriptContextFieldStub); |
| 1504 StoreScriptContextFieldStub stub(isolate(), &lookup_result); | 1505 StoreScriptContextFieldStub stub(isolate(), &lookup_result); |
| 1505 PatchCache(name, stub.GetCode()); | 1506 PatchCache(name, stub.GetCode()); |
| 1506 } | 1507 } |
| 1507 | 1508 |
| 1508 script_context->set(lookup_result.slot_index, *value); | 1509 script_context->set(lookup_result.slot_index, *value); |
| 1509 return value; | 1510 return value; |
| 1510 } | 1511 } |
| 1511 } | 1512 } |
| 1512 | 1513 |
| 1513 // TODO(verwaest): Let SetProperty do the migration, since storing a property | 1514 // TODO(verwaest): Let SetProperty do the migration, since storing a property |
| 1514 // might deprecate the current map again, if value does not fit. | 1515 // might deprecate the current map again, if value does not fit. |
| 1515 if (MigrateDeprecated(object) || object->IsJSProxy()) { | 1516 if (MigrateDeprecated(object) || object->IsJSProxy()) { |
| 1516 Handle<Object> result; | 1517 Handle<Object> result; |
| 1517 ASSIGN_RETURN_ON_EXCEPTION( | 1518 ASSIGN_RETURN_ON_EXCEPTION( |
| 1518 isolate(), result, | 1519 isolate(), result, |
| 1519 Object::SetProperty(object, name, value, language_mode()), Object); | 1520 Object::SetProperty(object, name, value, language_mode()), Object); |
| 1520 return result; | 1521 return result; |
| 1521 } | 1522 } |
| 1522 | 1523 |
| 1523 // If the object is undefined or null it's illegal to try to set any | 1524 // If the object is undefined or null it's illegal to try to set any |
| 1524 // properties on it; throw a TypeError in that case. | 1525 // properties on it; throw a TypeError in that case. |
| 1525 if (object->IsUndefined() || object->IsNull()) { | 1526 if (object->IsUndefined(isolate()) || object->IsNull()) { |
| 1526 return TypeError(MessageTemplate::kNonObjectPropertyStore, object, name); | 1527 return TypeError(MessageTemplate::kNonObjectPropertyStore, object, name); |
| 1527 } | 1528 } |
| 1528 | 1529 |
| 1529 LookupIterator it(object, name); | 1530 LookupIterator it(object, name); |
| 1530 if (FLAG_use_ic) UpdateCaches(&it, value, store_mode); | 1531 if (FLAG_use_ic) UpdateCaches(&it, value, store_mode); |
| 1531 | 1532 |
| 1532 MAYBE_RETURN_NULL( | 1533 MAYBE_RETURN_NULL( |
| 1533 Object::SetProperty(&it, value, language_mode(), store_mode)); | 1534 Object::SetProperty(&it, value, language_mode(), store_mode)); |
| 1534 return value; | 1535 return value; |
| 1535 } | 1536 } |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1608 TRACE_GENERIC_IC(isolate(), "StoreIC", "transition from slow"); | 1609 TRACE_GENERIC_IC(isolate(), "StoreIC", "transition from slow"); |
| 1609 TRACE_HANDLER_STATS(isolate(), StoreIC_SlowStub); | 1610 TRACE_HANDLER_STATS(isolate(), StoreIC_SlowStub); |
| 1610 return slow_stub(); | 1611 return slow_stub(); |
| 1611 } | 1612 } |
| 1612 | 1613 |
| 1613 DCHECK(lookup->IsCacheableTransition()); | 1614 DCHECK(lookup->IsCacheableTransition()); |
| 1614 break; // Custom-compiled handler. | 1615 break; // Custom-compiled handler. |
| 1615 } | 1616 } |
| 1616 | 1617 |
| 1617 case LookupIterator::INTERCEPTOR: { | 1618 case LookupIterator::INTERCEPTOR: { |
| 1618 DCHECK(!holder->GetNamedInterceptor()->setter()->IsUndefined()); | 1619 DCHECK(!holder->GetNamedInterceptor()->setter()->IsUndefined(isolate())); |
| 1619 TRACE_HANDLER_STATS(isolate(), StoreIC_StoreInterceptorStub); | 1620 TRACE_HANDLER_STATS(isolate(), StoreIC_StoreInterceptorStub); |
| 1620 StoreInterceptorStub stub(isolate()); | 1621 StoreInterceptorStub stub(isolate()); |
| 1621 return stub.GetCode(); | 1622 return stub.GetCode(); |
| 1622 } | 1623 } |
| 1623 | 1624 |
| 1624 case LookupIterator::ACCESSOR: { | 1625 case LookupIterator::ACCESSOR: { |
| 1625 if (!holder->HasFastProperties()) { | 1626 if (!holder->HasFastProperties()) { |
| 1626 TRACE_GENERIC_IC(isolate(), "StoreIC", "accessor on slow map"); | 1627 TRACE_GENERIC_IC(isolate(), "StoreIC", "accessor on slow map"); |
| 1627 TRACE_HANDLER_STATS(isolate(), StoreIC_SlowStub); | 1628 TRACE_HANDLER_STATS(isolate(), StoreIC_SlowStub); |
| 1628 return slow_stub(); | 1629 return slow_stub(); |
| (...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2640 | 2641 |
| 2641 | 2642 |
| 2642 Code* CompareIC::UpdateCaches(Handle<Object> x, Handle<Object> y) { | 2643 Code* CompareIC::UpdateCaches(Handle<Object> x, Handle<Object> y) { |
| 2643 HandleScope scope(isolate()); | 2644 HandleScope scope(isolate()); |
| 2644 CompareICStub old_stub(target()->stub_key(), isolate()); | 2645 CompareICStub old_stub(target()->stub_key(), isolate()); |
| 2645 CompareICState::State new_left = | 2646 CompareICState::State new_left = |
| 2646 CompareICState::NewInputState(old_stub.left(), x); | 2647 CompareICState::NewInputState(old_stub.left(), x); |
| 2647 CompareICState::State new_right = | 2648 CompareICState::State new_right = |
| 2648 CompareICState::NewInputState(old_stub.right(), y); | 2649 CompareICState::NewInputState(old_stub.right(), y); |
| 2649 CompareICState::State state = CompareICState::TargetState( | 2650 CompareICState::State state = CompareICState::TargetState( |
| 2650 old_stub.state(), old_stub.left(), old_stub.right(), op_, | 2651 isolate(), old_stub.state(), old_stub.left(), old_stub.right(), op_, |
| 2651 HasInlinedSmiCode(address()), x, y); | 2652 HasInlinedSmiCode(address()), x, y); |
| 2652 CompareICStub stub(isolate(), op_, new_left, new_right, state); | 2653 CompareICStub stub(isolate(), op_, new_left, new_right, state); |
| 2653 if (state == CompareICState::KNOWN_RECEIVER) { | 2654 if (state == CompareICState::KNOWN_RECEIVER) { |
| 2654 stub.set_known_map( | 2655 stub.set_known_map( |
| 2655 Handle<Map>(Handle<JSReceiver>::cast(x)->map(), isolate())); | 2656 Handle<Map>(Handle<JSReceiver>::cast(x)->map(), isolate())); |
| 2656 } | 2657 } |
| 2657 Handle<Code> new_target = stub.GetCode(); | 2658 Handle<Code> new_target = stub.GetCode(); |
| 2658 set_target(*new_target); | 2659 set_target(*new_target); |
| 2659 | 2660 |
| 2660 if (FLAG_trace_ic) { | 2661 if (FLAG_trace_ic) { |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2934 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, | 2935 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, |
| 2935 vector->GetKind(vector_slot)); | 2936 vector->GetKind(vector_slot)); |
| 2936 KeyedLoadICNexus nexus(vector, vector_slot); | 2937 KeyedLoadICNexus nexus(vector, vector_slot); |
| 2937 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2938 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
| 2938 ic.UpdateState(receiver, key); | 2939 ic.UpdateState(receiver, key); |
| 2939 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); | 2940 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); |
| 2940 } | 2941 } |
| 2941 } | 2942 } |
| 2942 } // namespace internal | 2943 } // namespace internal |
| 2943 } // namespace v8 | 2944 } // namespace v8 |
| OLD | NEW |