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

Side by Side Diff: src/objects.h

Issue 2415023002: [promises] Move async debug event creation to c++ (Closed)
Patch Set: use consts Created 4 years, 2 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
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 6671 matching lines...) Expand 10 before | Expand all | Expand 10 after
6682 DECLARE_CAST(Struct) 6682 DECLARE_CAST(Struct)
6683 }; 6683 };
6684 6684
6685 // A container struct to hold state required for PromiseResolveThenableJob. 6685 // A container struct to hold state required for PromiseResolveThenableJob.
6686 class PromiseResolveThenableJobInfo : public Struct { 6686 class PromiseResolveThenableJobInfo : public Struct {
6687 public: 6687 public:
6688 DECL_ACCESSORS(thenable, JSReceiver) 6688 DECL_ACCESSORS(thenable, JSReceiver)
6689 DECL_ACCESSORS(then, JSReceiver) 6689 DECL_ACCESSORS(then, JSReceiver)
6690 DECL_ACCESSORS(resolve, JSFunction) 6690 DECL_ACCESSORS(resolve, JSFunction)
6691 DECL_ACCESSORS(reject, JSFunction) 6691 DECL_ACCESSORS(reject, JSFunction)
6692 DECL_ACCESSORS(before_debug_event, Object) 6692 DECL_ACCESSORS(id, Object)
6693 DECL_ACCESSORS(after_debug_event, Object) 6693 DECL_ACCESSORS(name, Object)
adamk 2016/10/13 15:59:10 In this context, "id" and "name" are too generic.
gsathya 2016/10/13 21:27:30 Agreed about id. Name is either Promise.resolve/re
6694 6694
6695 static const int kThenableOffset = Struct::kHeaderSize; 6695 static const int kThenableOffset = Struct::kHeaderSize;
6696 static const int kThenOffset = kThenableOffset + kPointerSize; 6696 static const int kThenOffset = kThenableOffset + kPointerSize;
6697 static const int kResolveOffset = kThenOffset + kPointerSize; 6697 static const int kResolveOffset = kThenOffset + kPointerSize;
6698 static const int kRejectOffset = kResolveOffset + kPointerSize; 6698 static const int kRejectOffset = kResolveOffset + kPointerSize;
6699 static const int kBeforeDebugEventOffset = kRejectOffset + kPointerSize; 6699 static const int kIdOffset = kRejectOffset + kPointerSize;
6700 static const int kAfterDebugEventOffset = 6700 static const int kNameOffset = kIdOffset + kPointerSize;
6701 kBeforeDebugEventOffset + kPointerSize; 6701 static const int kSize = kNameOffset + kPointerSize;
6702 static const int kSize = kAfterDebugEventOffset + kPointerSize;
6703 6702
6704 DECLARE_CAST(PromiseResolveThenableJobInfo) 6703 DECLARE_CAST(PromiseResolveThenableJobInfo)
6705 DECLARE_PRINTER(PromiseResolveThenableJobInfo) 6704 DECLARE_PRINTER(PromiseResolveThenableJobInfo)
6706 DECLARE_VERIFIER(PromiseResolveThenableJobInfo) 6705 DECLARE_VERIFIER(PromiseResolveThenableJobInfo)
6707 6706
6708 private: 6707 private:
6709 DISALLOW_IMPLICIT_CONSTRUCTORS(PromiseResolveThenableJobInfo); 6708 DISALLOW_IMPLICIT_CONSTRUCTORS(PromiseResolveThenableJobInfo);
6710 }; 6709 };
6711 6710
6712 // Struct to hold state required for PromiseReactionJob. 6711 // Struct to hold state required for PromiseReactionJob.
6713 class PromiseReactionJobInfo : public Struct { 6712 class PromiseReactionJobInfo : public Struct {
6714 public: 6713 public:
6715 DECL_ACCESSORS(value, Object) 6714 DECL_ACCESSORS(value, Object)
6716 DECL_ACCESSORS(tasks, Object) 6715 DECL_ACCESSORS(tasks, Object)
6717 DECL_ACCESSORS(deferred, Object) 6716 DECL_ACCESSORS(deferred, Object)
6718 DECL_ACCESSORS(before_debug_event, Object) 6717 DECL_ACCESSORS(id, Object)
6719 DECL_ACCESSORS(after_debug_event, Object) 6718 DECL_ACCESSORS(name, Object)
6720 DECL_ACCESSORS(context, Context) 6719 DECL_ACCESSORS(context, Context)
6721 6720
6722 static const int kValueOffset = Struct::kHeaderSize; 6721 static const int kValueOffset = Struct::kHeaderSize;
6723 static const int kTasksOffset = kValueOffset + kPointerSize; 6722 static const int kTasksOffset = kValueOffset + kPointerSize;
6724 static const int kDeferredOffset = kTasksOffset + kPointerSize; 6723 static const int kDeferredOffset = kTasksOffset + kPointerSize;
6725 static const int kBeforeDebugEventOffset = kDeferredOffset + kPointerSize; 6724 static const int kIdOffset = kDeferredOffset + kPointerSize;
6726 static const int kAfterDebugEventOffset = 6725 static const int kNameOffset = kIdOffset + kPointerSize;
6727 kBeforeDebugEventOffset + kPointerSize; 6726 static const int kContextOffset = kNameOffset + kPointerSize;
6728 static const int kContextOffset = kAfterDebugEventOffset + kPointerSize;
6729 static const int kSize = kContextOffset + kPointerSize; 6727 static const int kSize = kContextOffset + kPointerSize;
6730 6728
6731 DECLARE_CAST(PromiseReactionJobInfo) 6729 DECLARE_CAST(PromiseReactionJobInfo)
6732 DECLARE_PRINTER(PromiseReactionJobInfo) 6730 DECLARE_PRINTER(PromiseReactionJobInfo)
6733 DECLARE_VERIFIER(PromiseReactionJobInfo) 6731 DECLARE_VERIFIER(PromiseReactionJobInfo)
6734 6732
6735 private: 6733 private:
6736 DISALLOW_IMPLICIT_CONSTRUCTORS(PromiseReactionJobInfo); 6734 DISALLOW_IMPLICIT_CONSTRUCTORS(PromiseReactionJobInfo);
6737 }; 6735 };
6738 6736
(...skipping 4736 matching lines...) Expand 10 before | Expand all | Expand 10 after
11475 } 11473 }
11476 return value; 11474 return value;
11477 } 11475 }
11478 }; 11476 };
11479 11477
11480 11478
11481 } // NOLINT, false-positive due to second-order macros. 11479 } // NOLINT, false-positive due to second-order macros.
11482 } // NOLINT, false-positive due to second-order macros. 11480 } // NOLINT, false-positive due to second-order macros.
11483 11481
11484 #endif // V8_OBJECTS_H_ 11482 #endif // V8_OBJECTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698