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

Unified Diff: src/a64/stub-cache-a64.cc

Issue 167303005: Track field types. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Support transitions in LookupResult. Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/arm/stub-cache-arm.cc » ('j') | src/hydrogen.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/a64/stub-cache-a64.cc
diff --git a/src/a64/stub-cache-a64.cc b/src/a64/stub-cache-a64.cc
index 291da65d44f4113e2c9ff9f226a766571238237a..33298168c7797c9bb8b204c0180e0150f9ac4e44 100644
--- a/src/a64/stub-cache-a64.cc
+++ b/src/a64/stub-cache-a64.cc
@@ -392,7 +392,13 @@ void StoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm,
} else if (representation.IsSmi()) {
__ JumpIfNotSmi(value_reg, miss_label);
} else if (representation.IsHeapObject()) {
- __ JumpIfSmi(value_reg, miss_label);
+ HeapType* field_type = descriptors->GetFieldType(descriptor);
+ if (field_type->IsClass()) {
+ __ CheckMap(value_reg, scratch1, field_type->AsClass(),
+ miss_label, DO_SMI_CHECK);
+ } else {
+ __ JumpIfSmi(value_reg, miss_label);
+ }
} else if (representation.IsDouble()) {
Label do_store, heap_number;
__ AllocateHeapNumber(storage_reg, slow, scratch1, scratch2);
@@ -553,7 +559,13 @@ void StoreStubCompiler::GenerateStoreField(MacroAssembler* masm,
if (representation.IsSmi()) {
__ JumpIfNotSmi(value_reg, miss_label);
} else if (representation.IsHeapObject()) {
- __ JumpIfSmi(value_reg, miss_label);
+ HeapType* field_type = lookup->GetFieldType();
+ if (field_type->IsClass()) {
+ __ CheckMap(value_reg, scratch1, field_type->AsClass(),
+ miss_label, DO_SMI_CHECK);
+ } else {
+ __ JumpIfSmi(value_reg, miss_label);
+ }
} else if (representation.IsDouble()) {
// Load the double storage.
if (index < 0) {
« no previous file with comments | « no previous file | src/arm/stub-cache-arm.cc » ('j') | src/hydrogen.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698