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

Side by Side Diff: src/codegen.h

Issue 606063: Make class BitField able to use 32 bits of a uint32.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 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 | src/frame-element.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-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 511
512 #ifdef DEBUG 512 #ifdef DEBUG
513 void Print() { 513 void Print() {
514 PrintF("CallFunctionStub (args %d, in_loop %d, flags %d)\n", 514 PrintF("CallFunctionStub (args %d, in_loop %d, flags %d)\n",
515 argc_, 515 argc_,
516 static_cast<int>(in_loop_), 516 static_cast<int>(in_loop_),
517 static_cast<int>(flags_)); 517 static_cast<int>(flags_));
518 } 518 }
519 #endif 519 #endif
520 520
521 // Minor key encoding in 31 bits AAAAAAAAAAAAAAAAAAAAAFI A(rgs)F(lag)I(nloop). 521 // Minor key encoding in 32 bits with Bitfield <Type, shift, size>.
522 class InLoopBits: public BitField<InLoopFlag, 0, 1> {}; 522 class InLoopBits: public BitField<InLoopFlag, 0, 1> {};
523 class FlagBits: public BitField<CallFunctionFlags, 1, 1> {}; 523 class FlagBits: public BitField<CallFunctionFlags, 1, 1> {};
524 class ArgcBits: public BitField<int, 2, 29> {}; 524 class ArgcBits: public BitField<int, 2, 32 - 2> {};
525 525
526 Major MajorKey() { return CallFunction; } 526 Major MajorKey() { return CallFunction; }
527 int MinorKey() { 527 int MinorKey() {
528 // Encode the parameters in a unique 31 bit value. 528 // Encode the parameters in a unique 32 bit value.
529 return InLoopBits::encode(in_loop_) 529 return InLoopBits::encode(in_loop_)
530 | FlagBits::encode(flags_) 530 | FlagBits::encode(flags_)
531 | ArgcBits::encode(argc_); 531 | ArgcBits::encode(argc_);
532 } 532 }
533 533
534 InLoopFlag InLoop() { return in_loop_; } 534 InLoopFlag InLoop() { return in_loop_; }
535 bool ReceiverMightBeValue() { 535 bool ReceiverMightBeValue() {
536 return (flags_ & RECEIVER_MIGHT_BE_VALUE) != 0; 536 return (flags_ & RECEIVER_MIGHT_BE_VALUE) != 0;
537 } 537 }
538 538
(...skipping 13 matching lines...) Expand all
552 private: 552 private:
553 Major MajorKey() { return ToBoolean; } 553 Major MajorKey() { return ToBoolean; }
554 int MinorKey() { return 0; } 554 int MinorKey() { return 0; }
555 }; 555 };
556 556
557 557
558 } // namespace internal 558 } // namespace internal
559 } // namespace v8 559 } // namespace v8
560 560
561 #endif // V8_CODEGEN_H_ 561 #endif // V8_CODEGEN_H_
OLDNEW
« no previous file with comments | « no previous file | src/frame-element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698