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

Side by Side Diff: src/arm/code-stubs-arm.h

Issue 7248063: Simplify UnaryOpStub a little bit. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 5 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 | src/arm/code-stubs-arm.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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 void GenerateCallCFunction(MacroAssembler* masm, Register scratch); 53 void GenerateCallCFunction(MacroAssembler* masm, Register scratch);
54 54
55 Major MajorKey() { return TranscendentalCache; } 55 Major MajorKey() { return TranscendentalCache; }
56 int MinorKey() { return type_ | argument_type_; } 56 int MinorKey() { return type_ | argument_type_; }
57 Runtime::FunctionId RuntimeFunction(); 57 Runtime::FunctionId RuntimeFunction();
58 }; 58 };
59 59
60 60
61 class UnaryOpStub: public CodeStub { 61 class UnaryOpStub: public CodeStub {
62 public: 62 public:
63 UnaryOpStub(Token::Value op, UnaryOverwriteMode mode) 63 UnaryOpStub(Token::Value op,
64 UnaryOverwriteMode mode,
65 UnaryOpIC::TypeInfo operand_type = UnaryOpIC::UNINITIALIZED)
64 : op_(op), 66 : op_(op),
65 mode_(mode), 67 mode_(mode),
66 operand_type_(UnaryOpIC::UNINITIALIZED),
67 name_(NULL) {
68 }
69
70 UnaryOpStub(
71 int key,
72 UnaryOpIC::TypeInfo operand_type)
73 : op_(OpBits::decode(key)),
74 mode_(ModeBits::decode(key)),
75 operand_type_(operand_type), 68 operand_type_(operand_type),
76 name_(NULL) { 69 name_(NULL) {
77 } 70 }
78 71
79 private: 72 private:
80 Token::Value op_; 73 Token::Value op_;
81 UnaryOverwriteMode mode_; 74 UnaryOverwriteMode mode_;
82 75
83 // Operand type information determined at runtime. 76 // Operand type information determined at runtime.
84 UnaryOpIC::TypeInfo operand_type_; 77 UnaryOpIC::TypeInfo operand_type_;
85 78
86 char* name_; 79 char* name_;
87 80
88 const char* GetName(); 81 const char* GetName();
89 82
90 #ifdef DEBUG 83 #ifdef DEBUG
91 void Print() { 84 void Print() {
92 PrintF("UnaryOpStub %d (op %s), " 85 PrintF("UnaryOpStub %d (op %s), (mode %d, runtime_type_info %s)\n",
93 "(mode %d, runtime_type_info %s)\n",
94 MinorKey(), 86 MinorKey(),
95 Token::String(op_), 87 Token::String(op_),
96 static_cast<int>(mode_), 88 static_cast<int>(mode_),
97 UnaryOpIC::GetName(operand_type_)); 89 UnaryOpIC::GetName(operand_type_));
98 } 90 }
99 #endif 91 #endif
100 92
101 class ModeBits: public BitField<UnaryOverwriteMode, 0, 1> {}; 93 class ModeBits: public BitField<UnaryOverwriteMode, 0, 1> {};
102 class OpBits: public BitField<Token::Value, 1, 7> {}; 94 class OpBits: public BitField<Token::Value, 1, 7> {};
103 class OperandTypeInfoBits: public BitField<UnaryOpIC::TypeInfo, 8, 3> {}; 95 class OperandTypeInfoBits: public BitField<UnaryOpIC::TypeInfo, 8, 3> {};
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 642
651 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; 643 class LookupModeBits: public BitField<LookupMode, 0, 1> {};
652 644
653 LookupMode mode_; 645 LookupMode mode_;
654 }; 646 };
655 647
656 648
657 } } // namespace v8::internal 649 } } // namespace v8::internal
658 650
659 #endif // V8_ARM_CODE_STUBS_ARM_H_ 651 #endif // V8_ARM_CODE_STUBS_ARM_H_
OLDNEW
« no previous file with comments | « no previous file | src/arm/code-stubs-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698