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_X64 | 7 #if V8_TARGET_ARCH_X64 |
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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 __ movp(scratch, | 370 __ movp(scratch, |
371 FieldOperand(scratch, DescriptorArray::GetValueOffset(descriptor))); | 371 FieldOperand(scratch, DescriptorArray::GetValueOffset(descriptor))); |
372 __ cmpp(value_reg, scratch); | 372 __ cmpp(value_reg, scratch); |
373 __ j(not_equal, miss_label); | 373 __ j(not_equal, miss_label); |
374 } | 374 } |
375 | 375 |
376 | 376 |
377 void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type, | 377 void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type, |
378 Register value_reg, | 378 Register value_reg, |
379 Label* miss_label) { | 379 Label* miss_label) { |
| 380 Register map_reg = scratch1(); |
| 381 Register scratch = scratch2(); |
| 382 DCHECK(!value_reg.is(map_reg)); |
| 383 DCHECK(!value_reg.is(scratch)); |
380 __ JumpIfSmi(value_reg, miss_label); | 384 __ JumpIfSmi(value_reg, miss_label); |
381 HeapType::Iterator<Map> it = field_type->Classes(); | 385 HeapType::Iterator<Map> it = field_type->Classes(); |
382 if (!it.Done()) { | 386 if (!it.Done()) { |
383 Label do_store; | 387 Label do_store; |
| 388 __ movp(map_reg, FieldOperand(value_reg, HeapObject::kMapOffset)); |
384 while (true) { | 389 while (true) { |
385 __ CompareMap(value_reg, it.Current()); | 390 __ CmpWeakValue(map_reg, Map::WeakCellForMap(it.Current()), scratch); |
386 it.Advance(); | 391 it.Advance(); |
387 if (it.Done()) { | 392 if (it.Done()) { |
388 __ j(not_equal, miss_label); | 393 __ j(not_equal, miss_label); |
389 break; | 394 break; |
390 } | 395 } |
391 __ j(equal, &do_store, Label::kNear); | 396 __ j(equal, &do_store, Label::kNear); |
392 } | 397 } |
393 __ bind(&do_store); | 398 __ bind(&do_store); |
394 } | 399 } |
395 } | 400 } |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 // Return the generated code. | 742 // Return the generated code. |
738 return GetCode(kind(), Code::NORMAL, name); | 743 return GetCode(kind(), Code::NORMAL, name); |
739 } | 744 } |
740 | 745 |
741 | 746 |
742 #undef __ | 747 #undef __ |
743 } | 748 } |
744 } // namespace v8::internal | 749 } // namespace v8::internal |
745 | 750 |
746 #endif // V8_TARGET_ARCH_X64 | 751 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |