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

Side by Side Diff: src/arm64/stub-cache-arm64.cc

Issue 238773002: Reland "Track field types.". (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Properly handlified... Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « src/arm64/lithium-codegen-arm64.cc ('k') | src/deoptimizer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 ASSERT(!representation.IsNone()); 385 ASSERT(!representation.IsNone());
386 386
387 if (details.type() == CONSTANT) { 387 if (details.type() == CONSTANT) {
388 Handle<Object> constant(descriptors->GetValue(descriptor), masm->isolate()); 388 Handle<Object> constant(descriptors->GetValue(descriptor), masm->isolate());
389 __ LoadObject(scratch1, constant); 389 __ LoadObject(scratch1, constant);
390 __ Cmp(value_reg, scratch1); 390 __ Cmp(value_reg, scratch1);
391 __ B(ne, miss_label); 391 __ B(ne, miss_label);
392 } else if (representation.IsSmi()) { 392 } else if (representation.IsSmi()) {
393 __ JumpIfNotSmi(value_reg, miss_label); 393 __ JumpIfNotSmi(value_reg, miss_label);
394 } else if (representation.IsHeapObject()) { 394 } else if (representation.IsHeapObject()) {
395 __ JumpIfSmi(value_reg, miss_label); 395 HeapType* field_type = descriptors->GetFieldType(descriptor);
396 if (field_type->IsClass()) {
397 __ CheckMap(value_reg, scratch1, field_type->AsClass(),
398 miss_label, DO_SMI_CHECK);
399 } else {
400 ASSERT(HeapType::Any()->Is(field_type));
401 __ JumpIfSmi(value_reg, miss_label);
402 }
396 } else if (representation.IsDouble()) { 403 } else if (representation.IsDouble()) {
397 UseScratchRegisterScope temps(masm); 404 UseScratchRegisterScope temps(masm);
398 DoubleRegister temp_double = temps.AcquireD(); 405 DoubleRegister temp_double = temps.AcquireD();
399 __ SmiUntagToDouble(temp_double, value_reg, kSpeculativeUntag); 406 __ SmiUntagToDouble(temp_double, value_reg, kSpeculativeUntag);
400 407
401 Label do_store; 408 Label do_store;
402 __ JumpIfSmi(value_reg, &do_store); 409 __ JumpIfSmi(value_reg, &do_store);
403 410
404 __ CheckMap(value_reg, scratch1, Heap::kHeapNumberMapRootIndex, 411 __ CheckMap(value_reg, scratch1, Heap::kHeapNumberMapRootIndex,
405 miss_label, DONT_DO_SMI_CHECK); 412 miss_label, DONT_DO_SMI_CHECK);
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 // Adjust for the number of properties stored in the object. Even in the 541 // Adjust for the number of properties stored in the object. Even in the
535 // face of a transition we can use the old map here because the size of the 542 // face of a transition we can use the old map here because the size of the
536 // object and the number of in-object properties is not going to change. 543 // object and the number of in-object properties is not going to change.
537 index -= object->map()->inobject_properties(); 544 index -= object->map()->inobject_properties();
538 545
539 Representation representation = lookup->representation(); 546 Representation representation = lookup->representation();
540 ASSERT(!representation.IsNone()); 547 ASSERT(!representation.IsNone());
541 if (representation.IsSmi()) { 548 if (representation.IsSmi()) {
542 __ JumpIfNotSmi(value_reg, miss_label); 549 __ JumpIfNotSmi(value_reg, miss_label);
543 } else if (representation.IsHeapObject()) { 550 } else if (representation.IsHeapObject()) {
544 __ JumpIfSmi(value_reg, miss_label); 551 HeapType* field_type = lookup->GetFieldType();
552 if (field_type->IsClass()) {
553 __ CheckMap(value_reg, scratch1, field_type->AsClass(),
554 miss_label, DO_SMI_CHECK);
555 } else {
556 ASSERT(HeapType::Any()->Is(field_type));
557 __ JumpIfSmi(value_reg, miss_label);
558 }
545 } else if (representation.IsDouble()) { 559 } else if (representation.IsDouble()) {
546 UseScratchRegisterScope temps(masm); 560 UseScratchRegisterScope temps(masm);
547 DoubleRegister temp_double = temps.AcquireD(); 561 DoubleRegister temp_double = temps.AcquireD();
548 562
549 __ SmiUntagToDouble(temp_double, value_reg, kSpeculativeUntag); 563 __ SmiUntagToDouble(temp_double, value_reg, kSpeculativeUntag);
550 564
551 // Load the double storage. 565 // Load the double storage.
552 if (index < 0) { 566 if (index < 0) {
553 int offset = (index * kPointerSize) + object->map()->instance_size(); 567 int offset = (index * kPointerSize) + object->map()->instance_size();
554 __ Ldr(scratch1, FieldMemOperand(receiver_reg, offset)); 568 __ Ldr(scratch1, FieldMemOperand(receiver_reg, offset));
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after
1485 1499
1486 // Miss case, call the runtime. 1500 // Miss case, call the runtime.
1487 __ Bind(&miss); 1501 __ Bind(&miss);
1488 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 1502 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
1489 } 1503 }
1490 1504
1491 1505
1492 } } // namespace v8::internal 1506 } } // namespace v8::internal
1493 1507
1494 #endif // V8_TARGET_ARCH_ARM64 1508 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm64/lithium-codegen-arm64.cc ('k') | src/deoptimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698