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

Side by Side Diff: src/a64/full-codegen-a64.cc

Issue 152673002: A64: Implement Peek/PokePair (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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.cc ('k') | src/a64/macro-assembler-a64.h » ('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 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1184 __ Mov(x1, Operand(Smi::FromInt(0))); // Zero indicates proxy. 1184 __ Mov(x1, Operand(Smi::FromInt(0))); // Zero indicates proxy.
1185 __ Bind(&non_proxy); 1185 __ Bind(&non_proxy);
1186 __ Push(x1, x0); // Smi and array 1186 __ Push(x1, x0); // Smi and array
1187 __ Ldr(x1, FieldMemOperand(x0, FixedArray::kLengthOffset)); 1187 __ Ldr(x1, FieldMemOperand(x0, FixedArray::kLengthOffset));
1188 __ Push(x1, xzr); // Fixed array length (as smi) and initial index. 1188 __ Push(x1, xzr); // Fixed array length (as smi) and initial index.
1189 1189
1190 // Generate code for doing the condition check. 1190 // Generate code for doing the condition check.
1191 PrepareForBailoutForId(stmt->BodyId(), NO_REGISTERS); 1191 PrepareForBailoutForId(stmt->BodyId(), NO_REGISTERS);
1192 __ Bind(&loop); 1192 __ Bind(&loop);
1193 // Load the current count to x0, load the length to x1. 1193 // Load the current count to x0, load the length to x1.
1194 // TODO(jbramley): Consider making something like PeekPair. 1194 __ PeekPair(x0, x1, 0);
1195 __ Ldp(x0, x1, MemOperand(jssp));
1196 __ Cmp(x0, x1); // Compare to the array length. 1195 __ Cmp(x0, x1); // Compare to the array length.
1197 __ B(hs, loop_statement.break_label()); 1196 __ B(hs, loop_statement.break_label());
1198 1197
1199 // Get the current entry of the array into register r3. 1198 // Get the current entry of the array into register r3.
1200 __ Peek(x10, 2 * kXRegSizeInBytes); 1199 __ Peek(x10, 2 * kXRegSizeInBytes);
1201 __ Add(x10, x10, Operand::UntagSmiAndScale(x0, kPointerSizeLog2)); 1200 __ Add(x10, x10, Operand::UntagSmiAndScale(x0, kPointerSizeLog2));
1202 __ Ldr(x3, MemOperand(x10, FixedArray::kHeaderSize - kHeapObjectTag)); 1201 __ Ldr(x3, MemOperand(x10, FixedArray::kHeaderSize - kHeapObjectTag));
1203 1202
1204 // Get the expected map from the stack or a smi in the 1203 // Get the expected map from the stack or a smi in the
1205 // permanent slow case into register x10. 1204 // permanent slow case into register x10.
(...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after
2487 } 2486 }
2488 2487
2489 // Push a copy of the function (found below the arguments) and 2488 // Push a copy of the function (found below the arguments) and
2490 // resolve eval. 2489 // resolve eval.
2491 __ Peek(x10, (arg_count + 1) * kPointerSize); 2490 __ Peek(x10, (arg_count + 1) * kPointerSize);
2492 __ Push(x10); 2491 __ Push(x10);
2493 EmitResolvePossiblyDirectEval(arg_count); 2492 EmitResolvePossiblyDirectEval(arg_count);
2494 2493
2495 // The runtime call returns a pair of values in x0 (function) and 2494 // The runtime call returns a pair of values in x0 (function) and
2496 // x1 (receiver). Touch up the stack with the right values. 2495 // x1 (receiver). Touch up the stack with the right values.
2497 // TODO(jbramley): Consider adding PokePair. 2496 __ PokePair(x1, x0, arg_count * kPointerSize);
2498 __ Stp(x1, x0, MemOperand(jssp, arg_count * kPointerSize));
2499 } 2497 }
2500 2498
2501 // Record source position for debugger. 2499 // Record source position for debugger.
2502 SetSourcePosition(expr->position()); 2500 SetSourcePosition(expr->position());
2503 2501
2504 // Call the evaluated function. 2502 // Call the evaluated function.
2505 CallFunctionStub stub(arg_count, RECEIVER_MIGHT_BE_IMPLICIT); 2503 CallFunctionStub stub(arg_count, RECEIVER_MIGHT_BE_IMPLICIT);
2506 __ Peek(x1, (arg_count + 1) * kXRegSizeInBytes); 2504 __ Peek(x1, (arg_count + 1) * kXRegSizeInBytes);
2507 __ CallStub(&stub); 2505 __ CallStub(&stub);
2508 RecordJSReturnSite(expr); 2506 RecordJSReturnSite(expr);
(...skipping 2464 matching lines...) Expand 10 before | Expand all | Expand 10 after
4973 return previous_; 4971 return previous_;
4974 } 4972 }
4975 4973
4976 4974
4977 #undef __ 4975 #undef __
4978 4976
4979 4977
4980 } } // namespace v8::internal 4978 } } // namespace v8::internal
4981 4979
4982 #endif // V8_TARGET_ARCH_A64 4980 #endif // V8_TARGET_ARCH_A64
OLDNEW
« no previous file with comments | « src/a64/code-stubs-a64.cc ('k') | src/a64/macro-assembler-a64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698