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_ARM | 5 #if V8_TARGET_ARCH_ARM |
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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 } | 395 } |
396 | 396 |
397 void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(FieldType* field_type, | 397 void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(FieldType* field_type, |
398 Register value_reg, | 398 Register value_reg, |
399 Label* miss_label) { | 399 Label* miss_label) { |
400 Register map_reg = scratch1(); | 400 Register map_reg = scratch1(); |
401 Register scratch = scratch2(); | 401 Register scratch = scratch2(); |
402 DCHECK(!value_reg.is(map_reg)); | 402 DCHECK(!value_reg.is(map_reg)); |
403 DCHECK(!value_reg.is(scratch)); | 403 DCHECK(!value_reg.is(scratch)); |
404 __ JumpIfSmi(value_reg, miss_label); | 404 __ JumpIfSmi(value_reg, miss_label); |
405 FieldType::Iterator it = field_type->Classes(); | 405 if (field_type->IsClass()) { |
406 if (!it.Done()) { | |
407 __ ldr(map_reg, FieldMemOperand(value_reg, HeapObject::kMapOffset)); | 406 __ ldr(map_reg, FieldMemOperand(value_reg, HeapObject::kMapOffset)); |
408 Label do_store; | 407 __ CmpWeakValue(map_reg, Map::WeakCellForMap(field_type->AsClass()), |
409 while (true) { | 408 scratch); |
410 __ CmpWeakValue(map_reg, Map::WeakCellForMap(it.Current()), scratch); | 409 __ b(ne, miss_label); |
411 it.Advance(); | |
412 if (it.Done()) { | |
413 __ b(ne, miss_label); | |
414 break; | |
415 } | |
416 __ b(eq, &do_store); | |
417 } | |
418 __ bind(&do_store); | |
419 } | 410 } |
420 } | 411 } |
421 | 412 |
422 | 413 |
423 Register PropertyHandlerCompiler::CheckPrototypes( | 414 Register PropertyHandlerCompiler::CheckPrototypes( |
424 Register object_reg, Register holder_reg, Register scratch1, | 415 Register object_reg, Register holder_reg, Register scratch1, |
425 Register scratch2, Handle<Name> name, Label* miss, PrototypeCheckType check, | 416 Register scratch2, Handle<Name> name, Label* miss, PrototypeCheckType check, |
426 ReturnHolder return_what) { | 417 ReturnHolder return_what) { |
427 Handle<Map> receiver_map = map(); | 418 Handle<Map> receiver_map = map(); |
428 | 419 |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 // Return the generated code. | 783 // Return the generated code. |
793 return GetCode(kind(), Code::NORMAL, name); | 784 return GetCode(kind(), Code::NORMAL, name); |
794 } | 785 } |
795 | 786 |
796 | 787 |
797 #undef __ | 788 #undef __ |
798 } // namespace internal | 789 } // namespace internal |
799 } // namespace v8 | 790 } // namespace v8 |
800 | 791 |
801 #endif // V8_TARGET_ARCH_ARM | 792 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |