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

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

Issue 11973008: Replace special IC builtins and stubs in the map's cache by codestubs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 11 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/builtins.cc ('k') | src/ia32/code-stubs-ia32.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 29 matching lines...) Expand all
40 V(CallFunction) \ 40 V(CallFunction) \
41 V(CallConstruct) \ 41 V(CallConstruct) \
42 V(UnaryOp) \ 42 V(UnaryOp) \
43 V(BinaryOp) \ 43 V(BinaryOp) \
44 V(StringAdd) \ 44 V(StringAdd) \
45 V(SubString) \ 45 V(SubString) \
46 V(StringCompare) \ 46 V(StringCompare) \
47 V(Compare) \ 47 V(Compare) \
48 V(CompareIC) \ 48 V(CompareIC) \
49 V(MathPow) \ 49 V(MathPow) \
50 V(StringLength) \
50 V(RecordWrite) \ 51 V(RecordWrite) \
51 V(StoreBufferOverflow) \ 52 V(StoreBufferOverflow) \
52 V(RegExpExec) \ 53 V(RegExpExec) \
53 V(TranscendentalCache) \ 54 V(TranscendentalCache) \
54 V(Instanceof) \ 55 V(Instanceof) \
55 V(ConvertToDouble) \ 56 V(ConvertToDouble) \
56 V(WriteInt32ToHeapNumber) \ 57 V(WriteInt32ToHeapNumber) \
57 V(StackCheck) \ 58 V(StackCheck) \
58 V(Interrupt) \ 59 V(Interrupt) \
59 V(FastNewClosure) \ 60 V(FastNewClosure) \
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 virtual void Generate(MacroAssembler* masm); 533 virtual void Generate(MacroAssembler* masm);
533 534
534 private: 535 private:
535 virtual CodeStub::Major MajorKey() { return MathPow; } 536 virtual CodeStub::Major MajorKey() { return MathPow; }
536 virtual int MinorKey() { return exponent_type_; } 537 virtual int MinorKey() { return exponent_type_; }
537 538
538 ExponentType exponent_type_; 539 ExponentType exponent_type_;
539 }; 540 };
540 541
541 542
543 class ICStub: public PlatformCodeStub {
544 public:
545 explicit ICStub(Code::Kind kind) : kind_(kind) { }
546 virtual int GetCodeKind() { return kind_; }
547 virtual InlineCacheState GetICState() { return MONOMORPHIC; }
548
549 bool Describes(Code* code) {
550 return GetMajorKey(code) == MajorKey() && code->stub_info() == MinorKey();
551 }
552
553 protected:
554 class KindBits: public BitField<Code::Kind, 0, 4> {};
555 virtual void FinishCode(Handle<Code> code) {
556 code->set_stub_info(MinorKey());
557 }
558 Code::Kind kind() { return kind_; }
559
560 private:
561 Code::Kind kind_;
562 };
563
564
565 class StringLengthStub: public ICStub {
566 public:
567 StringLengthStub(Code::Kind kind, bool support_wrapper)
568 : ICStub(kind), support_wrapper_(support_wrapper) { }
569 virtual void Generate(MacroAssembler* masm);
570
571 private:
572 class WrapperModeBits: public BitField<bool, 4, 1> {};
573 virtual CodeStub::Major MajorKey() { return StringLength; }
574 virtual int MinorKey() {
575 return KindBits::encode(kind()) | WrapperModeBits::encode(support_wrapper_);
576 }
577
578 bool support_wrapper_;
579 };
580
581
542 class BinaryOpStub: public PlatformCodeStub { 582 class BinaryOpStub: public PlatformCodeStub {
543 public: 583 public:
544 BinaryOpStub(Token::Value op, OverwriteMode mode) 584 BinaryOpStub(Token::Value op, OverwriteMode mode)
545 : op_(op), 585 : op_(op),
546 mode_(mode), 586 mode_(mode),
547 platform_specific_bit_(false), 587 platform_specific_bit_(false),
548 left_type_(BinaryOpIC::UNINITIALIZED), 588 left_type_(BinaryOpIC::UNINITIALIZED),
549 right_type_(BinaryOpIC::UNINITIALIZED), 589 right_type_(BinaryOpIC::UNINITIALIZED),
550 result_type_(BinaryOpIC::UNINITIALIZED) { 590 result_type_(BinaryOpIC::UNINITIALIZED) {
551 Initialize(); 591 Initialize();
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 1352
1313 // The current function entry hook. 1353 // The current function entry hook.
1314 static FunctionEntryHook entry_hook_; 1354 static FunctionEntryHook entry_hook_;
1315 1355
1316 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); 1356 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub);
1317 }; 1357 };
1318 1358
1319 } } // namespace v8::internal 1359 } } // namespace v8::internal
1320 1360
1321 #endif // V8_CODE_STUBS_H_ 1361 #endif // V8_CODE_STUBS_H_
OLDNEW
« no previous file with comments | « src/builtins.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698