| 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 2277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2288 | 2288 |
| 2289 | 2289 |
| 2290 void MacroAssembler::Move(Register dst, Register src) { | 2290 void MacroAssembler::Move(Register dst, Register src) { |
| 2291 if (!dst.is(src)) { | 2291 if (!dst.is(src)) { |
| 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 AllowDeferredHandleDereference 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 ASSERT(source->IsHeapObject()); |
| 2303 movq(dst, source, RelocInfo::EMBEDDED_OBJECT); | 2303 movq(dst, source, RelocInfo::EMBEDDED_OBJECT); |
| 2304 } | 2304 } |
| 2305 } | 2305 } |
| 2306 | 2306 |
| 2307 | 2307 |
| 2308 void MacroAssembler::Move(const Operand& dst, Handle<Object> source) { | 2308 void MacroAssembler::Move(const Operand& dst, Handle<Object> source) { |
| 2309 ALLOW_HANDLE_DEREF(isolate(), "smi check"); | 2309 AllowDeferredHandleDereference smi_check; |
| 2310 if (source->IsSmi()) { | 2310 if (source->IsSmi()) { |
| 2311 Move(dst, Smi::cast(*source)); | 2311 Move(dst, Smi::cast(*source)); |
| 2312 } else { | 2312 } else { |
| 2313 ASSERT(source->IsHeapObject()); | 2313 ASSERT(source->IsHeapObject()); |
| 2314 movq(kScratchRegister, source, RelocInfo::EMBEDDED_OBJECT); | 2314 movq(kScratchRegister, source, RelocInfo::EMBEDDED_OBJECT); |
| 2315 movq(dst, kScratchRegister); | 2315 movq(dst, kScratchRegister); |
| 2316 } | 2316 } |
| 2317 } | 2317 } |
| 2318 | 2318 |
| 2319 | 2319 |
| 2320 void MacroAssembler::Cmp(Register dst, Handle<Object> source) { | 2320 void MacroAssembler::Cmp(Register dst, Handle<Object> source) { |
| 2321 ALLOW_HANDLE_DEREF(isolate(), "smi check"); | 2321 AllowDeferredHandleDereference smi_check; |
| 2322 if (source->IsSmi()) { | 2322 if (source->IsSmi()) { |
| 2323 Cmp(dst, Smi::cast(*source)); | 2323 Cmp(dst, Smi::cast(*source)); |
| 2324 } else { | 2324 } else { |
| 2325 ASSERT(source->IsHeapObject()); | 2325 ASSERT(source->IsHeapObject()); |
| 2326 movq(kScratchRegister, source, RelocInfo::EMBEDDED_OBJECT); | 2326 movq(kScratchRegister, source, RelocInfo::EMBEDDED_OBJECT); |
| 2327 cmpq(dst, kScratchRegister); | 2327 cmpq(dst, kScratchRegister); |
| 2328 } | 2328 } |
| 2329 } | 2329 } |
| 2330 | 2330 |
| 2331 | 2331 |
| 2332 void MacroAssembler::Cmp(const Operand& dst, Handle<Object> source) { | 2332 void MacroAssembler::Cmp(const Operand& dst, Handle<Object> source) { |
| 2333 ALLOW_HANDLE_DEREF(isolate(), "smi check"); | 2333 AllowDeferredHandleDereference smi_check; |
| 2334 if (source->IsSmi()) { | 2334 if (source->IsSmi()) { |
| 2335 Cmp(dst, Smi::cast(*source)); | 2335 Cmp(dst, Smi::cast(*source)); |
| 2336 } else { | 2336 } else { |
| 2337 ASSERT(source->IsHeapObject()); | 2337 ASSERT(source->IsHeapObject()); |
| 2338 movq(kScratchRegister, source, RelocInfo::EMBEDDED_OBJECT); | 2338 movq(kScratchRegister, source, RelocInfo::EMBEDDED_OBJECT); |
| 2339 cmpq(dst, kScratchRegister); | 2339 cmpq(dst, kScratchRegister); |
| 2340 } | 2340 } |
| 2341 } | 2341 } |
| 2342 | 2342 |
| 2343 | 2343 |
| 2344 void MacroAssembler::Push(Handle<Object> source) { | 2344 void MacroAssembler::Push(Handle<Object> source) { |
| 2345 ALLOW_HANDLE_DEREF(isolate(), "smi check"); | 2345 AllowDeferredHandleDereference smi_check; |
| 2346 if (source->IsSmi()) { | 2346 if (source->IsSmi()) { |
| 2347 Push(Smi::cast(*source)); | 2347 Push(Smi::cast(*source)); |
| 2348 } else { | 2348 } else { |
| 2349 ASSERT(source->IsHeapObject()); | 2349 ASSERT(source->IsHeapObject()); |
| 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 ALLOW_HANDLE_DEREF(isolate(), "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<JSGlobalPropertyCell> cell = |
| 2361 isolate()->factory()->NewJSGlobalPropertyCell(object); | 2361 isolate()->factory()->NewJSGlobalPropertyCell(object); |
| 2362 movq(result, cell, RelocInfo::GLOBAL_PROPERTY_CELL); | 2362 movq(result, cell, RelocInfo::GLOBAL_PROPERTY_CELL); |
| 2363 movq(result, Operand(result, 0)); | 2363 movq(result, Operand(result, 0)); |
| 2364 } else { | 2364 } else { |
| 2365 Move(result, object); | 2365 Move(result, object); |
| 2366 } | 2366 } |
| 2367 } | 2367 } |
| 2368 | 2368 |
| 2369 | 2369 |
| 2370 void MacroAssembler::CmpHeapObject(Register reg, Handle<HeapObject> object) { | 2370 void MacroAssembler::CmpHeapObject(Register reg, Handle<HeapObject> object) { |
| 2371 ALLOW_HANDLE_DEREF(isolate(), "using raw address"); | 2371 AllowDeferredHandleDereference using_raw_address; |
| 2372 if (isolate()->heap()->InNewSpace(*object)) { | 2372 if (isolate()->heap()->InNewSpace(*object)) { |
| 2373 Handle<JSGlobalPropertyCell> cell = | 2373 Handle<JSGlobalPropertyCell> cell = |
| 2374 isolate()->factory()->NewJSGlobalPropertyCell(object); | 2374 isolate()->factory()->NewJSGlobalPropertyCell(object); |
| 2375 movq(kScratchRegister, cell, RelocInfo::GLOBAL_PROPERTY_CELL); | 2375 movq(kScratchRegister, cell, RelocInfo::GLOBAL_PROPERTY_CELL); |
| 2376 cmpq(reg, Operand(kScratchRegister, 0)); | 2376 cmpq(reg, Operand(kScratchRegister, 0)); |
| 2377 } else { | 2377 } else { |
| 2378 Cmp(reg, object); | 2378 Cmp(reg, object); |
| 2379 } | 2379 } |
| 2380 } | 2380 } |
| 2381 | 2381 |
| 2382 | 2382 |
| 2383 void MacroAssembler::PushHeapObject(Handle<HeapObject> object) { | 2383 void MacroAssembler::PushHeapObject(Handle<HeapObject> object) { |
| 2384 ALLOW_HANDLE_DEREF(isolate(), "using raw address"); | 2384 AllowDeferredHandleDereference using_raw_address; |
| 2385 if (isolate()->heap()->InNewSpace(*object)) { | 2385 if (isolate()->heap()->InNewSpace(*object)) { |
| 2386 Handle<JSGlobalPropertyCell> cell = | 2386 Handle<JSGlobalPropertyCell> cell = |
| 2387 isolate()->factory()->NewJSGlobalPropertyCell(object); | 2387 isolate()->factory()->NewJSGlobalPropertyCell(object); |
| 2388 movq(kScratchRegister, cell, RelocInfo::GLOBAL_PROPERTY_CELL); | 2388 movq(kScratchRegister, cell, RelocInfo::GLOBAL_PROPERTY_CELL); |
| 2389 movq(kScratchRegister, Operand(kScratchRegister, 0)); | 2389 movq(kScratchRegister, Operand(kScratchRegister, 0)); |
| 2390 push(kScratchRegister); | 2390 push(kScratchRegister); |
| 2391 } else { | 2391 } else { |
| 2392 Push(object); | 2392 Push(object); |
| 2393 } | 2393 } |
| 2394 } | 2394 } |
| 2395 | 2395 |
| 2396 | 2396 |
| 2397 void MacroAssembler::LoadGlobalCell(Register dst, | 2397 void MacroAssembler::LoadGlobalCell(Register dst, |
| 2398 Handle<JSGlobalPropertyCell> cell) { | 2398 Handle<JSGlobalPropertyCell> cell) { |
| 2399 if (dst.is(rax)) { | 2399 if (dst.is(rax)) { |
| 2400 ALLOW_HANDLE_DEREF(isolate(), "embedding raw address"); | 2400 AllowDeferredHandleDereference embedding_raw_address; |
| 2401 load_rax(cell.location(), RelocInfo::GLOBAL_PROPERTY_CELL); | 2401 load_rax(cell.location(), RelocInfo::GLOBAL_PROPERTY_CELL); |
| 2402 } else { | 2402 } else { |
| 2403 movq(dst, cell, RelocInfo::GLOBAL_PROPERTY_CELL); | 2403 movq(dst, cell, RelocInfo::GLOBAL_PROPERTY_CELL); |
| 2404 movq(dst, Operand(dst, 0)); | 2404 movq(dst, Operand(dst, 0)); |
| 2405 } | 2405 } |
| 2406 } | 2406 } |
| 2407 | 2407 |
| 2408 | 2408 |
| 2409 void MacroAssembler::Push(Smi* source) { | 2409 void MacroAssembler::Push(Smi* source) { |
| 2410 intptr_t smi = reinterpret_cast<intptr_t>(source); | 2410 intptr_t smi = reinterpret_cast<intptr_t>(source); |
| (...skipping 2271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4682 j(greater, &no_info_available); | 4682 j(greater, &no_info_available); |
| 4683 CompareRoot(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), | 4683 CompareRoot(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), |
| 4684 Heap::kAllocationSiteInfoMapRootIndex); | 4684 Heap::kAllocationSiteInfoMapRootIndex); |
| 4685 bind(&no_info_available); | 4685 bind(&no_info_available); |
| 4686 } | 4686 } |
| 4687 | 4687 |
| 4688 | 4688 |
| 4689 } } // namespace v8::internal | 4689 } } // namespace v8::internal |
| 4690 | 4690 |
| 4691 #endif // V8_TARGET_ARCH_X64 | 4691 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |