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

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

Issue 15779004: Fix embedded new-space pointer in LCmpObjectEqAndBranch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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
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 2281 matching lines...) Expand 10 before | Expand all | Expand 10 after
2292 movq(dst, src); 2292 movq(dst, src);
2293 } 2293 }
2294 } 2294 }
2295 2295
2296 2296
2297 void MacroAssembler::Move(Register dst, Handle<Object> source) { 2297 void MacroAssembler::Move(Register dst, Handle<Object> source) {
2298 ALLOW_HANDLE_DEREF(isolate(), "smi check"); 2298 ALLOW_HANDLE_DEREF(isolate(), "smi check");
2299 if (source->IsSmi()) { 2299 if (source->IsSmi()) {
2300 Move(dst, Smi::cast(*source)); 2300 Move(dst, Smi::cast(*source));
2301 } else { 2301 } else {
2302 ASSERT(source->IsHeapObject());
2302 movq(dst, source, RelocInfo::EMBEDDED_OBJECT); 2303 movq(dst, source, RelocInfo::EMBEDDED_OBJECT);
2303 } 2304 }
2304 } 2305 }
2305 2306
2306 2307
2307 void MacroAssembler::Move(const Operand& dst, Handle<Object> source) { 2308 void MacroAssembler::Move(const Operand& dst, Handle<Object> source) {
2308 ALLOW_HANDLE_DEREF(isolate(), "smi check"); 2309 ALLOW_HANDLE_DEREF(isolate(), "smi check");
2309 if (source->IsSmi()) { 2310 if (source->IsSmi()) {
2310 Move(dst, Smi::cast(*source)); 2311 Move(dst, Smi::cast(*source));
2311 } else { 2312 } else {
2313 ASSERT(source->IsHeapObject());
2312 movq(kScratchRegister, source, RelocInfo::EMBEDDED_OBJECT); 2314 movq(kScratchRegister, source, RelocInfo::EMBEDDED_OBJECT);
2313 movq(dst, kScratchRegister); 2315 movq(dst, kScratchRegister);
2314 } 2316 }
2315 } 2317 }
2316 2318
2317 2319
2318 void MacroAssembler::Cmp(Register dst, Handle<Object> source) { 2320 void MacroAssembler::Cmp(Register dst, Handle<Object> source) {
2319 ALLOW_HANDLE_DEREF(isolate(), "smi check"); 2321 ALLOW_HANDLE_DEREF(isolate(), "smi check");
2320 if (source->IsSmi()) { 2322 if (source->IsSmi()) {
2321 Cmp(dst, Smi::cast(*source)); 2323 Cmp(dst, Smi::cast(*source));
2322 } else { 2324 } else {
2323 Move(kScratchRegister, source); 2325 ASSERT(source->IsHeapObject());
2326 movq(kScratchRegister, source, RelocInfo::EMBEDDED_OBJECT);
2324 cmpq(dst, kScratchRegister); 2327 cmpq(dst, kScratchRegister);
2325 } 2328 }
2326 } 2329 }
2327 2330
2328 2331
2329 void MacroAssembler::Cmp(const Operand& dst, Handle<Object> source) { 2332 void MacroAssembler::Cmp(const Operand& dst, Handle<Object> source) {
2330 ALLOW_HANDLE_DEREF(isolate(), "smi check"); 2333 ALLOW_HANDLE_DEREF(isolate(), "smi check");
2331 if (source->IsSmi()) { 2334 if (source->IsSmi()) {
2332 Cmp(dst, Smi::cast(*source)); 2335 Cmp(dst, Smi::cast(*source));
2333 } else { 2336 } else {
(...skipping 23 matching lines...) Expand all
2357 Handle<JSGlobalPropertyCell> cell = 2360 Handle<JSGlobalPropertyCell> cell =
2358 isolate()->factory()->NewJSGlobalPropertyCell(object); 2361 isolate()->factory()->NewJSGlobalPropertyCell(object);
2359 movq(result, cell, RelocInfo::GLOBAL_PROPERTY_CELL); 2362 movq(result, cell, RelocInfo::GLOBAL_PROPERTY_CELL);
2360 movq(result, Operand(result, 0)); 2363 movq(result, Operand(result, 0));
2361 } else { 2364 } else {
2362 Move(result, object); 2365 Move(result, object);
2363 } 2366 }
2364 } 2367 }
2365 2368
2366 2369
2370 void MacroAssembler::CmpHeapObject(Register reg, Handle<HeapObject> object) {
2371 ALLOW_HANDLE_DEREF(isolate(), "using raw address");
2372 if (isolate()->heap()->InNewSpace(*object)) {
2373 Handle<JSGlobalPropertyCell> cell =
2374 isolate()->factory()->NewJSGlobalPropertyCell(object);
2375 movq(kScratchRegister, cell, RelocInfo::GLOBAL_PROPERTY_CELL);
2376 cmpq(reg, Operand(kScratchRegister, 0));
2377 } else {
2378 Cmp(reg, object);
2379 }
2380 }
2381
2382
2367 void MacroAssembler::PushHeapObject(Handle<HeapObject> object) { 2383 void MacroAssembler::PushHeapObject(Handle<HeapObject> object) {
2368 ALLOW_HANDLE_DEREF(isolate(), "using raw address"); 2384 ALLOW_HANDLE_DEREF(isolate(), "using raw address");
2369 if (isolate()->heap()->InNewSpace(*object)) { 2385 if (isolate()->heap()->InNewSpace(*object)) {
2370 Handle<JSGlobalPropertyCell> cell = 2386 Handle<JSGlobalPropertyCell> cell =
2371 isolate()->factory()->NewJSGlobalPropertyCell(object); 2387 isolate()->factory()->NewJSGlobalPropertyCell(object);
2372 movq(kScratchRegister, cell, RelocInfo::GLOBAL_PROPERTY_CELL); 2388 movq(kScratchRegister, cell, RelocInfo::GLOBAL_PROPERTY_CELL);
2373 movq(kScratchRegister, Operand(kScratchRegister, 0)); 2389 movq(kScratchRegister, Operand(kScratchRegister, 0));
2374 push(kScratchRegister); 2390 push(kScratchRegister);
2375 } else { 2391 } else {
2376 Push(object); 2392 Push(object);
(...skipping 2289 matching lines...) Expand 10 before | Expand all | Expand 10 after
4666 j(greater, &no_info_available); 4682 j(greater, &no_info_available);
4667 CompareRoot(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), 4683 CompareRoot(MemOperand(scratch_reg, -AllocationSiteInfo::kSize),
4668 Heap::kAllocationSiteInfoMapRootIndex); 4684 Heap::kAllocationSiteInfoMapRootIndex);
4669 bind(&no_info_available); 4685 bind(&no_info_available);
4670 } 4686 }
4671 4687
4672 4688
4673 } } // namespace v8::internal 4689 } } // namespace v8::internal
4674 4690
4675 #endif // V8_TARGET_ARCH_X64 4691 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698