Index: src/x64/stub-cache-x64.cc |
diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc |
index a28dbbf0272144f9db8f630a23d5c567be77b295..a938787e3c3cc2059c6fdb996030e9eeed7840c7 100644 |
--- a/src/x64/stub-cache-x64.cc |
+++ b/src/x64/stub-cache-x64.cc |
@@ -1,4 +1,4 @@ |
-// Copyright 2011 the V8 project authors. All rights reserved. |
+// Copyright 2012 the V8 project authors. All rights reserved. |
// Redistribution and use in source and binary forms, with or without |
// modification, are permitted provided that the following conditions are |
// met: |
@@ -691,13 +691,9 @@ void StubCompiler::GenerateStoreField(MacroAssembler* masm, |
Register name_reg, |
Register scratch, |
Label* miss_label) { |
- // Check that the object isn't a smi. |
- __ JumpIfSmi(receiver_reg, miss_label); |
- |
// Check that the map of the object hasn't changed. |
- __ Cmp(FieldOperand(receiver_reg, HeapObject::kMapOffset), |
- Handle<Map>(object->map())); |
- __ j(not_equal, miss_label); |
+ __ CheckMap(receiver_reg, Handle<Map>(object->map()), |
+ miss_label, DO_SMI_CHECK, ALLOW_ELEMENT_TRANSITION_MAPS); |
// Perform global security token check if needed. |
if (object->IsJSGlobalProxy()) { |
@@ -864,12 +860,10 @@ Register StubCompiler::CheckPrototypes(Handle<JSObject> object, |
if (in_new_space) { |
// Save the map in scratch1 for later. |
__ movq(scratch1, FieldOperand(reg, HeapObject::kMapOffset)); |
- __ Cmp(scratch1, current_map); |
- } else { |
- __ Cmp(FieldOperand(reg, HeapObject::kMapOffset), current_map); |
} |
- // Branch on the result of the map check. |
- __ j(not_equal, miss); |
+ __ CheckMap(reg, Handle<Map>(current_map), |
+ miss, DONT_DO_SMI_CHECK, ALLOW_ELEMENT_TRANSITION_MAPS); |
+ |
// Check access rights to the global object. This has to happen after |
// the map check so that we know that the object is actually a global |
// object. |
@@ -901,8 +895,8 @@ Register StubCompiler::CheckPrototypes(Handle<JSObject> object, |
LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); |
// Check the holder map. |
- __ Cmp(FieldOperand(reg, HeapObject::kMapOffset), Handle<Map>(holder->map())); |
- __ j(not_equal, miss); |
+ __ CheckMap(reg, Handle<Map>(holder->map()), |
+ miss, DONT_DO_SMI_CHECK, ALLOW_ELEMENT_TRANSITION_MAPS); |
// Perform security check for access to the global object. |
ASSERT(current->IsJSGlobalProxy() || !current->IsAccessCheckNeeded()); |
@@ -2251,13 +2245,9 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback( |
// ----------------------------------- |
Label miss; |
- // Check that the object isn't a smi. |
- __ JumpIfSmi(rdx, &miss); |
- |
// Check that the map of the object hasn't changed. |
- __ Cmp(FieldOperand(rdx, HeapObject::kMapOffset), |
- Handle<Map>(object->map())); |
- __ j(not_equal, &miss); |
+ __ CheckMap(rdx, Handle<Map>(object->map()), &miss, |
+ DO_SMI_CHECK, ALLOW_ELEMENT_TRANSITION_MAPS); |
// Perform global security token check if needed. |
if (object->IsJSGlobalProxy()) { |
@@ -2301,13 +2291,9 @@ Handle<Code> StoreStubCompiler::CompileStoreInterceptor( |
// ----------------------------------- |
Label miss; |
- // Check that the object isn't a smi. |
- __ JumpIfSmi(rdx, &miss); |
- |
// Check that the map of the object hasn't changed. |
- __ Cmp(FieldOperand(rdx, HeapObject::kMapOffset), |
- Handle<Map>(receiver->map())); |
- __ j(not_equal, &miss); |
+ __ CheckMap(rdx, Handle<Map>(receiver->map()), &miss, |
+ DO_SMI_CHECK, ALLOW_ELEMENT_TRANSITION_MAPS); |
// Perform global security token check if needed. |
if (receiver->IsJSGlobalProxy()) { |