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

Side by Side Diff: src/ia32/macro-assembler-ia32.h

Issue 4654002: Move common static helpers from codegen to the macro-assembler files. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 1 month 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/ia32/full-codegen-ia32.cc ('k') | src/x64/codegen-x64.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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 635
636 636
637 // Generate an Operand for loading an indexed field from an object. 637 // Generate an Operand for loading an indexed field from an object.
638 static inline Operand FieldOperand(Register object, 638 static inline Operand FieldOperand(Register object,
639 Register index, 639 Register index,
640 ScaleFactor scale, 640 ScaleFactor scale,
641 int offset) { 641 int offset) {
642 return Operand(object, index, scale, offset - kHeapObjectTag); 642 return Operand(object, index, scale, offset - kHeapObjectTag);
643 } 643 }
644 644
645
646 static inline Operand ContextOperand(Register context, int index) {
647 return Operand(context, Context::SlotOffset(index));
648 }
649
650
651 static inline Operand GlobalObjectOperand() {
652 return ContextOperand(esi, Context::GLOBAL_INDEX);
653 }
654
655
645 // Generates an Operand for saving parameters after PrepareCallApiFunction. 656 // Generates an Operand for saving parameters after PrepareCallApiFunction.
646 Operand ApiParameterOperand(int index); 657 Operand ApiParameterOperand(int index);
647 658
648 659
649 #ifdef GENERATED_CODE_COVERAGE 660 #ifdef GENERATED_CODE_COVERAGE
650 extern void LogGeneratedCodeCoverage(const char* file_line); 661 extern void LogGeneratedCodeCoverage(const char* file_line);
651 #define CODE_COVERAGE_STRINGIFY(x) #x 662 #define CODE_COVERAGE_STRINGIFY(x) #x
652 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) 663 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x)
653 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) 664 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__)
654 #define ACCESS_MASM(masm) { \ 665 #define ACCESS_MASM(masm) { \
655 byte* ia32_coverage_function = \ 666 byte* ia32_coverage_function = \
656 reinterpret_cast<byte*>(FUNCTION_ADDR(LogGeneratedCodeCoverage)); \ 667 reinterpret_cast<byte*>(FUNCTION_ADDR(LogGeneratedCodeCoverage)); \
657 masm->pushfd(); \ 668 masm->pushfd(); \
658 masm->pushad(); \ 669 masm->pushad(); \
659 masm->push(Immediate(reinterpret_cast<int>(&__FILE_LINE__))); \ 670 masm->push(Immediate(reinterpret_cast<int>(&__FILE_LINE__))); \
660 masm->call(ia32_coverage_function, RelocInfo::RUNTIME_ENTRY); \ 671 masm->call(ia32_coverage_function, RelocInfo::RUNTIME_ENTRY); \
661 masm->pop(eax); \ 672 masm->pop(eax); \
662 masm->popad(); \ 673 masm->popad(); \
663 masm->popfd(); \ 674 masm->popfd(); \
664 } \ 675 } \
665 masm-> 676 masm->
666 #else 677 #else
667 #define ACCESS_MASM(masm) masm-> 678 #define ACCESS_MASM(masm) masm->
668 #endif 679 #endif
669 680
670 681
671 } } // namespace v8::internal 682 } } // namespace v8::internal
672 683
673 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ 684 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_
OLDNEW
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/x64/codegen-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698