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 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 } | 400 } |
401 | 401 |
402 void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(FieldType* field_type, | 402 void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(FieldType* field_type, |
403 Register value_reg, | 403 Register value_reg, |
404 Label* miss_label) { | 404 Label* miss_label) { |
405 Register map_reg = scratch1(); | 405 Register map_reg = scratch1(); |
406 Register scratch = scratch2(); | 406 Register scratch = scratch2(); |
407 DCHECK(!value_reg.is(map_reg)); | 407 DCHECK(!value_reg.is(map_reg)); |
408 DCHECK(!value_reg.is(scratch)); | 408 DCHECK(!value_reg.is(scratch)); |
409 __ JumpIfSmi(value_reg, miss_label); | 409 __ JumpIfSmi(value_reg, miss_label); |
410 FieldType::Iterator it = field_type->Classes(); | 410 if (field_type->IsClass()) { |
411 if (!it.Done()) { | |
412 Label do_store; | |
413 __ mov(map_reg, FieldOperand(value_reg, HeapObject::kMapOffset)); | 411 __ mov(map_reg, FieldOperand(value_reg, HeapObject::kMapOffset)); |
414 while (true) { | 412 __ CmpWeakValue(map_reg, Map::WeakCellForMap(field_type->AsClass()), |
415 __ CmpWeakValue(map_reg, Map::WeakCellForMap(it.Current()), scratch); | 413 scratch); |
416 it.Advance(); | 414 __ j(not_equal, miss_label); |
417 if (it.Done()) { | |
418 __ j(not_equal, miss_label); | |
419 break; | |
420 } | |
421 __ j(equal, &do_store, Label::kNear); | |
422 } | |
423 __ bind(&do_store); | |
424 } | 415 } |
425 } | 416 } |
426 | 417 |
427 | 418 |
428 Register PropertyHandlerCompiler::CheckPrototypes( | 419 Register PropertyHandlerCompiler::CheckPrototypes( |
429 Register object_reg, Register holder_reg, Register scratch1, | 420 Register object_reg, Register holder_reg, Register scratch1, |
430 Register scratch2, Handle<Name> name, Label* miss, PrototypeCheckType check, | 421 Register scratch2, Handle<Name> name, Label* miss, PrototypeCheckType check, |
431 ReturnHolder return_what) { | 422 ReturnHolder return_what) { |
432 Handle<Map> receiver_map = map(); | 423 Handle<Map> receiver_map = map(); |
433 | 424 |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 // Return the generated code. | 807 // Return the generated code. |
817 return GetCode(kind(), Code::NORMAL, name); | 808 return GetCode(kind(), Code::NORMAL, name); |
818 } | 809 } |
819 | 810 |
820 | 811 |
821 #undef __ | 812 #undef __ |
822 } // namespace internal | 813 } // namespace internal |
823 } // namespace v8 | 814 } // namespace v8 |
824 | 815 |
825 #endif // V8_TARGET_ARCH_X87 | 816 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |