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

Side by Side Diff: src/a64/code-stubs-a64.cc

Issue 194473005: A64: Rename k<Y>RegSize to k<Y>RegSizeInBits, and k<Y>RegSizeInBytes to k<Y>RegSize. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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/a64/code-stubs-a64.h ('k') | src/a64/codegen-a64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after
1497 // ExitFrame::GetStateForFramePointer. 1497 // ExitFrame::GetStateForFramePointer.
1498 Label return_location; 1498 Label return_location;
1499 __ Adr(x12, &return_location); 1499 __ Adr(x12, &return_location);
1500 __ Poke(x12, 0); 1500 __ Poke(x12, 0);
1501 if (__ emit_debug_code()) { 1501 if (__ emit_debug_code()) {
1502 // Verify that the slot below fp[kSPOffset]-8 points to the return location 1502 // Verify that the slot below fp[kSPOffset]-8 points to the return location
1503 // (currently in x12). 1503 // (currently in x12).
1504 UseScratchRegisterScope temps(masm); 1504 UseScratchRegisterScope temps(masm);
1505 Register temp = temps.AcquireX(); 1505 Register temp = temps.AcquireX();
1506 __ Ldr(temp, MemOperand(fp, ExitFrameConstants::kSPOffset)); 1506 __ Ldr(temp, MemOperand(fp, ExitFrameConstants::kSPOffset));
1507 __ Ldr(temp, MemOperand(temp, -static_cast<int64_t>(kXRegSizeInBytes))); 1507 __ Ldr(temp, MemOperand(temp, -static_cast<int64_t>(kXRegSize)));
1508 __ Cmp(temp, x12); 1508 __ Cmp(temp, x12);
1509 __ Check(eq, kReturnAddressNotFoundInFrame); 1509 __ Check(eq, kReturnAddressNotFoundInFrame);
1510 } 1510 }
1511 1511
1512 // Call the builtin. 1512 // Call the builtin.
1513 __ Blr(target); 1513 __ Blr(target);
1514 __ Bind(&return_location); 1514 __ Bind(&return_location);
1515 const Register& result = x0; 1515 const Register& result = x0;
1516 1516
1517 if (always_allocate) { 1517 if (always_allocate) {
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after
2316 // Load and untag the context. 2316 // Load and untag the context.
2317 STATIC_ASSERT((kSmiShift / kBitsPerByte) == 4); 2317 STATIC_ASSERT((kSmiShift / kBitsPerByte) == 4);
2318 __ Ldr(w11, MemOperand(caller_fp, StandardFrameConstants::kContextOffset + 2318 __ Ldr(w11, MemOperand(caller_fp, StandardFrameConstants::kContextOffset +
2319 (kSmiShift / kBitsPerByte))); 2319 (kSmiShift / kBitsPerByte)));
2320 __ Cmp(w11, StackFrame::ARGUMENTS_ADAPTOR); 2320 __ Cmp(w11, StackFrame::ARGUMENTS_ADAPTOR);
2321 __ B(ne, &runtime); 2321 __ B(ne, &runtime);
2322 2322
2323 // Patch the arguments.length and parameters pointer in the current frame. 2323 // Patch the arguments.length and parameters pointer in the current frame.
2324 __ Ldr(x11, MemOperand(caller_fp, 2324 __ Ldr(x11, MemOperand(caller_fp,
2325 ArgumentsAdaptorFrameConstants::kLengthOffset)); 2325 ArgumentsAdaptorFrameConstants::kLengthOffset));
2326 __ Poke(x11, 0 * kXRegSizeInBytes); 2326 __ Poke(x11, 0 * kXRegSize);
2327 __ Add(x10, caller_fp, Operand::UntagSmiAndScale(x11, kPointerSizeLog2)); 2327 __ Add(x10, caller_fp, Operand::UntagSmiAndScale(x11, kPointerSizeLog2));
2328 __ Add(x10, x10, Operand(StandardFrameConstants::kCallerSPOffset)); 2328 __ Add(x10, x10, Operand(StandardFrameConstants::kCallerSPOffset));
2329 __ Poke(x10, 1 * kXRegSizeInBytes); 2329 __ Poke(x10, 1 * kXRegSize);
2330 2330
2331 __ Bind(&runtime); 2331 __ Bind(&runtime);
2332 __ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1); 2332 __ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1);
2333 } 2333 }
2334 2334
2335 2335
2336 void ArgumentsAccessStub::GenerateNewNonStrictFast(MacroAssembler* masm) { 2336 void ArgumentsAccessStub::GenerateNewNonStrictFast(MacroAssembler* masm) {
2337 // Stack layout on entry. 2337 // Stack layout on entry.
2338 // jssp[0]: number of parameters (tagged) 2338 // jssp[0]: number of parameters (tagged)
2339 // jssp[8]: address of receiver argument 2339 // jssp[8]: address of receiver argument
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after
3153 // iterates down to zero (inclusive). 3153 // iterates down to zero (inclusive).
3154 __ Add(last_match_offsets, 3154 __ Add(last_match_offsets,
3155 last_match_info_elements, 3155 last_match_info_elements,
3156 RegExpImpl::kFirstCaptureOffset - kHeapObjectTag); 3156 RegExpImpl::kFirstCaptureOffset - kHeapObjectTag);
3157 __ Bind(&next_capture); 3157 __ Bind(&next_capture);
3158 __ Subs(number_of_capture_registers, number_of_capture_registers, 2); 3158 __ Subs(number_of_capture_registers, number_of_capture_registers, 2);
3159 __ B(mi, &done); 3159 __ B(mi, &done);
3160 // Read two 32 bit values from the static offsets vector buffer into 3160 // Read two 32 bit values from the static offsets vector buffer into
3161 // an X register 3161 // an X register
3162 __ Ldr(current_offset, 3162 __ Ldr(current_offset,
3163 MemOperand(offsets_vector_index, kWRegSizeInBytes * 2, PostIndex)); 3163 MemOperand(offsets_vector_index, kWRegSize * 2, PostIndex));
3164 // Store the smi values in the last match info. 3164 // Store the smi values in the last match info.
3165 __ SmiTag(x10, current_offset); 3165 __ SmiTag(x10, current_offset);
3166 // Clearing the 32 bottom bits gives us a Smi. 3166 // Clearing the 32 bottom bits gives us a Smi.
3167 STATIC_ASSERT(kSmiShift == 32); 3167 STATIC_ASSERT(kSmiShift == 32);
3168 __ And(x11, current_offset, ~kWRegMask); 3168 __ And(x11, current_offset, ~kWRegMask);
3169 __ Stp(x10, 3169 __ Stp(x10,
3170 x11, 3170 x11,
3171 MemOperand(last_match_offsets, kXRegSizeInBytes * 2, PostIndex)); 3171 MemOperand(last_match_offsets, kXRegSize * 2, PostIndex));
3172 __ B(&next_capture); 3172 __ B(&next_capture);
3173 __ Bind(&done); 3173 __ Bind(&done);
3174 3174
3175 // Return last match info. 3175 // Return last match info.
3176 __ Peek(x0, kLastMatchInfoOffset); 3176 __ Peek(x0, kLastMatchInfoOffset);
3177 __ PopCPURegList(used_callee_saved_registers); 3177 __ PopCPURegList(used_callee_saved_registers);
3178 // Drop the 4 arguments of the stub from the stack. 3178 // Drop the 4 arguments of the stub from the stack.
3179 __ Drop(4); 3179 __ Drop(4);
3180 __ Ret(); 3180 __ Ret();
3181 3181
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
3445 __ GetBuiltinFunction(x1, Builtins::CALL_FUNCTION_PROXY); 3445 __ GetBuiltinFunction(x1, Builtins::CALL_FUNCTION_PROXY);
3446 { 3446 {
3447 Handle<Code> adaptor = 3447 Handle<Code> adaptor =
3448 masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(); 3448 masm->isolate()->builtins()->ArgumentsAdaptorTrampoline();
3449 __ Jump(adaptor, RelocInfo::CODE_TARGET); 3449 __ Jump(adaptor, RelocInfo::CODE_TARGET);
3450 } 3450 }
3451 3451
3452 // CALL_NON_FUNCTION expects the non-function callee as receiver (instead 3452 // CALL_NON_FUNCTION expects the non-function callee as receiver (instead
3453 // of the original receiver from the call site). 3453 // of the original receiver from the call site).
3454 __ Bind(&non_function); 3454 __ Bind(&non_function);
3455 __ Poke(function, argc_ * kXRegSizeInBytes); 3455 __ Poke(function, argc_ * kXRegSize);
3456 __ Mov(x0, argc_); // Set up the number of arguments. 3456 __ Mov(x0, argc_); // Set up the number of arguments.
3457 __ Mov(x2, 0); 3457 __ Mov(x2, 0);
3458 __ GetBuiltinFunction(function, Builtins::CALL_NON_FUNCTION); 3458 __ GetBuiltinFunction(function, Builtins::CALL_NON_FUNCTION);
3459 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), 3459 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(),
3460 RelocInfo::CODE_TARGET); 3460 RelocInfo::CODE_TARGET);
3461 } 3461 }
3462 3462
3463 if (CallAsMethod()) { 3463 if (CallAsMethod()) {
3464 __ Bind(&wrap); 3464 __ Bind(&wrap);
3465 // Wrap the receiver and patch it back onto the stack. 3465 // Wrap the receiver and patch it back onto the stack.
(...skipping 1631 matching lines...) Expand 10 before | Expand all | Expand 10 after
5097 Register scratch3 = temps.AcquireX(); 5097 Register scratch3 = temps.AcquireX();
5098 __ Add(scratch2, elements, Operand(scratch2, LSL, kPointerSizeLog2)); 5098 __ Add(scratch2, elements, Operand(scratch2, LSL, kPointerSizeLog2));
5099 __ Ldr(scratch3, FieldMemOperand(scratch2, kElementsStartOffset)); 5099 __ Ldr(scratch3, FieldMemOperand(scratch2, kElementsStartOffset));
5100 __ Cmp(name, scratch3); 5100 __ Cmp(name, scratch3);
5101 __ B(eq, done); 5101 __ B(eq, done);
5102 } 5102 }
5103 5103
5104 // The inlined probes didn't find the entry. 5104 // The inlined probes didn't find the entry.
5105 // Call the complete stub to scan the whole dictionary. 5105 // Call the complete stub to scan the whole dictionary.
5106 5106
5107 CPURegList spill_list(CPURegister::kRegister, kXRegSize, 0, 6); 5107 CPURegList spill_list(CPURegister::kRegister, kXRegSizeInBits, 0, 6);
5108 spill_list.Combine(lr); 5108 spill_list.Combine(lr);
5109 spill_list.Remove(scratch1); 5109 spill_list.Remove(scratch1);
5110 spill_list.Remove(scratch2); 5110 spill_list.Remove(scratch2);
5111 5111
5112 __ PushCPURegList(spill_list); 5112 __ PushCPURegList(spill_list);
5113 5113
5114 if (name.is(x0)) { 5114 if (name.is(x0)) {
5115 ASSERT(!elements.is(x1)); 5115 ASSERT(!elements.is(x1));
5116 __ Mov(x1, name); 5116 __ Mov(x1, name);
5117 __ Mov(x0, elements); 5117 __ Mov(x0, elements);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
5177 __ JumpIfRoot(entity_name, Heap::kTheHoleValueRootIndex, &good); 5177 __ JumpIfRoot(entity_name, Heap::kTheHoleValueRootIndex, &good);
5178 5178
5179 // Check if the entry name is not a unique name. 5179 // Check if the entry name is not a unique name.
5180 __ Ldr(entity_name, FieldMemOperand(entity_name, HeapObject::kMapOffset)); 5180 __ Ldr(entity_name, FieldMemOperand(entity_name, HeapObject::kMapOffset));
5181 __ Ldrb(entity_name, 5181 __ Ldrb(entity_name,
5182 FieldMemOperand(entity_name, Map::kInstanceTypeOffset)); 5182 FieldMemOperand(entity_name, Map::kInstanceTypeOffset));
5183 __ JumpIfNotUniqueName(entity_name, miss); 5183 __ JumpIfNotUniqueName(entity_name, miss);
5184 __ Bind(&good); 5184 __ Bind(&good);
5185 } 5185 }
5186 5186
5187 CPURegList spill_list(CPURegister::kRegister, kXRegSize, 0, 6); 5187 CPURegList spill_list(CPURegister::kRegister, kXRegSizeInBits, 0, 6);
5188 spill_list.Combine(lr); 5188 spill_list.Combine(lr);
5189 spill_list.Remove(scratch0); // Scratch registers don't need to be preserved. 5189 spill_list.Remove(scratch0); // Scratch registers don't need to be preserved.
5190 5190
5191 __ PushCPURegList(spill_list); 5191 __ PushCPURegList(spill_list);
5192 5192
5193 __ Ldr(x0, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); 5193 __ Ldr(x0, FieldMemOperand(receiver, JSObject::kPropertiesOffset));
5194 __ Mov(x1, Operand(name)); 5194 __ Mov(x1, Operand(name));
5195 NameDictionaryLookupStub stub(NEGATIVE_LOOKUP); 5195 NameDictionaryLookupStub stub(NEGATIVE_LOOKUP);
5196 __ CallStub(&stub); 5196 __ CallStub(&stub);
5197 // Move stub return value to scratch0. Note that scratch0 is not included in 5197 // Move stub return value to scratch0. Note that scratch0 is not included in
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
5804 MemOperand(fp, 6 * kPointerSize), 5804 MemOperand(fp, 6 * kPointerSize),
5805 NULL); 5805 NULL);
5806 } 5806 }
5807 5807
5808 5808
5809 #undef __ 5809 #undef __
5810 5810
5811 } } // namespace v8::internal 5811 } } // namespace v8::internal
5812 5812
5813 #endif // V8_TARGET_ARCH_A64 5813 #endif // V8_TARGET_ARCH_A64
OLDNEW
« no previous file with comments | « src/a64/code-stubs-a64.h ('k') | src/a64/codegen-a64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698