| 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_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
| 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 __ LoadInstanceDescriptors(map_reg, scratch); | 364 __ LoadInstanceDescriptors(map_reg, scratch); |
| 365 __ ld(scratch, | 365 __ ld(scratch, |
| 366 FieldMemOperand(scratch, DescriptorArray::GetValueOffset(descriptor))); | 366 FieldMemOperand(scratch, DescriptorArray::GetValueOffset(descriptor))); |
| 367 __ Branch(miss_label, ne, value_reg, Operand(scratch)); | 367 __ Branch(miss_label, ne, value_reg, Operand(scratch)); |
| 368 } | 368 } |
| 369 | 369 |
| 370 | 370 |
| 371 void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type, | 371 void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type, |
| 372 Register value_reg, | 372 Register value_reg, |
| 373 Label* miss_label) { | 373 Label* miss_label) { |
| 374 Register map_reg = scratch1(); |
| 375 Register scratch = scratch2(); |
| 376 DCHECK(!value_reg.is(map_reg)); |
| 377 DCHECK(!value_reg.is(scratch)); |
| 374 __ JumpIfSmi(value_reg, miss_label); | 378 __ JumpIfSmi(value_reg, miss_label); |
| 375 HeapType::Iterator<Map> it = field_type->Classes(); | 379 HeapType::Iterator<Map> it = field_type->Classes(); |
| 376 if (!it.Done()) { | 380 if (!it.Done()) { |
| 377 __ ld(scratch1(), FieldMemOperand(value_reg, HeapObject::kMapOffset)); | 381 __ ld(map_reg, FieldMemOperand(value_reg, HeapObject::kMapOffset)); |
| 378 Label do_store; | 382 Label do_store; |
| 379 Handle<Map> current; | |
| 380 while (true) { | 383 while (true) { |
| 381 // Do the CompareMap() directly within the Branch() functions. | 384 // Compare map directly within the Branch() functions. |
| 382 current = it.Current(); | |
| 383 it.Advance(); | 385 it.Advance(); |
| 386 __ GetWeakValue(scratch, Map::WeakCellForMap(it.Current())); |
| 384 if (it.Done()) { | 387 if (it.Done()) { |
| 385 __ Branch(miss_label, ne, scratch1(), Operand(current)); | 388 __ Branch(miss_label, ne, map_reg, Operand(scratch)); |
| 386 break; | 389 break; |
| 387 } | 390 } |
| 388 __ Branch(&do_store, eq, scratch1(), Operand(current)); | 391 __ Branch(&do_store, eq, map_reg, Operand(scratch)); |
| 389 } | 392 } |
| 390 __ bind(&do_store); | 393 __ bind(&do_store); |
| 391 } | 394 } |
| 392 } | 395 } |
| 393 | 396 |
| 394 | 397 |
| 395 Register PropertyHandlerCompiler::CheckPrototypes( | 398 Register PropertyHandlerCompiler::CheckPrototypes( |
| 396 Register object_reg, Register holder_reg, Register scratch1, | 399 Register object_reg, Register holder_reg, Register scratch1, |
| 397 Register scratch2, Handle<Name> name, Label* miss, | 400 Register scratch2, Handle<Name> name, Label* miss, |
| 398 PrototypeCheckType check) { | 401 PrototypeCheckType check) { |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 // Return the generated code. | 728 // Return the generated code. |
| 726 return GetCode(kind(), Code::NORMAL, name); | 729 return GetCode(kind(), Code::NORMAL, name); |
| 727 } | 730 } |
| 728 | 731 |
| 729 | 732 |
| 730 #undef __ | 733 #undef __ |
| 731 } | 734 } |
| 732 } // namespace v8::internal | 735 } // namespace v8::internal |
| 733 | 736 |
| 734 #endif // V8_TARGET_ARCH_MIPS64 | 737 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |