| 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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 | 469 |
| 470 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, scratch1, | 470 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, scratch1, |
| 471 scratch2); | 471 scratch2); |
| 472 | 472 |
| 473 __ mov(scratch1, FieldOperand(reg, HeapObject::kMapOffset)); | 473 __ mov(scratch1, FieldOperand(reg, HeapObject::kMapOffset)); |
| 474 reg = holder_reg; // From now on the object will be in holder_reg. | 474 reg = holder_reg; // From now on the object will be in holder_reg. |
| 475 __ mov(reg, FieldOperand(scratch1, Map::kPrototypeOffset)); | 475 __ mov(reg, FieldOperand(scratch1, Map::kPrototypeOffset)); |
| 476 } else { | 476 } else { |
| 477 Register map_reg = scratch1; | 477 Register map_reg = scratch1; |
| 478 __ mov(map_reg, FieldOperand(reg, HeapObject::kMapOffset)); | 478 __ mov(map_reg, FieldOperand(reg, HeapObject::kMapOffset)); |
| 479 if (depth != 1 || check == CHECK_ALL_MAPS) { | 479 if (current_map->IsJSGlobalObjectMap()) { |
| 480 GenerateCheckPropertyCell(masm(), Handle<JSGlobalObject>::cast(current), |
| 481 name, scratch2, miss); |
| 482 } else if (depth != 1 || check == CHECK_ALL_MAPS) { |
| 480 Handle<WeakCell> cell = Map::WeakCellForMap(current_map); | 483 Handle<WeakCell> cell = Map::WeakCellForMap(current_map); |
| 481 __ CmpWeakValue(map_reg, cell, scratch2); | 484 __ CmpWeakValue(map_reg, cell, scratch2); |
| 482 __ j(not_equal, miss); | 485 __ j(not_equal, miss); |
| 483 } | 486 } |
| 484 | 487 |
| 485 if (current_map->IsJSGlobalObjectMap()) { | |
| 486 GenerateCheckPropertyCell(masm(), Handle<JSGlobalObject>::cast(current), | |
| 487 name, scratch2, miss); | |
| 488 } | |
| 489 reg = holder_reg; // From now on the object will be in holder_reg. | 488 reg = holder_reg; // From now on the object will be in holder_reg. |
| 490 __ mov(reg, FieldOperand(map_reg, Map::kPrototypeOffset)); | 489 __ mov(reg, FieldOperand(map_reg, Map::kPrototypeOffset)); |
| 491 } | 490 } |
| 492 | 491 |
| 493 // Go to the next object in the prototype chain. | 492 // Go to the next object in the prototype chain. |
| 494 current = prototype; | 493 current = prototype; |
| 495 current_map = handle(current->map()); | 494 current_map = handle(current->map()); |
| 496 } | 495 } |
| 497 | 496 |
| 497 DCHECK(!current_map->IsJSGlobalProxyMap()); |
| 498 |
| 498 // Log the check depth. | 499 // Log the check depth. |
| 499 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); | 500 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); |
| 500 | 501 |
| 501 if (depth != 0 || check == CHECK_ALL_MAPS) { | 502 if (depth != 0 || check == CHECK_ALL_MAPS) { |
| 502 // Check the holder map. | 503 // Check the holder map. |
| 503 __ mov(scratch1, FieldOperand(reg, HeapObject::kMapOffset)); | 504 __ mov(scratch1, FieldOperand(reg, HeapObject::kMapOffset)); |
| 504 Handle<WeakCell> cell = Map::WeakCellForMap(current_map); | 505 Handle<WeakCell> cell = Map::WeakCellForMap(current_map); |
| 505 __ CmpWeakValue(scratch1, cell, scratch2); | 506 __ CmpWeakValue(scratch1, cell, scratch2); |
| 506 __ j(not_equal, miss); | 507 __ j(not_equal, miss); |
| 507 } | 508 } |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 // Return the generated code. | 767 // Return the generated code. |
| 767 return GetCode(kind(), Code::NORMAL, name); | 768 return GetCode(kind(), Code::NORMAL, name); |
| 768 } | 769 } |
| 769 | 770 |
| 770 | 771 |
| 771 #undef __ | 772 #undef __ |
| 772 } | 773 } |
| 773 } // namespace v8::internal | 774 } // namespace v8::internal |
| 774 | 775 |
| 775 #endif // V8_TARGET_ARCH_X87 | 776 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |