OLD | NEW |
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 2339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2350 movq(kScratchRegister, source, RelocInfo::EMBEDDED_OBJECT); | 2350 movq(kScratchRegister, source, RelocInfo::EMBEDDED_OBJECT); |
2351 push(kScratchRegister); | 2351 push(kScratchRegister); |
2352 } | 2352 } |
2353 } | 2353 } |
2354 | 2354 |
2355 | 2355 |
2356 void MacroAssembler::LoadHeapObject(Register result, | 2356 void MacroAssembler::LoadHeapObject(Register result, |
2357 Handle<HeapObject> object) { | 2357 Handle<HeapObject> object) { |
2358 AllowDeferredHandleDereference using_raw_address; | 2358 AllowDeferredHandleDereference using_raw_address; |
2359 if (isolate()->heap()->InNewSpace(*object)) { | 2359 if (isolate()->heap()->InNewSpace(*object)) { |
2360 Handle<JSGlobalPropertyCell> cell = | 2360 Handle<Cell> cell = isolate()->factory()->NewCell(object); |
2361 isolate()->factory()->NewJSGlobalPropertyCell(object); | 2361 movq(result, cell, RelocInfo::CELL); |
2362 movq(result, cell, RelocInfo::GLOBAL_PROPERTY_CELL); | |
2363 movq(result, Operand(result, 0)); | 2362 movq(result, Operand(result, 0)); |
2364 } else { | 2363 } else { |
2365 Move(result, object); | 2364 Move(result, object); |
2366 } | 2365 } |
2367 } | 2366 } |
2368 | 2367 |
2369 | 2368 |
2370 void MacroAssembler::CmpHeapObject(Register reg, Handle<HeapObject> object) { | 2369 void MacroAssembler::CmpHeapObject(Register reg, Handle<HeapObject> object) { |
2371 AllowDeferredHandleDereference using_raw_address; | 2370 AllowDeferredHandleDereference using_raw_address; |
2372 if (isolate()->heap()->InNewSpace(*object)) { | 2371 if (isolate()->heap()->InNewSpace(*object)) { |
2373 Handle<JSGlobalPropertyCell> cell = | 2372 Handle<Cell> cell = isolate()->factory()->NewCell(object); |
2374 isolate()->factory()->NewJSGlobalPropertyCell(object); | 2373 movq(kScratchRegister, cell, RelocInfo::CELL); |
2375 movq(kScratchRegister, cell, RelocInfo::GLOBAL_PROPERTY_CELL); | |
2376 cmpq(reg, Operand(kScratchRegister, 0)); | 2374 cmpq(reg, Operand(kScratchRegister, 0)); |
2377 } else { | 2375 } else { |
2378 Cmp(reg, object); | 2376 Cmp(reg, object); |
2379 } | 2377 } |
2380 } | 2378 } |
2381 | 2379 |
2382 | 2380 |
2383 void MacroAssembler::PushHeapObject(Handle<HeapObject> object) { | 2381 void MacroAssembler::PushHeapObject(Handle<HeapObject> object) { |
2384 AllowDeferredHandleDereference using_raw_address; | 2382 AllowDeferredHandleDereference using_raw_address; |
2385 if (isolate()->heap()->InNewSpace(*object)) { | 2383 if (isolate()->heap()->InNewSpace(*object)) { |
2386 Handle<JSGlobalPropertyCell> cell = | 2384 Handle<Cell> cell = isolate()->factory()->NewCell(object); |
2387 isolate()->factory()->NewJSGlobalPropertyCell(object); | 2385 movq(kScratchRegister, cell, RelocInfo::CELL); |
2388 movq(kScratchRegister, cell, RelocInfo::GLOBAL_PROPERTY_CELL); | |
2389 movq(kScratchRegister, Operand(kScratchRegister, 0)); | 2386 movq(kScratchRegister, Operand(kScratchRegister, 0)); |
2390 push(kScratchRegister); | 2387 push(kScratchRegister); |
2391 } else { | 2388 } else { |
2392 Push(object); | 2389 Push(object); |
2393 } | 2390 } |
2394 } | 2391 } |
2395 | 2392 |
2396 | 2393 |
2397 void MacroAssembler::LoadGlobalCell(Register dst, | 2394 void MacroAssembler::LoadGlobalCell(Register dst, Handle<Cell> cell) { |
2398 Handle<JSGlobalPropertyCell> cell) { | |
2399 if (dst.is(rax)) { | 2395 if (dst.is(rax)) { |
2400 AllowDeferredHandleDereference embedding_raw_address; | 2396 AllowDeferredHandleDereference embedding_raw_address; |
2401 load_rax(cell.location(), RelocInfo::GLOBAL_PROPERTY_CELL); | 2397 load_rax(cell.location(), RelocInfo::CELL); |
2402 } else { | 2398 } else { |
2403 movq(dst, cell, RelocInfo::GLOBAL_PROPERTY_CELL); | 2399 movq(dst, cell, RelocInfo::CELL); |
2404 movq(dst, Operand(dst, 0)); | 2400 movq(dst, Operand(dst, 0)); |
2405 } | 2401 } |
2406 } | 2402 } |
2407 | 2403 |
2408 | 2404 |
2409 void MacroAssembler::Push(Smi* source) { | 2405 void MacroAssembler::Push(Smi* source) { |
2410 intptr_t smi = reinterpret_cast<intptr_t>(source); | 2406 intptr_t smi = reinterpret_cast<intptr_t>(source); |
2411 if (is_int32(smi)) { | 2407 if (is_int32(smi)) { |
2412 push(Immediate(static_cast<int32_t>(smi))); | 2408 push(Immediate(static_cast<int32_t>(smi))); |
2413 } else { | 2409 } else { |
(...skipping 2268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4682 j(greater, &no_info_available); | 4678 j(greater, &no_info_available); |
4683 CompareRoot(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), | 4679 CompareRoot(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), |
4684 Heap::kAllocationSiteInfoMapRootIndex); | 4680 Heap::kAllocationSiteInfoMapRootIndex); |
4685 bind(&no_info_available); | 4681 bind(&no_info_available); |
4686 } | 4682 } |
4687 | 4683 |
4688 | 4684 |
4689 } } // namespace v8::internal | 4685 } } // namespace v8::internal |
4690 | 4686 |
4691 #endif // V8_TARGET_ARCH_X64 | 4687 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |