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

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

Issue 170303003: Initialize interface descriptor for ToNumberStub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
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 | « no previous file | 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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 class ToNumberStub: public HydrogenCodeStub { 479 class ToNumberStub: public HydrogenCodeStub {
480 public: 480 public:
481 ToNumberStub() { } 481 ToNumberStub() { }
482 482
483 virtual Handle<Code> GenerateCode(Isolate* isolate); 483 virtual Handle<Code> GenerateCode(Isolate* isolate);
484 484
485 virtual void InitializeInterfaceDescriptor( 485 virtual void InitializeInterfaceDescriptor(
486 Isolate* isolate, 486 Isolate* isolate,
487 CodeStubInterfaceDescriptor* descriptor); 487 CodeStubInterfaceDescriptor* descriptor);
488 488
489 static void InstallDescriptors(Isolate* isolate) {
490 ToNumberStub stub;
491 stub.InitializeInterfaceDescriptor(
492 isolate,
493 isolate->code_stub_interface_descriptor(CodeStub::ToNumber));
494 }
495
489 private: 496 private:
490 Major MajorKey() { return ToNumber; } 497 Major MajorKey() { return ToNumber; }
491 int NotMissMinorKey() { return 0; } 498 int NotMissMinorKey() { return 0; }
492 }; 499 };
493 500
494 501
495 class NumberToStringStub V8_FINAL : public HydrogenCodeStub { 502 class NumberToStringStub V8_FINAL : public HydrogenCodeStub {
496 public: 503 public:
497 NumberToStringStub() {} 504 NumberToStringStub() {}
498 505
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 UNREACHABLE(); 624 UNREACHABLE();
618 return LAST_ELEMENTS_KIND; 625 return LAST_ELEMENTS_KIND;
619 } 626 }
620 627
621 virtual Handle<Code> GenerateCode(Isolate* isolate); 628 virtual Handle<Code> GenerateCode(Isolate* isolate);
622 629
623 virtual void InitializeInterfaceDescriptor( 630 virtual void InitializeInterfaceDescriptor(
624 Isolate* isolate, 631 Isolate* isolate,
625 CodeStubInterfaceDescriptor* descriptor); 632 CodeStubInterfaceDescriptor* descriptor);
626 633
634 static void InstallDescriptors(Isolate* isolate);
635
627 private: 636 private:
628 Mode mode_; 637 Mode mode_;
629 AllocationSiteMode allocation_site_mode_; 638 AllocationSiteMode allocation_site_mode_;
630 int length_; 639 int length_;
631 640
632 class AllocationSiteModeBits: public BitField<AllocationSiteMode, 0, 1> {}; 641 class AllocationSiteModeBits: public BitField<AllocationSiteMode, 0, 1> {};
633 class ModeBits: public BitField<Mode, 1, 4> {}; 642 class ModeBits: public BitField<Mode, 1, 4> {};
634 class LengthBits: public BitField<int, 5, 4> {}; 643 class LengthBits: public BitField<int, 5, 4> {};
635 // Ensure data fits within available bits. 644 // Ensure data fits within available bits.
636 STATIC_ASSERT(LAST_ALLOCATION_SITE_MODE == 1); 645 STATIC_ASSERT(LAST_ALLOCATION_SITE_MODE == 1);
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
1368 1377
1369 static Handle<Code> GetUninitialized(Isolate* isolate, 1378 static Handle<Code> GetUninitialized(Isolate* isolate,
1370 NilValue nil) { 1379 NilValue nil) {
1371 return CompareNilICStub(nil, UNINITIALIZED).GetCode(isolate); 1380 return CompareNilICStub(nil, UNINITIALIZED).GetCode(isolate);
1372 } 1381 }
1373 1382
1374 virtual void InitializeInterfaceDescriptor( 1383 virtual void InitializeInterfaceDescriptor(
1375 Isolate* isolate, 1384 Isolate* isolate,
1376 CodeStubInterfaceDescriptor* descriptor); 1385 CodeStubInterfaceDescriptor* descriptor);
1377 1386
1378 static void InitializeForIsolate(Isolate* isolate) { 1387 static void InstallDescriptors(Isolate* isolate) {
1379 CompareNilICStub compare_stub(kNullValue, UNINITIALIZED); 1388 CompareNilICStub compare_stub(kNullValue, UNINITIALIZED);
1380 compare_stub.InitializeInterfaceDescriptor( 1389 compare_stub.InitializeInterfaceDescriptor(
1381 isolate, 1390 isolate,
1382 isolate->code_stub_interface_descriptor(CodeStub::CompareNilIC)); 1391 isolate->code_stub_interface_descriptor(CodeStub::CompareNilIC));
1383 } 1392 }
1384 1393
1385 virtual InlineCacheState GetICState() { 1394 virtual InlineCacheState GetICState() {
1386 if (state_.Contains(GENERIC)) { 1395 if (state_.Contains(GENERIC)) {
1387 return MEGAMORPHIC; 1396 return MEGAMORPHIC;
1388 } else if (state_.Contains(MONOMORPHIC_MAP)) { 1397 } else if (state_.Contains(MONOMORPHIC_MAP)) {
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after
2325 virtual Handle<Code> GenerateCode(Isolate* isolate); 2334 virtual Handle<Code> GenerateCode(Isolate* isolate);
2326 virtual void InitializeInterfaceDescriptor( 2335 virtual void InitializeInterfaceDescriptor(
2327 Isolate* isolate, 2336 Isolate* isolate,
2328 CodeStubInterfaceDescriptor* descriptor); 2337 CodeStubInterfaceDescriptor* descriptor);
2329 2338
2330 virtual Code::Kind GetCodeKind() const { return Code::TO_BOOLEAN_IC; } 2339 virtual Code::Kind GetCodeKind() const { return Code::TO_BOOLEAN_IC; }
2331 virtual void PrintState(StringStream* stream); 2340 virtual void PrintState(StringStream* stream);
2332 2341
2333 virtual bool SometimesSetsUpAFrame() { return false; } 2342 virtual bool SometimesSetsUpAFrame() { return false; }
2334 2343
2335 static void InitializeForIsolate(Isolate* isolate) { 2344 static void InstallDescriptors(Isolate* isolate) {
2336 ToBooleanStub stub; 2345 ToBooleanStub stub;
2337 stub.InitializeInterfaceDescriptor( 2346 stub.InitializeInterfaceDescriptor(
2338 isolate, 2347 isolate,
2339 isolate->code_stub_interface_descriptor(CodeStub::ToBoolean)); 2348 isolate->code_stub_interface_descriptor(CodeStub::ToBoolean));
2340 } 2349 }
2341 2350
2342 static Handle<Code> GetUninitialized(Isolate* isolate) { 2351 static Handle<Code> GetUninitialized(Isolate* isolate) {
2343 return ToBooleanStub(UNINITIALIZED).GetCode(isolate); 2352 return ToBooleanStub(UNINITIALIZED).GetCode(isolate);
2344 } 2353 }
2345 2354
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
2481 2490
2482 2491
2483 class CallDescriptors { 2492 class CallDescriptors {
2484 public: 2493 public:
2485 static void InitializeForIsolate(Isolate* isolate); 2494 static void InitializeForIsolate(Isolate* isolate);
2486 }; 2495 };
2487 2496
2488 } } // namespace v8::internal 2497 } } // namespace v8::internal
2489 2498
2490 #endif // V8_CODE_STUBS_H_ 2499 #endif // V8_CODE_STUBS_H_
OLDNEW
« no previous file with comments | « no previous file | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698