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

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

Issue 7039004: Add enumeration to specify if smi check needed (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: move to common header Created 9 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
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 2543 matching lines...) Expand 10 before | Expand all | Expand 10 after
2554 2554
2555 void MacroAssembler::CmpInstanceType(Register map, InstanceType type) { 2555 void MacroAssembler::CmpInstanceType(Register map, InstanceType type) {
2556 cmpb(FieldOperand(map, Map::kInstanceTypeOffset), 2556 cmpb(FieldOperand(map, Map::kInstanceTypeOffset),
2557 Immediate(static_cast<int8_t>(type))); 2557 Immediate(static_cast<int8_t>(type)));
2558 } 2558 }
2559 2559
2560 2560
2561 void MacroAssembler::CheckMap(Register obj, 2561 void MacroAssembler::CheckMap(Register obj,
2562 Handle<Map> map, 2562 Handle<Map> map,
2563 Label* fail, 2563 Label* fail,
2564 bool is_heap_object) { 2564 SmiCheckType smi_check_type) {
2565 if (!is_heap_object) { 2565 if (smi_check_type == DO_SMI_CHECK) {
2566 JumpIfSmi(obj, fail); 2566 JumpIfSmi(obj, fail);
2567 } 2567 }
2568 Cmp(FieldOperand(obj, HeapObject::kMapOffset), map); 2568 Cmp(FieldOperand(obj, HeapObject::kMapOffset), map);
2569 j(not_equal, fail); 2569 j(not_equal, fail);
2570 } 2570 }
2571 2571
2572 2572
2573 void MacroAssembler::ClampUint8(Register reg) { 2573 void MacroAssembler::ClampUint8(Register reg) {
2574 Label done; 2574 Label done;
2575 testl(reg, Immediate(0xFFFFFF00)); 2575 testl(reg, Immediate(0xFFFFFF00));
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after
3595 movq(function, Operand(function, Context::SlotOffset(index))); 3595 movq(function, Operand(function, Context::SlotOffset(index)));
3596 } 3596 }
3597 3597
3598 3598
3599 void MacroAssembler::LoadGlobalFunctionInitialMap(Register function, 3599 void MacroAssembler::LoadGlobalFunctionInitialMap(Register function,
3600 Register map) { 3600 Register map) {
3601 // Load the initial map. The global functions all have initial maps. 3601 // Load the initial map. The global functions all have initial maps.
3602 movq(map, FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); 3602 movq(map, FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset));
3603 if (emit_debug_code()) { 3603 if (emit_debug_code()) {
3604 Label ok, fail; 3604 Label ok, fail;
3605 CheckMap(map, isolate()->factory()->meta_map(), &fail, false); 3605 CheckMap(map, isolate()->factory()->meta_map(), &fail, DO_SMI_CHECK);
3606 jmp(&ok); 3606 jmp(&ok);
3607 bind(&fail); 3607 bind(&fail);
3608 Abort("Global functions must have initial map"); 3608 Abort("Global functions must have initial map");
3609 bind(&ok); 3609 bind(&ok);
3610 } 3610 }
3611 } 3611 }
3612 3612
3613 3613
3614 int MacroAssembler::ArgumentStackSlotsForCFunctionCall(int num_arguments) { 3614 int MacroAssembler::ArgumentStackSlotsForCFunctionCall(int num_arguments) {
3615 // On Windows 64 stack slots are reserved by the caller for all arguments 3615 // On Windows 64 stack slots are reserved by the caller for all arguments
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
3684 CPU::FlushICache(address_, size_); 3684 CPU::FlushICache(address_, size_);
3685 3685
3686 // Check that the code was patched as expected. 3686 // Check that the code was patched as expected.
3687 ASSERT(masm_.pc_ == address_ + size_); 3687 ASSERT(masm_.pc_ == address_ + size_);
3688 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); 3688 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
3689 } 3689 }
3690 3690
3691 } } // namespace v8::internal 3691 } } // namespace v8::internal
3692 3692
3693 #endif // V8_TARGET_ARCH_X64 3693 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698