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

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 35413006: Correct handling of arrays with callbacks in the prototype chain. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: ports. Created 7 years, 1 month 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 4949 matching lines...) Expand 10 before | Expand all | Expand 10 after
4960 PushSafepointRegisters(); 4960 PushSafepointRegisters();
4961 PrepareCallCFunction(3); 4961 PrepareCallCFunction(3);
4962 movq(arg_reg_2, object); 4962 movq(arg_reg_2, object);
4963 movq(arg_reg_3, Immediate(object_size)); 4963 movq(arg_reg_3, Immediate(object_size));
4964 movq(arg_reg_1, isolate, RelocInfo::EXTERNAL_REFERENCE); 4964 movq(arg_reg_1, isolate, RelocInfo::EXTERNAL_REFERENCE);
4965 CallCFunction( 4965 CallCFunction(
4966 ExternalReference::record_object_allocation_function(isolate), 3); 4966 ExternalReference::record_object_allocation_function(isolate), 3);
4967 PopSafepointRegisters(); 4967 PopSafepointRegisters();
4968 } 4968 }
4969 4969
4970 void MacroAssembler::HasDictionaryInPrototypeChain(
4971 Register object,
4972 Register elements,
4973 Label* found) {
4974 Register temp = elements;
4975 Label loop_again;
4976
4977 // scratch contained elements pointer.
4978 movq(temp, object);
4979
4980 // Loop based on the map going up the prototype chain.
4981 bind(&loop_again);
4982 movq(temp, FieldOperand(temp, HeapObject::kMapOffset));
4983 movq(kScratchRegister, FieldOperand(temp, Map::kBitField2Offset));
4984 and_(kScratchRegister, Immediate(Map::kElementsKindMask));
4985 shr(kScratchRegister, Immediate(Map::kElementsKindShift));
4986 cmpq(kScratchRegister, Immediate(DICTIONARY_ELEMENTS));
4987 j(equal, found);
4988 movq(temp, FieldOperand(temp, Map::kPrototypeOffset));
4989 CompareRoot(temp, Heap::kNullValueRootIndex);
4990 j(not_equal, &loop_again);
4991
4992 // Restore elements
4993 movq(elements, FieldOperand(object, JSObject::kElementsOffset));
Michael Starzinger 2013/11/04 15:18:17 Instead of specializing the semantics of this func
mvstanton 2013/11/04 16:30:05 Thx, done.
4994 }
4995
4970 4996
4971 } } // namespace v8::internal 4997 } } // namespace v8::internal
4972 4998
4973 #endif // V8_TARGET_ARCH_X64 4999 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698