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

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

Issue 1114563003: Optimize the typeof operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Created 5 years, 7 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
« no previous file with comments | « src/code-factory.cc ('k') | src/code-stubs.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_CODE_STUBS_H_ 5 #ifndef V8_CODE_STUBS_H_
6 #define V8_CODE_STUBS_H_ 6 #define V8_CODE_STUBS_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/assembler.h" 9 #include "src/assembler.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 V(InternalArrayNArgumentsConstructor) \ 73 V(InternalArrayNArgumentsConstructor) \
74 V(InternalArrayNoArgumentConstructor) \ 74 V(InternalArrayNoArgumentConstructor) \
75 V(InternalArraySingleArgumentConstructor) \ 75 V(InternalArraySingleArgumentConstructor) \
76 V(KeyedLoadGeneric) \ 76 V(KeyedLoadGeneric) \
77 V(LoadScriptContextField) \ 77 V(LoadScriptContextField) \
78 V(LoadDictionaryElement) \ 78 V(LoadDictionaryElement) \
79 V(LoadFastElement) \ 79 V(LoadFastElement) \
80 V(MegamorphicLoad) \ 80 V(MegamorphicLoad) \
81 V(NameDictionaryLookup) \ 81 V(NameDictionaryLookup) \
82 V(NumberToString) \ 82 V(NumberToString) \
83 V(Typeof) \
83 V(RegExpConstructResult) \ 84 V(RegExpConstructResult) \
84 V(StoreFastElement) \ 85 V(StoreFastElement) \
85 V(StoreScriptContextField) \ 86 V(StoreScriptContextField) \
86 V(StringAdd) \ 87 V(StringAdd) \
87 V(ToBoolean) \ 88 V(ToBoolean) \
88 V(TransitionElementsKind) \ 89 V(TransitionElementsKind) \
89 V(VectorRawKeyedLoad) \ 90 V(VectorRawKeyedLoad) \
90 V(VectorRawLoad) \ 91 V(VectorRawLoad) \
91 /* IC Handler stubs */ \ 92 /* IC Handler stubs */ \
92 V(ArrayBufferViewLoadField) \ 93 V(ArrayBufferViewLoadField) \
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 explicit NumberToStringStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} 589 explicit NumberToStringStub(Isolate* isolate) : HydrogenCodeStub(isolate) {}
589 590
590 // Parameters accessed via CodeStubGraphBuilder::GetParameter() 591 // Parameters accessed via CodeStubGraphBuilder::GetParameter()
591 static const int kNumber = 0; 592 static const int kNumber = 0;
592 593
593 DEFINE_CALL_INTERFACE_DESCRIPTOR(NumberToString); 594 DEFINE_CALL_INTERFACE_DESCRIPTOR(NumberToString);
594 DEFINE_HYDROGEN_CODE_STUB(NumberToString, HydrogenCodeStub); 595 DEFINE_HYDROGEN_CODE_STUB(NumberToString, HydrogenCodeStub);
595 }; 596 };
596 597
597 598
599 class TypeofStub final : public HydrogenCodeStub {
600 public:
601 explicit TypeofStub(Isolate* isolate) : HydrogenCodeStub(isolate) {}
602
603 // Parameters accessed via CodeStubGraphBuilder::GetParameter()
604 static const int kObject = 0;
605
606 static void GenerateAheadOfTime(Isolate* isolate);
607
608 DEFINE_CALL_INTERFACE_DESCRIPTOR(Typeof);
609 DEFINE_HYDROGEN_CODE_STUB(Typeof, HydrogenCodeStub);
610 };
611
612
598 class FastNewClosureStub : public HydrogenCodeStub { 613 class FastNewClosureStub : public HydrogenCodeStub {
599 public: 614 public:
600 FastNewClosureStub(Isolate* isolate, LanguageMode language_mode, 615 FastNewClosureStub(Isolate* isolate, LanguageMode language_mode,
601 FunctionKind kind) 616 FunctionKind kind)
602 : HydrogenCodeStub(isolate) { 617 : HydrogenCodeStub(isolate) {
603 DCHECK(IsValidFunctionKind(kind)); 618 DCHECK(IsValidFunctionKind(kind));
604 set_sub_minor_key(LanguageModeBits::encode(language_mode) | 619 set_sub_minor_key(LanguageModeBits::encode(language_mode) |
605 FunctionKindBits::encode(kind)); 620 FunctionKindBits::encode(kind));
606 } 621 }
607 622
(...skipping 2212 matching lines...) Expand 10 before | Expand all | Expand 10 after
2820 2835
2821 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR 2836 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR
2822 #undef DEFINE_PLATFORM_CODE_STUB 2837 #undef DEFINE_PLATFORM_CODE_STUB
2823 #undef DEFINE_HANDLER_CODE_STUB 2838 #undef DEFINE_HANDLER_CODE_STUB
2824 #undef DEFINE_HYDROGEN_CODE_STUB 2839 #undef DEFINE_HYDROGEN_CODE_STUB
2825 #undef DEFINE_CODE_STUB 2840 #undef DEFINE_CODE_STUB
2826 #undef DEFINE_CODE_STUB_BASE 2841 #undef DEFINE_CODE_STUB_BASE
2827 } } // namespace v8::internal 2842 } } // namespace v8::internal
2828 2843
2829 #endif // V8_CODE_STUBS_H_ 2844 #endif // V8_CODE_STUBS_H_
OLDNEW
« no previous file with comments | « src/code-factory.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698