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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X87 | 7 #if V8_TARGET_ARCH_X87 |
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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 DCHECK(!map_reg.is(scratch)); | 336 DCHECK(!map_reg.is(scratch)); |
337 __ LoadWeakValue(map_reg, cell, miss); | 337 __ LoadWeakValue(map_reg, cell, miss); |
338 if (transition->CanBeDeprecated()) { | 338 if (transition->CanBeDeprecated()) { |
339 __ mov(scratch, FieldOperand(map_reg, Map::kBitField3Offset)); | 339 __ mov(scratch, FieldOperand(map_reg, Map::kBitField3Offset)); |
340 __ and_(scratch, Immediate(Map::Deprecated::kMask)); | 340 __ and_(scratch, Immediate(Map::Deprecated::kMask)); |
341 __ j(not_zero, miss); | 341 __ j(not_zero, miss); |
342 } | 342 } |
343 } | 343 } |
344 | 344 |
345 | 345 |
346 void NamedStoreHandlerCompiler::GenerateConstantCheck(Object* constant, | 346 void NamedStoreHandlerCompiler::GenerateConstantCheck(Register map_reg, |
| 347 int descriptor, |
347 Register value_reg, | 348 Register value_reg, |
| 349 Register scratch, |
348 Label* miss_label) { | 350 Label* miss_label) { |
349 __ CmpObject(value_reg, handle(constant, isolate())); | 351 DCHECK(!map_reg.is(scratch)); |
| 352 DCHECK(!map_reg.is(value_reg)); |
| 353 DCHECK(!value_reg.is(scratch)); |
| 354 __ LoadInstanceDescriptors(map_reg, scratch); |
| 355 __ mov(scratch, |
| 356 FieldOperand(scratch, DescriptorArray::GetValueOffset(descriptor))); |
| 357 __ cmp(value_reg, scratch); |
350 __ j(not_equal, miss_label); | 358 __ j(not_equal, miss_label); |
351 } | 359 } |
352 | 360 |
353 | 361 |
354 void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type, | 362 void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type, |
355 Register value_reg, | 363 Register value_reg, |
356 Label* miss_label) { | 364 Label* miss_label) { |
357 __ JumpIfSmi(value_reg, miss_label); | 365 __ JumpIfSmi(value_reg, miss_label); |
358 HeapType::Iterator<Map> it = field_type->Classes(); | 366 HeapType::Iterator<Map> it = field_type->Classes(); |
359 if (!it.Done()) { | 367 if (!it.Done()) { |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 // Return the generated code. | 720 // Return the generated code. |
713 return GetCode(kind(), Code::NORMAL, name); | 721 return GetCode(kind(), Code::NORMAL, name); |
714 } | 722 } |
715 | 723 |
716 | 724 |
717 #undef __ | 725 #undef __ |
718 } | 726 } |
719 } // namespace v8::internal | 727 } // namespace v8::internal |
720 | 728 |
721 #endif // V8_TARGET_ARCH_X87 | 729 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |