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