OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #if V8_TARGET_ARCH_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
6 | 6 |
7 #include "src/ic/call-optimization.h" | 7 #include "src/ic/call-optimization.h" |
8 #include "src/ic/handler-compiler.h" | 8 #include "src/ic/handler-compiler.h" |
9 #include "src/ic/ic.h" | 9 #include "src/ic/ic.h" |
10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 } | 384 } |
385 | 385 |
386 void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(FieldType* field_type, | 386 void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(FieldType* field_type, |
387 Register value_reg, | 387 Register value_reg, |
388 Label* miss_label) { | 388 Label* miss_label) { |
389 Register map_reg = scratch1(); | 389 Register map_reg = scratch1(); |
390 Register scratch = scratch2(); | 390 Register scratch = scratch2(); |
391 DCHECK(!value_reg.is(map_reg)); | 391 DCHECK(!value_reg.is(map_reg)); |
392 DCHECK(!value_reg.is(scratch)); | 392 DCHECK(!value_reg.is(scratch)); |
393 __ JumpIfSmi(value_reg, miss_label); | 393 __ JumpIfSmi(value_reg, miss_label); |
394 FieldType::Iterator it = field_type->Classes(); | 394 if (field_type->IsClass()) { |
395 if (!it.Done()) { | |
396 __ ld(map_reg, FieldMemOperand(value_reg, HeapObject::kMapOffset)); | 395 __ ld(map_reg, FieldMemOperand(value_reg, HeapObject::kMapOffset)); |
397 Label do_store; | 396 // Compare map directly within the Branch() functions. |
398 while (true) { | 397 __ GetWeakValue(scratch, Map::WeakCellForMap(field_type->AsClass())); |
399 // Compare map directly within the Branch() functions. | 398 __ Branch(miss_label, ne, map_reg, Operand(scratch)); |
400 __ GetWeakValue(scratch, Map::WeakCellForMap(it.Current())); | |
401 it.Advance(); | |
402 if (it.Done()) { | |
403 __ Branch(miss_label, ne, map_reg, Operand(scratch)); | |
404 break; | |
405 } | |
406 __ Branch(&do_store, eq, map_reg, Operand(scratch)); | |
407 } | |
408 __ bind(&do_store); | |
409 } | 399 } |
410 } | 400 } |
411 | 401 |
412 | 402 |
413 Register PropertyHandlerCompiler::CheckPrototypes( | 403 Register PropertyHandlerCompiler::CheckPrototypes( |
414 Register object_reg, Register holder_reg, Register scratch1, | 404 Register object_reg, Register holder_reg, Register scratch1, |
415 Register scratch2, Handle<Name> name, Label* miss, PrototypeCheckType check, | 405 Register scratch2, Handle<Name> name, Label* miss, PrototypeCheckType check, |
416 ReturnHolder return_what) { | 406 ReturnHolder return_what) { |
417 Handle<Map> receiver_map = map(); | 407 Handle<Map> receiver_map = map(); |
418 | 408 |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 // Return the generated code. | 780 // Return the generated code. |
791 return GetCode(kind(), Code::NORMAL, name); | 781 return GetCode(kind(), Code::NORMAL, name); |
792 } | 782 } |
793 | 783 |
794 | 784 |
795 #undef __ | 785 #undef __ |
796 } // namespace internal | 786 } // namespace internal |
797 } // namespace v8 | 787 } // namespace v8 |
798 | 788 |
799 #endif // V8_TARGET_ARCH_MIPS64 | 789 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |