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

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

Issue 181453002: Reset trunk to 3.24.35.4 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 6 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 | « src/checks.h ('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 // 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 V(InternalArrayConstructor) \ 94 V(InternalArrayConstructor) \
95 V(ProfileEntryHook) \ 95 V(ProfileEntryHook) \
96 V(StoreGlobal) \ 96 V(StoreGlobal) \
97 V(CallApiFunction) \ 97 V(CallApiFunction) \
98 V(CallApiGetter) \ 98 V(CallApiGetter) \
99 /* IC Handler stubs */ \ 99 /* IC Handler stubs */ \
100 V(LoadField) \ 100 V(LoadField) \
101 V(KeyedLoadField) 101 V(KeyedLoadField)
102 102
103 // List of code stubs only used on ARM platforms. 103 // List of code stubs only used on ARM platforms.
104 #if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_A64) 104 #if V8_TARGET_ARCH_ARM
105 #define CODE_STUB_LIST_ARM(V) \ 105 #define CODE_STUB_LIST_ARM(V) \
106 V(GetProperty) \ 106 V(GetProperty) \
107 V(SetProperty) \ 107 V(SetProperty) \
108 V(InvokeBuiltin) \ 108 V(InvokeBuiltin) \
109 V(DirectCEntry) 109 V(DirectCEntry)
110 #else 110 #else
111 #define CODE_STUB_LIST_ARM(V) 111 #define CODE_STUB_LIST_ARM(V)
112 #endif 112 #endif
113 113
114 // List of code stubs only used on MIPS platforms. 114 // List of code stubs only used on MIPS platforms.
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 181
182 virtual InlineCacheState GetICState() { 182 virtual InlineCacheState GetICState() {
183 return UNINITIALIZED; 183 return UNINITIALIZED;
184 } 184 }
185 virtual ExtraICState GetExtraICState() { 185 virtual ExtraICState GetExtraICState() {
186 return kNoExtraICState; 186 return kNoExtraICState;
187 } 187 }
188 virtual Code::StubType GetStubType() { 188 virtual Code::StubType GetStubType() {
189 return Code::NORMAL; 189 return Code::NORMAL;
190 } 190 }
191 virtual int GetStubFlags() {
192 return -1;
193 }
191 194
192 virtual void PrintName(StringStream* stream); 195 virtual void PrintName(StringStream* stream);
193 196
194 // Returns a name for logging/debugging purposes. 197 // Returns a name for logging/debugging purposes.
195 SmartArrayPointer<const char> GetName(); 198 SmartArrayPointer<const char> GetName();
196 199
197 protected: 200 protected:
198 static bool CanUseFPRegisters(); 201 static bool CanUseFPRegisters();
199 202
200 // Generates the assembler code for the stub. 203 // Generates the assembler code for the stub.
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 DISALLOW_COPY_AND_ASSIGN(RuntimeCallHelper); 435 DISALLOW_COPY_AND_ASSIGN(RuntimeCallHelper);
433 }; 436 };
434 437
435 438
436 } } // namespace v8::internal 439 } } // namespace v8::internal
437 440
438 #if V8_TARGET_ARCH_IA32 441 #if V8_TARGET_ARCH_IA32
439 #include "ia32/code-stubs-ia32.h" 442 #include "ia32/code-stubs-ia32.h"
440 #elif V8_TARGET_ARCH_X64 443 #elif V8_TARGET_ARCH_X64
441 #include "x64/code-stubs-x64.h" 444 #include "x64/code-stubs-x64.h"
442 #elif V8_TARGET_ARCH_A64
443 #include "a64/code-stubs-a64.h"
444 #elif V8_TARGET_ARCH_ARM 445 #elif V8_TARGET_ARCH_ARM
445 #include "arm/code-stubs-arm.h" 446 #include "arm/code-stubs-arm.h"
446 #elif V8_TARGET_ARCH_MIPS 447 #elif V8_TARGET_ARCH_MIPS
447 #include "mips/code-stubs-mips.h" 448 #include "mips/code-stubs-mips.h"
448 #else 449 #else
449 #error Unsupported target architecture. 450 #error Unsupported target architecture.
450 #endif 451 #endif
451 452
452 namespace v8 { 453 namespace v8 {
453 namespace internal { 454 namespace internal {
(...skipping 25 matching lines...) Expand all
479 class ToNumberStub: public HydrogenCodeStub { 480 class ToNumberStub: public HydrogenCodeStub {
480 public: 481 public:
481 ToNumberStub() { } 482 ToNumberStub() { }
482 483
483 virtual Handle<Code> GenerateCode(Isolate* isolate); 484 virtual Handle<Code> GenerateCode(Isolate* isolate);
484 485
485 virtual void InitializeInterfaceDescriptor( 486 virtual void InitializeInterfaceDescriptor(
486 Isolate* isolate, 487 Isolate* isolate,
487 CodeStubInterfaceDescriptor* descriptor); 488 CodeStubInterfaceDescriptor* descriptor);
488 489
489 static void InstallDescriptors(Isolate* isolate) {
490 ToNumberStub stub;
491 stub.InitializeInterfaceDescriptor(
492 isolate,
493 isolate->code_stub_interface_descriptor(CodeStub::ToNumber));
494 }
495
496 private: 490 private:
497 Major MajorKey() { return ToNumber; } 491 Major MajorKey() { return ToNumber; }
498 int NotMissMinorKey() { return 0; } 492 int NotMissMinorKey() { return 0; }
499 }; 493 };
500 494
501 495
502 class NumberToStringStub V8_FINAL : public HydrogenCodeStub { 496 class NumberToStringStub V8_FINAL : public HydrogenCodeStub {
503 public: 497 public:
504 NumberToStringStub() {} 498 NumberToStringStub() {}
505 499
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 UNREACHABLE(); 618 UNREACHABLE();
625 return LAST_ELEMENTS_KIND; 619 return LAST_ELEMENTS_KIND;
626 } 620 }
627 621
628 virtual Handle<Code> GenerateCode(Isolate* isolate); 622 virtual Handle<Code> GenerateCode(Isolate* isolate);
629 623
630 virtual void InitializeInterfaceDescriptor( 624 virtual void InitializeInterfaceDescriptor(
631 Isolate* isolate, 625 Isolate* isolate,
632 CodeStubInterfaceDescriptor* descriptor); 626 CodeStubInterfaceDescriptor* descriptor);
633 627
634 static void InstallDescriptors(Isolate* isolate);
635
636 private: 628 private:
637 Mode mode_; 629 Mode mode_;
638 AllocationSiteMode allocation_site_mode_; 630 AllocationSiteMode allocation_site_mode_;
639 int length_; 631 int length_;
640 632
641 class AllocationSiteModeBits: public BitField<AllocationSiteMode, 0, 1> {}; 633 class AllocationSiteModeBits: public BitField<AllocationSiteMode, 0, 1> {};
642 class ModeBits: public BitField<Mode, 1, 4> {}; 634 class ModeBits: public BitField<Mode, 1, 4> {};
643 class LengthBits: public BitField<int, 5, 4> {}; 635 class LengthBits: public BitField<int, 5, 4> {};
644 // Ensure data fits within available bits. 636 // Ensure data fits within available bits.
645 STATIC_ASSERT(LAST_ALLOCATION_SITE_MODE == 1); 637 STATIC_ASSERT(LAST_ALLOCATION_SITE_MODE == 1);
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 876
885 protected: 877 protected:
886 class KindBits: public BitField<Code::Kind, 0, 4> {}; 878 class KindBits: public BitField<Code::Kind, 0, 4> {};
887 virtual Code::Kind kind() const = 0; 879 virtual Code::Kind kind() const = 0;
888 }; 880 };
889 881
890 882
891 class HandlerStub: public HICStub { 883 class HandlerStub: public HICStub {
892 public: 884 public:
893 virtual Code::Kind GetCodeKind() const { return Code::HANDLER; } 885 virtual Code::Kind GetCodeKind() const { return Code::HANDLER; }
894 virtual ExtraICState GetExtraICState() { return kind(); } 886 virtual int GetStubFlags() { return kind(); }
895 887
896 protected: 888 protected:
897 HandlerStub() : HICStub() { } 889 HandlerStub() : HICStub() { }
898 virtual int NotMissMinorKey() { return bit_field_; } 890 virtual int NotMissMinorKey() { return bit_field_; }
899 int bit_field_; 891 int bit_field_;
900 }; 892 };
901 893
902 894
903 class LoadFieldStub: public HandlerStub { 895 class LoadFieldStub: public HandlerStub {
904 public: 896 public:
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 } 972 }
981 973
982 virtual Code::Kind kind() const { return Code::STORE_IC; } 974 virtual Code::Kind kind() const { return Code::STORE_IC; }
983 975
984 virtual Handle<Code> GenerateCode(Isolate* isolate); 976 virtual Handle<Code> GenerateCode(Isolate* isolate);
985 977
986 virtual void InitializeInterfaceDescriptor( 978 virtual void InitializeInterfaceDescriptor(
987 Isolate* isolate, 979 Isolate* isolate,
988 CodeStubInterfaceDescriptor* descriptor); 980 CodeStubInterfaceDescriptor* descriptor);
989 981
982 virtual ExtraICState GetExtraICState() { return bit_field_; }
983
990 bool is_constant() { 984 bool is_constant() {
991 return IsConstantBits::decode(bit_field_); 985 return IsConstantBits::decode(bit_field_);
992 } 986 }
993 void set_is_constant(bool value) { 987 void set_is_constant(bool value) {
994 bit_field_ = IsConstantBits::update(bit_field_, value); 988 bit_field_ = IsConstantBits::update(bit_field_, value);
995 } 989 }
996 990
997 Representation representation() { 991 Representation representation() {
998 return Representation::FromKind(RepresentationBits::decode(bit_field_)); 992 return Representation::FromKind(RepresentationBits::decode(bit_field_));
999 } 993 }
1000 void set_representation(Representation r) { 994 void set_representation(Representation r) {
1001 bit_field_ = RepresentationBits::update(bit_field_, r.kind()); 995 bit_field_ = RepresentationBits::update(bit_field_, r.kind());
1002 } 996 }
1003 997
1004 private: 998 private:
999 virtual int NotMissMinorKey() { return GetExtraICState(); }
1005 Major MajorKey() { return StoreGlobal; } 1000 Major MajorKey() { return StoreGlobal; }
1006 1001
1007 class IsConstantBits: public BitField<bool, 0, 1> {}; 1002 class IsConstantBits: public BitField<bool, 0, 1> {};
1008 class RepresentationBits: public BitField<Representation::Kind, 1, 8> {}; 1003 class RepresentationBits: public BitField<Representation::Kind, 1, 8> {};
1009 1004
1005 int bit_field_;
1006
1010 DISALLOW_COPY_AND_ASSIGN(StoreGlobalStub); 1007 DISALLOW_COPY_AND_ASSIGN(StoreGlobalStub);
1011 }; 1008 };
1012 1009
1013 1010
1014 class CallApiFunctionStub : public PlatformCodeStub { 1011 class CallApiFunctionStub : public PlatformCodeStub {
1015 public: 1012 public:
1016 CallApiFunctionStub(bool is_store, 1013 CallApiFunctionStub(bool restore_context,
1017 bool call_data_undefined, 1014 bool call_data_undefined,
1018 int argc) { 1015 int argc) {
1019 bit_field_ = 1016 bit_field_ =
1020 IsStoreBits::encode(is_store) | 1017 RestoreContextBits::encode(restore_context) |
1021 CallDataUndefinedBits::encode(call_data_undefined) | 1018 CallDataUndefinedBits::encode(call_data_undefined) |
1022 ArgumentBits::encode(argc); 1019 ArgumentBits::encode(argc);
1023 ASSERT(!is_store || argc == 1);
1024 } 1020 }
1025 1021
1026 private: 1022 private:
1027 virtual void Generate(MacroAssembler* masm) V8_OVERRIDE; 1023 virtual void Generate(MacroAssembler* masm) V8_OVERRIDE;
1028 virtual Major MajorKey() V8_OVERRIDE { return CallApiFunction; } 1024 virtual Major MajorKey() V8_OVERRIDE { return CallApiFunction; }
1029 virtual int MinorKey() V8_OVERRIDE { return bit_field_; } 1025 virtual int MinorKey() V8_OVERRIDE { return bit_field_; }
1030 1026
1031 class IsStoreBits: public BitField<bool, 0, 1> {}; 1027 class RestoreContextBits: public BitField<bool, 0, 1> {};
1032 class CallDataUndefinedBits: public BitField<bool, 1, 1> {}; 1028 class CallDataUndefinedBits: public BitField<bool, 1, 1> {};
1033 class ArgumentBits: public BitField<int, 2, Code::kArgumentsBits> {}; 1029 class ArgumentBits: public BitField<int, 2, Code::kArgumentsBits> {};
1034 1030
1035 int bit_field_; 1031 int bit_field_;
1036 1032
1037 DISALLOW_COPY_AND_ASSIGN(CallApiFunctionStub); 1033 DISALLOW_COPY_AND_ASSIGN(CallApiFunctionStub);
1038 }; 1034 };
1039 1035
1040 1036
1041 class CallApiGetterStub : public PlatformCodeStub { 1037 class CallApiGetterStub : public PlatformCodeStub {
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
1365 1361
1366 static Handle<Code> GetUninitialized(Isolate* isolate, 1362 static Handle<Code> GetUninitialized(Isolate* isolate,
1367 NilValue nil) { 1363 NilValue nil) {
1368 return CompareNilICStub(nil, UNINITIALIZED).GetCode(isolate); 1364 return CompareNilICStub(nil, UNINITIALIZED).GetCode(isolate);
1369 } 1365 }
1370 1366
1371 virtual void InitializeInterfaceDescriptor( 1367 virtual void InitializeInterfaceDescriptor(
1372 Isolate* isolate, 1368 Isolate* isolate,
1373 CodeStubInterfaceDescriptor* descriptor); 1369 CodeStubInterfaceDescriptor* descriptor);
1374 1370
1375 static void InstallDescriptors(Isolate* isolate) { 1371 static void InitializeForIsolate(Isolate* isolate) {
1376 CompareNilICStub compare_stub(kNullValue, UNINITIALIZED); 1372 CompareNilICStub compare_stub(kNullValue, UNINITIALIZED);
1377 compare_stub.InitializeInterfaceDescriptor( 1373 compare_stub.InitializeInterfaceDescriptor(
1378 isolate, 1374 isolate,
1379 isolate->code_stub_interface_descriptor(CodeStub::CompareNilIC)); 1375 isolate->code_stub_interface_descriptor(CodeStub::CompareNilIC));
1380 } 1376 }
1381 1377
1382 virtual InlineCacheState GetICState() { 1378 virtual InlineCacheState GetICState() {
1383 if (state_.Contains(GENERIC)) { 1379 if (state_.Contains(GENERIC)) {
1384 return MEGAMORPHIC; 1380 return MEGAMORPHIC;
1385 } else if (state_.Contains(MONOMORPHIC_MAP)) { 1381 } else if (state_.Contains(MONOMORPHIC_MAP)) {
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
1863 }; 1859 };
1864 1860
1865 1861
1866 class DoubleToIStub : public PlatformCodeStub { 1862 class DoubleToIStub : public PlatformCodeStub {
1867 public: 1863 public:
1868 DoubleToIStub(Register source, 1864 DoubleToIStub(Register source,
1869 Register destination, 1865 Register destination,
1870 int offset, 1866 int offset,
1871 bool is_truncating, 1867 bool is_truncating,
1872 bool skip_fastpath = false) : bit_field_(0) { 1868 bool skip_fastpath = false) : bit_field_(0) {
1873 bit_field_ = SourceRegisterBits::encode(source.code()) | 1869 bit_field_ = SourceRegisterBits::encode(source.code_) |
1874 DestinationRegisterBits::encode(destination.code()) | 1870 DestinationRegisterBits::encode(destination.code_) |
1875 OffsetBits::encode(offset) | 1871 OffsetBits::encode(offset) |
1876 IsTruncatingBits::encode(is_truncating) | 1872 IsTruncatingBits::encode(is_truncating) |
1877 SkipFastPathBits::encode(skip_fastpath) | 1873 SkipFastPathBits::encode(skip_fastpath) |
1878 SSEBits::encode(CpuFeatures::IsSafeForSnapshot(SSE2) ? 1874 SSEBits::encode(CpuFeatures::IsSafeForSnapshot(SSE2) ?
1879 CpuFeatures::IsSafeForSnapshot(SSE3) ? 2 : 1 : 0); 1875 CpuFeatures::IsSafeForSnapshot(SSE3) ? 2 : 1 : 0);
1880 } 1876 }
1881 1877
1882 Register source() { 1878 Register source() {
1883 return Register::from_code(SourceRegisterBits::decode(bit_field_)); 1879 Register result = { SourceRegisterBits::decode(bit_field_) };
1880 return result;
1884 } 1881 }
1885 1882
1886 Register destination() { 1883 Register destination() {
1887 return Register::from_code(DestinationRegisterBits::decode(bit_field_)); 1884 Register result = { DestinationRegisterBits::decode(bit_field_) };
1885 return result;
1888 } 1886 }
1889 1887
1890 bool is_truncating() { 1888 bool is_truncating() {
1891 return IsTruncatingBits::decode(bit_field_); 1889 return IsTruncatingBits::decode(bit_field_);
1892 } 1890 }
1893 1891
1894 bool skip_fastpath() { 1892 bool skip_fastpath() {
1895 return SkipFastPathBits::decode(bit_field_); 1893 return SkipFastPathBits::decode(bit_field_);
1896 } 1894 }
1897 1895
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
2322 virtual Handle<Code> GenerateCode(Isolate* isolate); 2320 virtual Handle<Code> GenerateCode(Isolate* isolate);
2323 virtual void InitializeInterfaceDescriptor( 2321 virtual void InitializeInterfaceDescriptor(
2324 Isolate* isolate, 2322 Isolate* isolate,
2325 CodeStubInterfaceDescriptor* descriptor); 2323 CodeStubInterfaceDescriptor* descriptor);
2326 2324
2327 virtual Code::Kind GetCodeKind() const { return Code::TO_BOOLEAN_IC; } 2325 virtual Code::Kind GetCodeKind() const { return Code::TO_BOOLEAN_IC; }
2328 virtual void PrintState(StringStream* stream); 2326 virtual void PrintState(StringStream* stream);
2329 2327
2330 virtual bool SometimesSetsUpAFrame() { return false; } 2328 virtual bool SometimesSetsUpAFrame() { return false; }
2331 2329
2332 static void InstallDescriptors(Isolate* isolate) { 2330 static void InitializeForIsolate(Isolate* isolate) {
2333 ToBooleanStub stub; 2331 ToBooleanStub stub;
2334 stub.InitializeInterfaceDescriptor( 2332 stub.InitializeInterfaceDescriptor(
2335 isolate, 2333 isolate,
2336 isolate->code_stub_interface_descriptor(CodeStub::ToBoolean)); 2334 isolate->code_stub_interface_descriptor(CodeStub::ToBoolean));
2337 } 2335 }
2338 2336
2339 static Handle<Code> GetUninitialized(Isolate* isolate) { 2337 static Handle<Code> GetUninitialized(Isolate* isolate) {
2340 return ToBooleanStub(UNINITIALIZED).GetCode(isolate); 2338 return ToBooleanStub(UNINITIALIZED).GetCode(isolate);
2341 } 2339 }
2342 2340
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
2478 2476
2479 2477
2480 class CallDescriptors { 2478 class CallDescriptors {
2481 public: 2479 public:
2482 static void InitializeForIsolate(Isolate* isolate); 2480 static void InitializeForIsolate(Isolate* isolate);
2483 }; 2481 };
2484 2482
2485 } } // namespace v8::internal 2483 } } // namespace v8::internal
2486 2484
2487 #endif // V8_CODE_STUBS_H_ 2485 #endif // V8_CODE_STUBS_H_
OLDNEW
« no previous file with comments | « src/checks.h ('k') | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698