OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "x64/lithium-codegen-x64.h" | 9 #include "x64/lithium-codegen-x64.h" |
10 #include "code-stubs.h" | 10 #include "code-stubs.h" |
(...skipping 4995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5006 codegen()->DoDeferredInstanceMigration(instr_, object_); | 5006 codegen()->DoDeferredInstanceMigration(instr_, object_); |
5007 } | 5007 } |
5008 Label* check_maps() { return &check_maps_; } | 5008 Label* check_maps() { return &check_maps_; } |
5009 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } | 5009 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } |
5010 private: | 5010 private: |
5011 LCheckMaps* instr_; | 5011 LCheckMaps* instr_; |
5012 Label check_maps_; | 5012 Label check_maps_; |
5013 Register object_; | 5013 Register object_; |
5014 }; | 5014 }; |
5015 | 5015 |
5016 if (instr->hydrogen()->CanOmitMapChecks()) return; | 5016 if (instr->hydrogen()->IsStabilityCheck()) { |
| 5017 const UniqueSet<Map>* maps = instr->hydrogen()->maps(); |
| 5018 for (int i = 0; i < maps->size(); ++i) { |
| 5019 AddStabilityDependency(maps->at(i).handle()); |
| 5020 } |
| 5021 return; |
| 5022 } |
5017 | 5023 |
5018 LOperand* input = instr->value(); | 5024 LOperand* input = instr->value(); |
5019 ASSERT(input->IsRegister()); | 5025 ASSERT(input->IsRegister()); |
5020 Register reg = ToRegister(input); | 5026 Register reg = ToRegister(input); |
5021 | 5027 |
5022 DeferredCheckMaps* deferred = NULL; | 5028 DeferredCheckMaps* deferred = NULL; |
5023 if (instr->hydrogen()->has_migration_target()) { | 5029 if (instr->hydrogen()->HasMigrationTarget()) { |
5024 deferred = new(zone()) DeferredCheckMaps(this, instr, reg); | 5030 deferred = new(zone()) DeferredCheckMaps(this, instr, reg); |
5025 __ bind(deferred->check_maps()); | 5031 __ bind(deferred->check_maps()); |
5026 } | 5032 } |
5027 | 5033 |
5028 const UniqueSet<Map>* maps = instr->hydrogen()->maps(); | 5034 const UniqueSet<Map>* maps = instr->hydrogen()->maps(); |
5029 Label success; | 5035 Label success; |
5030 for (int i = 0; i < maps->size() - 1; i++) { | 5036 for (int i = 0; i < maps->size() - 1; i++) { |
5031 Handle<Map> map = maps->at(i).handle(); | 5037 Handle<Map> map = maps->at(i).handle(); |
5032 __ CompareMap(reg, map); | 5038 __ CompareMap(reg, map); |
5033 __ j(equal, &success, Label::kNear); | 5039 __ j(equal, &success, Label::kNear); |
5034 } | 5040 } |
5035 | 5041 |
5036 Handle<Map> map = maps->at(maps->size() - 1).handle(); | 5042 Handle<Map> map = maps->at(maps->size() - 1).handle(); |
5037 __ CompareMap(reg, map); | 5043 __ CompareMap(reg, map); |
5038 if (instr->hydrogen()->has_migration_target()) { | 5044 if (instr->hydrogen()->HasMigrationTarget()) { |
5039 __ j(not_equal, deferred->entry()); | 5045 __ j(not_equal, deferred->entry()); |
5040 } else { | 5046 } else { |
5041 DeoptimizeIf(not_equal, instr->environment()); | 5047 DeoptimizeIf(not_equal, instr->environment()); |
5042 } | 5048 } |
5043 | 5049 |
5044 __ bind(&success); | 5050 __ bind(&success); |
5045 } | 5051 } |
5046 | 5052 |
5047 | 5053 |
5048 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { | 5054 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5698 __ bind(deferred->exit()); | 5704 __ bind(deferred->exit()); |
5699 __ bind(&done); | 5705 __ bind(&done); |
5700 } | 5706 } |
5701 | 5707 |
5702 | 5708 |
5703 #undef __ | 5709 #undef __ |
5704 | 5710 |
5705 } } // namespace v8::internal | 5711 } } // namespace v8::internal |
5706 | 5712 |
5707 #endif // V8_TARGET_ARCH_X64 | 5713 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |