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

Side by Side Diff: src/x64/code-stubs-x64.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 | « src/mips/code-stubs-mips.cc ('k') | src/x64/code-stubs-x64.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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 void GenerateOperation(MacroAssembler* masm); 58 void GenerateOperation(MacroAssembler* masm);
59 }; 59 };
60 60
61 61
62 class UnaryOpStub: public CodeStub { 62 class UnaryOpStub: public CodeStub {
63 public: 63 public:
64 UnaryOpStub(Token::Value op, UnaryOverwriteMode mode) 64 UnaryOpStub(Token::Value op,
65 UnaryOverwriteMode mode,
66 UnaryOpIC::TypeInfo operand_type = UnaryOpIC::UNINITIALIZED)
65 : op_(op), 67 : op_(op),
66 mode_(mode), 68 mode_(mode),
67 operand_type_(UnaryOpIC::UNINITIALIZED),
68 name_(NULL) {
69 }
70
71 UnaryOpStub(
72 int key,
73 UnaryOpIC::TypeInfo operand_type)
74 : op_(OpBits::decode(key)),
75 mode_(ModeBits::decode(key)),
76 operand_type_(operand_type), 69 operand_type_(operand_type),
77 name_(NULL) { 70 name_(NULL) {
78 } 71 }
79 72
80 private: 73 private:
81 Token::Value op_; 74 Token::Value op_;
82 UnaryOverwriteMode mode_; 75 UnaryOverwriteMode mode_;
83 76
84 // Operand type information determined at runtime. 77 // Operand type information determined at runtime.
85 UnaryOpIC::TypeInfo operand_type_; 78 UnaryOpIC::TypeInfo operand_type_;
86 79
87 char* name_; 80 char* name_;
88 81
89 const char* GetName(); 82 const char* GetName();
90 83
91 #ifdef DEBUG 84 #ifdef DEBUG
92 void Print() { 85 void Print() {
93 PrintF("UnaryOpStub %d (op %s), " 86 PrintF("UnaryOpStub %d (op %s), (mode %d, runtime_type_info %s)\n",
94 "(mode %d, runtime_type_info %s)\n",
95 MinorKey(), 87 MinorKey(),
96 Token::String(op_), 88 Token::String(op_),
97 static_cast<int>(mode_), 89 static_cast<int>(mode_),
98 UnaryOpIC::GetName(operand_type_)); 90 UnaryOpIC::GetName(operand_type_));
99 } 91 }
100 #endif 92 #endif
101 93
102 class ModeBits: public BitField<UnaryOverwriteMode, 0, 1> {}; 94 class ModeBits: public BitField<UnaryOverwriteMode, 0, 1> {};
103 class OpBits: public BitField<Token::Value, 1, 7> {}; 95 class OpBits: public BitField<Token::Value, 1, 7> {};
104 class OperandTypeInfoBits: public BitField<UnaryOpIC::TypeInfo, 8, 3> {}; 96 class OperandTypeInfoBits: public BitField<UnaryOpIC::TypeInfo, 8, 3> {};
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 Register dictionary_; 485 Register dictionary_;
494 Register result_; 486 Register result_;
495 Register index_; 487 Register index_;
496 LookupMode mode_; 488 LookupMode mode_;
497 }; 489 };
498 490
499 491
500 } } // namespace v8::internal 492 } } // namespace v8::internal
501 493
502 #endif // V8_X64_CODE_STUBS_X64_H_ 494 #endif // V8_X64_CODE_STUBS_X64_H_
OLDNEW
« no previous file with comments | « src/mips/code-stubs-mips.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698