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

Side by Side Diff: src/a64/simulator-a64.h

Issue 153823012: Avoid doing explicit cast in simulator-a64::get_sp(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
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 | « no previous file | no next file » | 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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 set_reg(31, value, Reg31IsStackPointer); 438 set_reg(31, value, Reg31IsStackPointer);
439 } 439 }
440 440
441 int64_t sp() { return xreg(31, Reg31IsStackPointer); } 441 int64_t sp() { return xreg(31, Reg31IsStackPointer); }
442 int64_t jssp() { return xreg(kJSSPCode, Reg31IsStackPointer); } 442 int64_t jssp() { return xreg(kJSSPCode, Reg31IsStackPointer); }
443 int64_t fp() { 443 int64_t fp() {
444 return xreg(kFramePointerRegCode, Reg31IsStackPointer); 444 return xreg(kFramePointerRegCode, Reg31IsStackPointer);
445 } 445 }
446 Instruction* lr() { return reg<Instruction*>(kLinkRegCode); } 446 Instruction* lr() { return reg<Instruction*>(kLinkRegCode); }
447 447
448 Address get_sp() { return reinterpret_cast<Address>(sp()); } 448 Address get_sp() { return reg<Address>(31, Reg31IsStackPointer); }
449 449
450 // Return 'size' bits of the value of a floating-point register, as the 450 // Return 'size' bits of the value of a floating-point register, as the
451 // specified type. The value is zero-extended to fill the result. 451 // specified type. The value is zero-extended to fill the result.
452 // 452 //
453 // The only supported values of 'size' are kDRegSize and kSRegSize. 453 // The only supported values of 'size' are kDRegSize and kSRegSize.
454 template<typename T> 454 template<typename T>
455 T fpreg(unsigned size, unsigned code) const { 455 T fpreg(unsigned size, unsigned code) const {
456 unsigned size_in_bytes = size / 8; 456 unsigned size_in_bytes = size / 8;
457 ASSERT(size_in_bytes <= sizeof(T)); 457 ASSERT(size_in_bytes <= sizeof(T));
458 ASSERT((size == kDRegSize) || (size == kSRegSize)); 458 ASSERT((size == kDRegSize) || (size == kSRegSize));
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 static void UnregisterCTryCatch() { 856 static void UnregisterCTryCatch() {
857 Simulator::current(Isolate::Current())->PopAddress(); 857 Simulator::current(Isolate::Current())->PopAddress();
858 } 858 }
859 }; 859 };
860 860
861 #endif // !defined(USE_SIMULATOR) 861 #endif // !defined(USE_SIMULATOR)
862 862
863 } } // namespace v8::internal 863 } } // namespace v8::internal
864 864
865 #endif // V8_A64_SIMULATOR_A64_H_ 865 #endif // V8_A64_SIMULATOR_A64_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698