Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(302)

Side by Side Diff: src/ic/x64/handler-compiler-x64.cc

Issue 1636013002: Replace HeapType with a non-templated FieldType class. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix tracing of generalizations Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #if V8_TARGET_ARCH_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/ic/call-optimization.h" 7 #include "src/ic/call-optimization.h"
8 #include "src/ic/handler-compiler.h" 8 #include "src/ic/handler-compiler.h"
9 #include "src/ic/ic.h" 9 #include "src/ic/ic.h"
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 DCHECK(!map_reg.is(scratch)); 388 DCHECK(!map_reg.is(scratch));
389 DCHECK(!map_reg.is(value_reg)); 389 DCHECK(!map_reg.is(value_reg));
390 DCHECK(!value_reg.is(scratch)); 390 DCHECK(!value_reg.is(scratch));
391 __ LoadInstanceDescriptors(map_reg, scratch); 391 __ LoadInstanceDescriptors(map_reg, scratch);
392 __ movp(scratch, 392 __ movp(scratch,
393 FieldOperand(scratch, DescriptorArray::GetValueOffset(descriptor))); 393 FieldOperand(scratch, DescriptorArray::GetValueOffset(descriptor)));
394 __ cmpp(value_reg, scratch); 394 __ cmpp(value_reg, scratch);
395 __ j(not_equal, miss_label); 395 __ j(not_equal, miss_label);
396 } 396 }
397 397
398 398 void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(FieldType* field_type,
399 void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type,
400 Register value_reg, 399 Register value_reg,
401 Label* miss_label) { 400 Label* miss_label) {
402 Register map_reg = scratch1(); 401 Register map_reg = scratch1();
403 Register scratch = scratch2(); 402 Register scratch = scratch2();
404 DCHECK(!value_reg.is(map_reg)); 403 DCHECK(!value_reg.is(map_reg));
405 DCHECK(!value_reg.is(scratch)); 404 DCHECK(!value_reg.is(scratch));
406 __ JumpIfSmi(value_reg, miss_label); 405 __ JumpIfSmi(value_reg, miss_label);
407 HeapType::Iterator<Map> it = field_type->Classes(); 406 FieldType::Iterator it = field_type->Classes();
408 if (!it.Done()) { 407 if (!it.Done()) {
409 Label do_store; 408 Label do_store;
410 __ movp(map_reg, FieldOperand(value_reg, HeapObject::kMapOffset)); 409 __ movp(map_reg, FieldOperand(value_reg, HeapObject::kMapOffset));
411 while (true) { 410 while (true) {
412 __ CmpWeakValue(map_reg, Map::WeakCellForMap(it.Current()), scratch); 411 __ CmpWeakValue(map_reg, Map::WeakCellForMap(it.Current()), scratch);
413 it.Advance(); 412 it.Advance();
414 if (it.Done()) { 413 if (it.Done()) {
415 __ j(not_equal, miss_label); 414 __ j(not_equal, miss_label);
416 break; 415 break;
417 } 416 }
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 // Return the generated code. 808 // Return the generated code.
810 return GetCode(kind(), Code::NORMAL, name); 809 return GetCode(kind(), Code::NORMAL, name);
811 } 810 }
812 811
813 812
814 #undef __ 813 #undef __
815 } // namespace internal 814 } // namespace internal
816 } // namespace v8 815 } // namespace v8
817 816
818 #endif // V8_TARGET_ARCH_X64 817 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698