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