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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/ic/call-optimization.h" | 9 #include "src/ic/call-optimization.h" |
10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 __ mov(scratch, | 378 __ mov(scratch, |
379 FieldOperand(scratch, DescriptorArray::GetValueOffset(descriptor))); | 379 FieldOperand(scratch, DescriptorArray::GetValueOffset(descriptor))); |
380 __ cmp(value_reg, scratch); | 380 __ cmp(value_reg, scratch); |
381 __ j(not_equal, miss_label); | 381 __ j(not_equal, miss_label); |
382 } | 382 } |
383 | 383 |
384 | 384 |
385 void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type, | 385 void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type, |
386 Register value_reg, | 386 Register value_reg, |
387 Label* miss_label) { | 387 Label* miss_label) { |
| 388 Register map_reg = scratch1(); |
| 389 Register scratch = scratch2(); |
| 390 DCHECK(!value_reg.is(map_reg)); |
| 391 DCHECK(!value_reg.is(scratch)); |
388 __ JumpIfSmi(value_reg, miss_label); | 392 __ JumpIfSmi(value_reg, miss_label); |
389 HeapType::Iterator<Map> it = field_type->Classes(); | 393 HeapType::Iterator<Map> it = field_type->Classes(); |
390 if (!it.Done()) { | 394 if (!it.Done()) { |
391 Label do_store; | 395 Label do_store; |
| 396 __ mov(map_reg, FieldOperand(value_reg, HeapObject::kMapOffset)); |
392 while (true) { | 397 while (true) { |
393 __ CompareMap(value_reg, it.Current()); | 398 __ CmpWeakValue(map_reg, Map::WeakCellForMap(it.Current()), scratch); |
394 it.Advance(); | 399 it.Advance(); |
395 if (it.Done()) { | 400 if (it.Done()) { |
396 __ j(not_equal, miss_label); | 401 __ j(not_equal, miss_label); |
397 break; | 402 break; |
398 } | 403 } |
399 __ j(equal, &do_store, Label::kNear); | 404 __ j(equal, &do_store, Label::kNear); |
400 } | 405 } |
401 __ bind(&do_store); | 406 __ bind(&do_store); |
402 } | 407 } |
403 } | 408 } |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 // Return the generated code. | 755 // Return the generated code. |
751 return GetCode(kind(), Code::NORMAL, name); | 756 return GetCode(kind(), Code::NORMAL, name); |
752 } | 757 } |
753 | 758 |
754 | 759 |
755 #undef __ | 760 #undef __ |
756 } | 761 } |
757 } // namespace v8::internal | 762 } // namespace v8::internal |
758 | 763 |
759 #endif // V8_TARGET_ARCH_IA32 | 764 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |