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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
8 | 8 |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic-inl.h" | 10 #include "src/ic-inl.h" |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 Register scratch, Label* miss) { | 274 Register scratch, Label* miss) { |
275 Handle<Cell> cell = JSGlobalObject::EnsurePropertyCell(global, name); | 275 Handle<Cell> cell = JSGlobalObject::EnsurePropertyCell(global, name); |
276 DCHECK(cell->value()->IsTheHole()); | 276 DCHECK(cell->value()->IsTheHole()); |
277 __ li(scratch, Operand(cell)); | 277 __ li(scratch, Operand(cell)); |
278 __ ld(scratch, FieldMemOperand(scratch, Cell::kValueOffset)); | 278 __ ld(scratch, FieldMemOperand(scratch, Cell::kValueOffset)); |
279 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); | 279 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
280 __ Branch(miss, ne, scratch, Operand(at)); | 280 __ Branch(miss, ne, scratch, Operand(at)); |
281 } | 281 } |
282 | 282 |
283 | 283 |
| 284 static void PushInterceptorArguments(MacroAssembler* masm, |
| 285 Register receiver, |
| 286 Register holder, |
| 287 Register name, |
| 288 Handle<JSObject> holder_obj) { |
| 289 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex == 0); |
| 290 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsInfoIndex == 1); |
| 291 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex == 2); |
| 292 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 3); |
| 293 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 4); |
| 294 __ push(name); |
| 295 Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor()); |
| 296 DCHECK(!masm->isolate()->heap()->InNewSpace(*interceptor)); |
| 297 Register scratch = name; |
| 298 __ li(scratch, Operand(interceptor)); |
| 299 __ Push(scratch, receiver, holder); |
| 300 } |
| 301 |
| 302 |
| 303 static void CompileCallLoadPropertyWithInterceptor( |
| 304 MacroAssembler* masm, |
| 305 Register receiver, |
| 306 Register holder, |
| 307 Register name, |
| 308 Handle<JSObject> holder_obj, |
| 309 IC::UtilityId id) { |
| 310 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); |
| 311 __ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()), |
| 312 NamedLoadHandlerCompiler::kInterceptorArgsLength); |
| 313 } |
| 314 |
| 315 |
| 316 // Generate call to api function. |
| 317 void PropertyHandlerCompiler::GenerateFastApiCall( |
| 318 MacroAssembler* masm, const CallOptimization& optimization, |
| 319 Handle<Map> receiver_map, Register receiver, Register scratch_in, |
| 320 bool is_store, int argc, Register* values) { |
| 321 DCHECK(!receiver.is(scratch_in)); |
| 322 // Preparing to push, adjust sp. |
| 323 __ Dsubu(sp, sp, Operand((argc + 1) * kPointerSize)); |
| 324 __ sd(receiver, MemOperand(sp, argc * kPointerSize)); // Push receiver. |
| 325 // Write the arguments to stack frame. |
| 326 for (int i = 0; i < argc; i++) { |
| 327 Register arg = values[argc-1-i]; |
| 328 DCHECK(!receiver.is(arg)); |
| 329 DCHECK(!scratch_in.is(arg)); |
| 330 __ sd(arg, MemOperand(sp, (argc-1-i) * kPointerSize)); // Push arg. |
| 331 } |
| 332 DCHECK(optimization.is_simple_api_call()); |
| 333 |
| 334 // Abi for CallApiFunctionStub. |
| 335 Register callee = a0; |
| 336 Register call_data = a4; |
| 337 Register holder = a2; |
| 338 Register api_function_address = a1; |
| 339 |
| 340 // Put holder in place. |
| 341 CallOptimization::HolderLookup holder_lookup; |
| 342 Handle<JSObject> api_holder = optimization.LookupHolderOfExpectedType( |
| 343 receiver_map, |
| 344 &holder_lookup); |
| 345 switch (holder_lookup) { |
| 346 case CallOptimization::kHolderIsReceiver: |
| 347 __ Move(holder, receiver); |
| 348 break; |
| 349 case CallOptimization::kHolderFound: |
| 350 __ li(holder, api_holder); |
| 351 break; |
| 352 case CallOptimization::kHolderNotFound: |
| 353 UNREACHABLE(); |
| 354 break; |
| 355 } |
| 356 |
| 357 Isolate* isolate = masm->isolate(); |
| 358 Handle<JSFunction> function = optimization.constant_function(); |
| 359 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); |
| 360 Handle<Object> call_data_obj(api_call_info->data(), isolate); |
| 361 |
| 362 // Put callee in place. |
| 363 __ li(callee, function); |
| 364 |
| 365 bool call_data_undefined = false; |
| 366 // Put call_data in place. |
| 367 if (isolate->heap()->InNewSpace(*call_data_obj)) { |
| 368 __ li(call_data, api_call_info); |
| 369 __ ld(call_data, FieldMemOperand(call_data, CallHandlerInfo::kDataOffset)); |
| 370 } else if (call_data_obj->IsUndefined()) { |
| 371 call_data_undefined = true; |
| 372 __ LoadRoot(call_data, Heap::kUndefinedValueRootIndex); |
| 373 } else { |
| 374 __ li(call_data, call_data_obj); |
| 375 } |
| 376 // Put api_function_address in place. |
| 377 Address function_address = v8::ToCData<Address>(api_call_info->callback()); |
| 378 ApiFunction fun(function_address); |
| 379 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL; |
| 380 ExternalReference ref = |
| 381 ExternalReference(&fun, |
| 382 type, |
| 383 masm->isolate()); |
| 384 __ li(api_function_address, Operand(ref)); |
| 385 |
| 386 // Jump to stub. |
| 387 CallApiFunctionStub stub(isolate, is_store, call_data_undefined, argc); |
| 388 __ TailCallStub(&stub); |
| 389 } |
| 390 |
| 391 |
| 392 void PropertyAccessCompiler::GenerateTailCall(MacroAssembler* masm, |
| 393 Handle<Code> code) { |
| 394 __ Jump(code, RelocInfo::CODE_TARGET); |
| 395 } |
| 396 |
| 397 |
| 398 #undef __ |
| 399 #define __ ACCESS_MASM(masm()) |
| 400 |
| 401 |
| 402 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, |
| 403 Handle<Name> name) { |
| 404 if (!label->is_unused()) { |
| 405 __ bind(label); |
| 406 __ li(this->name(), Operand(name)); |
| 407 } |
| 408 } |
| 409 |
| 410 |
284 // Generate StoreTransition code, value is passed in a0 register. | 411 // Generate StoreTransition code, value is passed in a0 register. |
285 // After executing generated code, the receiver_reg and name_reg | 412 // After executing generated code, the receiver_reg and name_reg |
286 // may be clobbered. | 413 // may be clobbered. |
287 void NamedStoreHandlerCompiler::GenerateStoreTransition( | 414 void NamedStoreHandlerCompiler::GenerateStoreTransition( |
288 MacroAssembler* masm, LookupResult* lookup, Handle<Map> transition, | 415 Handle<Map> transition, Handle<Name> name, Register receiver_reg, |
289 Handle<Name> name, Register receiver_reg, Register storage_reg, | 416 Register storage_reg, Register value_reg, Register scratch1, |
290 Register value_reg, Register scratch1, Register scratch2, Register scratch3, | 417 Register scratch2, Register scratch3, Label* miss_label, Label* slow) { |
291 Label* miss_label, Label* slow) { | |
292 // a0 : value. | 418 // a0 : value. |
293 Label exit; | 419 Label exit; |
294 | 420 |
295 int descriptor = transition->LastAdded(); | 421 int descriptor = transition->LastAdded(); |
296 DescriptorArray* descriptors = transition->instance_descriptors(); | 422 DescriptorArray* descriptors = transition->instance_descriptors(); |
297 PropertyDetails details = descriptors->GetDetails(descriptor); | 423 PropertyDetails details = descriptors->GetDetails(descriptor); |
298 Representation representation = details.representation(); | 424 Representation representation = details.representation(); |
299 DCHECK(!representation.IsNone()); | 425 DCHECK(!representation.IsNone()); |
300 | 426 |
301 if (details.type() == CONSTANT) { | 427 if (details.type() == CONSTANT) { |
302 Handle<Object> constant(descriptors->GetValue(descriptor), masm->isolate()); | 428 Handle<Object> constant(descriptors->GetValue(descriptor), isolate()); |
303 __ li(scratch1, constant); | 429 __ li(scratch1, constant); |
304 __ Branch(miss_label, ne, value_reg, Operand(scratch1)); | 430 __ Branch(miss_label, ne, value_reg, Operand(scratch1)); |
305 } else if (representation.IsSmi()) { | 431 } else if (representation.IsSmi()) { |
306 __ JumpIfNotSmi(value_reg, miss_label); | 432 __ JumpIfNotSmi(value_reg, miss_label); |
307 } else if (representation.IsHeapObject()) { | 433 } else if (representation.IsHeapObject()) { |
308 __ JumpIfSmi(value_reg, miss_label); | 434 __ JumpIfSmi(value_reg, miss_label); |
309 HeapType* field_type = descriptors->GetFieldType(descriptor); | 435 HeapType* field_type = descriptors->GetFieldType(descriptor); |
310 HeapType::Iterator<Map> it = field_type->Classes(); | 436 HeapType::Iterator<Map> it = field_type->Classes(); |
311 Handle<Map> current; | 437 Handle<Map> current; |
312 if (!it.Done()) { | 438 if (!it.Done()) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 // Perform map transition for the receiver if necessary. | 477 // Perform map transition for the receiver if necessary. |
352 if (details.type() == FIELD && | 478 if (details.type() == FIELD && |
353 Map::cast(transition->GetBackPointer())->unused_property_fields() == 0) { | 479 Map::cast(transition->GetBackPointer())->unused_property_fields() == 0) { |
354 // The properties must be extended before we can store the value. | 480 // The properties must be extended before we can store the value. |
355 // We jump to a runtime call that extends the properties array. | 481 // We jump to a runtime call that extends the properties array. |
356 __ push(receiver_reg); | 482 __ push(receiver_reg); |
357 __ li(a2, Operand(transition)); | 483 __ li(a2, Operand(transition)); |
358 __ Push(a2, a0); | 484 __ Push(a2, a0); |
359 __ TailCallExternalReference( | 485 __ TailCallExternalReference( |
360 ExternalReference(IC_Utility(IC::kSharedStoreIC_ExtendStorage), | 486 ExternalReference(IC_Utility(IC::kSharedStoreIC_ExtendStorage), |
361 masm->isolate()), | 487 isolate()), |
362 3, 1); | 488 3, 1); |
363 return; | 489 return; |
364 } | 490 } |
365 | 491 |
366 // Update the map of the object. | 492 // Update the map of the object. |
367 __ li(scratch1, Operand(transition)); | 493 __ li(scratch1, Operand(transition)); |
368 __ sd(scratch1, FieldMemOperand(receiver_reg, HeapObject::kMapOffset)); | 494 __ sd(scratch1, FieldMemOperand(receiver_reg, HeapObject::kMapOffset)); |
369 | 495 |
370 // Update the write barrier for the map field. | 496 // Update the write barrier for the map field. |
371 __ RecordWriteField(receiver_reg, | 497 __ RecordWriteField(receiver_reg, |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 __ Ret(USE_DELAY_SLOT); | 578 __ Ret(USE_DELAY_SLOT); |
453 __ mov(v0, a0); | 579 __ mov(v0, a0); |
454 } | 580 } |
455 | 581 |
456 | 582 |
457 // Generate StoreField code, value is passed in a0 register. | 583 // Generate StoreField code, value is passed in a0 register. |
458 // When leaving generated code after success, the receiver_reg and name_reg | 584 // When leaving generated code after success, the receiver_reg and name_reg |
459 // may be clobbered. Upon branch to miss_label, the receiver and name | 585 // may be clobbered. Upon branch to miss_label, the receiver and name |
460 // registers have their original values. | 586 // registers have their original values. |
461 void NamedStoreHandlerCompiler::GenerateStoreField( | 587 void NamedStoreHandlerCompiler::GenerateStoreField( |
462 MacroAssembler* masm, Handle<JSObject> object, LookupResult* lookup, | 588 Handle<JSObject> object, LookupResult* lookup, Register receiver_reg, |
463 Register receiver_reg, Register name_reg, Register value_reg, | 589 Register name_reg, Register value_reg, Register scratch1, Register scratch2, |
464 Register scratch1, Register scratch2, Label* miss_label) { | 590 Label* miss_label) { |
465 // a0 : value | 591 // a0 : value |
466 Label exit; | 592 Label exit; |
467 | 593 |
468 // Stub never generated for non-global objects that require access | 594 // Stub never generated for objects that require access checks. |
469 // checks. | 595 DCHECK(!object->IsAccessCheckNeeded()); |
470 DCHECK(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); | 596 DCHECK(!object->IsJSGlobalProxy()); |
471 | 597 |
472 FieldIndex index = lookup->GetFieldIndex(); | 598 FieldIndex index = lookup->GetFieldIndex(); |
473 | 599 |
474 Representation representation = lookup->representation(); | 600 Representation representation = lookup->representation(); |
475 DCHECK(!representation.IsNone()); | 601 DCHECK(!representation.IsNone()); |
476 if (representation.IsSmi()) { | 602 if (representation.IsSmi()) { |
477 __ JumpIfNotSmi(value_reg, miss_label); | 603 __ JumpIfNotSmi(value_reg, miss_label); |
478 } else if (representation.IsHeapObject()) { | 604 } else if (representation.IsHeapObject()) { |
479 __ JumpIfSmi(value_reg, miss_label); | 605 __ JumpIfSmi(value_reg, miss_label); |
480 HeapType* field_type = lookup->GetFieldType(); | 606 HeapType* field_type = lookup->GetFieldType(); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 } | 702 } |
577 | 703 |
578 // Return the value (register v0). | 704 // Return the value (register v0). |
579 DCHECK(value_reg.is(a0)); | 705 DCHECK(value_reg.is(a0)); |
580 __ bind(&exit); | 706 __ bind(&exit); |
581 __ Ret(USE_DELAY_SLOT); | 707 __ Ret(USE_DELAY_SLOT); |
582 __ mov(v0, a0); | 708 __ mov(v0, a0); |
583 } | 709 } |
584 | 710 |
585 | 711 |
586 void NamedStoreHandlerCompiler::GenerateRestoreName(MacroAssembler* masm, | |
587 Label* label, | |
588 Handle<Name> name) { | |
589 if (!label->is_unused()) { | |
590 __ bind(label); | |
591 __ li(this->name(), Operand(name)); | |
592 } | |
593 } | |
594 | |
595 | |
596 static void PushInterceptorArguments(MacroAssembler* masm, | |
597 Register receiver, | |
598 Register holder, | |
599 Register name, | |
600 Handle<JSObject> holder_obj) { | |
601 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex == 0); | |
602 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsInfoIndex == 1); | |
603 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex == 2); | |
604 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 3); | |
605 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 4); | |
606 __ push(name); | |
607 Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor()); | |
608 DCHECK(!masm->isolate()->heap()->InNewSpace(*interceptor)); | |
609 Register scratch = name; | |
610 __ li(scratch, Operand(interceptor)); | |
611 __ Push(scratch, receiver, holder); | |
612 } | |
613 | |
614 | |
615 static void CompileCallLoadPropertyWithInterceptor( | |
616 MacroAssembler* masm, | |
617 Register receiver, | |
618 Register holder, | |
619 Register name, | |
620 Handle<JSObject> holder_obj, | |
621 IC::UtilityId id) { | |
622 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); | |
623 __ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()), | |
624 NamedLoadHandlerCompiler::kInterceptorArgsLength); | |
625 } | |
626 | |
627 | |
628 // Generate call to api function. | |
629 void PropertyHandlerCompiler::GenerateFastApiCall( | |
630 MacroAssembler* masm, const CallOptimization& optimization, | |
631 Handle<Map> receiver_map, Register receiver, Register scratch_in, | |
632 bool is_store, int argc, Register* values) { | |
633 DCHECK(!receiver.is(scratch_in)); | |
634 // Preparing to push, adjust sp. | |
635 __ Dsubu(sp, sp, Operand((argc + 1) * kPointerSize)); | |
636 __ sd(receiver, MemOperand(sp, argc * kPointerSize)); // Push receiver. | |
637 // Write the arguments to stack frame. | |
638 for (int i = 0; i < argc; i++) { | |
639 Register arg = values[argc-1-i]; | |
640 DCHECK(!receiver.is(arg)); | |
641 DCHECK(!scratch_in.is(arg)); | |
642 __ sd(arg, MemOperand(sp, (argc-1-i) * kPointerSize)); // Push arg. | |
643 } | |
644 DCHECK(optimization.is_simple_api_call()); | |
645 | |
646 // Abi for CallApiFunctionStub. | |
647 Register callee = a0; | |
648 Register call_data = a4; | |
649 Register holder = a2; | |
650 Register api_function_address = a1; | |
651 | |
652 // Put holder in place. | |
653 CallOptimization::HolderLookup holder_lookup; | |
654 Handle<JSObject> api_holder = optimization.LookupHolderOfExpectedType( | |
655 receiver_map, | |
656 &holder_lookup); | |
657 switch (holder_lookup) { | |
658 case CallOptimization::kHolderIsReceiver: | |
659 __ Move(holder, receiver); | |
660 break; | |
661 case CallOptimization::kHolderFound: | |
662 __ li(holder, api_holder); | |
663 break; | |
664 case CallOptimization::kHolderNotFound: | |
665 UNREACHABLE(); | |
666 break; | |
667 } | |
668 | |
669 Isolate* isolate = masm->isolate(); | |
670 Handle<JSFunction> function = optimization.constant_function(); | |
671 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); | |
672 Handle<Object> call_data_obj(api_call_info->data(), isolate); | |
673 | |
674 // Put callee in place. | |
675 __ li(callee, function); | |
676 | |
677 bool call_data_undefined = false; | |
678 // Put call_data in place. | |
679 if (isolate->heap()->InNewSpace(*call_data_obj)) { | |
680 __ li(call_data, api_call_info); | |
681 __ ld(call_data, FieldMemOperand(call_data, CallHandlerInfo::kDataOffset)); | |
682 } else if (call_data_obj->IsUndefined()) { | |
683 call_data_undefined = true; | |
684 __ LoadRoot(call_data, Heap::kUndefinedValueRootIndex); | |
685 } else { | |
686 __ li(call_data, call_data_obj); | |
687 } | |
688 // Put api_function_address in place. | |
689 Address function_address = v8::ToCData<Address>(api_call_info->callback()); | |
690 ApiFunction fun(function_address); | |
691 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL; | |
692 ExternalReference ref = | |
693 ExternalReference(&fun, | |
694 type, | |
695 masm->isolate()); | |
696 __ li(api_function_address, Operand(ref)); | |
697 | |
698 // Jump to stub. | |
699 CallApiFunctionStub stub(isolate, is_store, call_data_undefined, argc); | |
700 __ TailCallStub(&stub); | |
701 } | |
702 | |
703 | |
704 void PropertyAccessCompiler::GenerateTailCall(MacroAssembler* masm, | |
705 Handle<Code> code) { | |
706 __ Jump(code, RelocInfo::CODE_TARGET); | |
707 } | |
708 | |
709 | |
710 #undef __ | |
711 #define __ ACCESS_MASM(masm()) | |
712 | |
713 | |
714 Register PropertyHandlerCompiler::CheckPrototypes( | 712 Register PropertyHandlerCompiler::CheckPrototypes( |
715 Register object_reg, Register holder_reg, Register scratch1, | 713 Register object_reg, Register holder_reg, Register scratch1, |
716 Register scratch2, Handle<Name> name, Label* miss, | 714 Register scratch2, Handle<Name> name, Label* miss, |
717 PrototypeCheckType check) { | 715 PrototypeCheckType check) { |
718 Handle<Map> receiver_map(IC::TypeToMap(*type(), isolate())); | 716 Handle<Map> receiver_map(IC::TypeToMap(*type(), isolate())); |
719 | 717 |
720 // Make sure there's no overlap between holder and object registers. | 718 // Make sure there's no overlap between holder and object registers. |
721 DCHECK(!scratch1.is(object_reg) && !scratch1.is(holder_reg)); | 719 DCHECK(!scratch1.is(object_reg) && !scratch1.is(holder_reg)); |
722 DCHECK(!scratch2.is(object_reg) && !scratch2.is(holder_reg) | 720 DCHECK(!scratch2.is(object_reg) && !scratch2.is(holder_reg) |
723 && !scratch2.is(scratch1)); | 721 && !scratch2.is(scratch1)); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
829 TailCallBuiltin(masm(), MissBuiltin(kind())); | 827 TailCallBuiltin(masm(), MissBuiltin(kind())); |
830 __ bind(&success); | 828 __ bind(&success); |
831 } | 829 } |
832 } | 830 } |
833 | 831 |
834 | 832 |
835 void NamedStoreHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) { | 833 void NamedStoreHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) { |
836 if (!miss->is_unused()) { | 834 if (!miss->is_unused()) { |
837 Label success; | 835 Label success; |
838 __ Branch(&success); | 836 __ Branch(&success); |
839 GenerateRestoreName(masm(), miss, name); | 837 GenerateRestoreName(miss, name); |
840 TailCallBuiltin(masm(), MissBuiltin(kind())); | 838 TailCallBuiltin(masm(), MissBuiltin(kind())); |
841 __ bind(&success); | 839 __ bind(&success); |
842 } | 840 } |
843 } | 841 } |
844 | 842 |
845 | 843 |
846 Register NamedLoadHandlerCompiler::CallbackFrontend(Register object_reg, | 844 Register NamedLoadHandlerCompiler::CallbackFrontend(Register object_reg, |
847 Handle<Name> name, | 845 Handle<Name> name, |
848 Handle<Object> callback) { | 846 Handle<Object> callback) { |
849 Label miss; | 847 Label miss; |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1265 __ bind(&miss); | 1263 __ bind(&miss); |
1266 TailCallBuiltin(masm(), MissBuiltin(kind())); | 1264 TailCallBuiltin(masm(), MissBuiltin(kind())); |
1267 | 1265 |
1268 // Return the generated code. | 1266 // Return the generated code. |
1269 InlineCacheState state = | 1267 InlineCacheState state = |
1270 number_of_handled_maps > 1 ? POLYMORPHIC : MONOMORPHIC; | 1268 number_of_handled_maps > 1 ? POLYMORPHIC : MONOMORPHIC; |
1271 return GetCode(kind(), type, name, state); | 1269 return GetCode(kind(), type, name, state); |
1272 } | 1270 } |
1273 | 1271 |
1274 | 1272 |
1275 void NamedStoreHandlerCompiler::GenerateStoreArrayLength() { | |
1276 // Prepare tail call to StoreIC_ArrayLength. | |
1277 __ Push(receiver(), value()); | |
1278 | |
1279 ExternalReference ref = | |
1280 ExternalReference(IC_Utility(IC::kStoreIC_ArrayLength), | |
1281 masm()->isolate()); | |
1282 __ TailCallExternalReference(ref, 2, 1); | |
1283 } | |
1284 | |
1285 | |
1286 Handle<Code> PropertyICCompiler::CompileKeyedStorePolymorphic( | 1273 Handle<Code> PropertyICCompiler::CompileKeyedStorePolymorphic( |
1287 MapHandleList* receiver_maps, CodeHandleList* handler_stubs, | 1274 MapHandleList* receiver_maps, CodeHandleList* handler_stubs, |
1288 MapHandleList* transitioned_maps) { | 1275 MapHandleList* transitioned_maps) { |
1289 Label miss; | 1276 Label miss; |
1290 __ JumpIfSmi(receiver(), &miss); | 1277 __ JumpIfSmi(receiver(), &miss); |
1291 | 1278 |
1292 int receiver_count = receiver_maps->length(); | 1279 int receiver_count = receiver_maps->length(); |
1293 __ ld(scratch1(), FieldMemOperand(receiver(), HeapObject::kMapOffset)); | 1280 __ ld(scratch1(), FieldMemOperand(receiver(), HeapObject::kMapOffset)); |
1294 for (int i = 0; i < receiver_count; ++i) { | 1281 for (int i = 0; i < receiver_count; ++i) { |
1295 if (transitioned_maps->at(i).is_null()) { | 1282 if (transitioned_maps->at(i).is_null()) { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1345 | 1332 |
1346 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1333 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
1347 } | 1334 } |
1348 | 1335 |
1349 | 1336 |
1350 #undef __ | 1337 #undef __ |
1351 | 1338 |
1352 } } // namespace v8::internal | 1339 } } // namespace v8::internal |
1353 | 1340 |
1354 #endif // V8_TARGET_ARCH_MIPS64 | 1341 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |