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

Side by Side Diff: src/objects.h

Issue 2314903004: [promises] Move PromiseResolveThenableJob to c++ (Closed)
Patch Set: cast to jsobject Created 4 years, 3 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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 V(FUNCTION_TEMPLATE_INFO_TYPE) \ 387 V(FUNCTION_TEMPLATE_INFO_TYPE) \
388 V(OBJECT_TEMPLATE_INFO_TYPE) \ 388 V(OBJECT_TEMPLATE_INFO_TYPE) \
389 V(SIGNATURE_INFO_TYPE) \ 389 V(SIGNATURE_INFO_TYPE) \
390 V(TYPE_SWITCH_INFO_TYPE) \ 390 V(TYPE_SWITCH_INFO_TYPE) \
391 V(ALLOCATION_MEMENTO_TYPE) \ 391 V(ALLOCATION_MEMENTO_TYPE) \
392 V(ALLOCATION_SITE_TYPE) \ 392 V(ALLOCATION_SITE_TYPE) \
393 V(SCRIPT_TYPE) \ 393 V(SCRIPT_TYPE) \
394 V(TYPE_FEEDBACK_INFO_TYPE) \ 394 V(TYPE_FEEDBACK_INFO_TYPE) \
395 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \ 395 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \
396 V(BOX_TYPE) \ 396 V(BOX_TYPE) \
397 V(PROMISE_CONTAINER_TYPE) \
397 V(PROTOTYPE_INFO_TYPE) \ 398 V(PROTOTYPE_INFO_TYPE) \
398 V(CONTEXT_EXTENSION_TYPE) \ 399 V(CONTEXT_EXTENSION_TYPE) \
399 \ 400 \
400 V(FIXED_ARRAY_TYPE) \ 401 V(FIXED_ARRAY_TYPE) \
401 V(FIXED_DOUBLE_ARRAY_TYPE) \ 402 V(FIXED_DOUBLE_ARRAY_TYPE) \
402 V(SHARED_FUNCTION_INFO_TYPE) \ 403 V(SHARED_FUNCTION_INFO_TYPE) \
403 V(WEAK_CELL_TYPE) \ 404 V(WEAK_CELL_TYPE) \
404 V(TRANSITION_ARRAY_TYPE) \ 405 V(TRANSITION_ARRAY_TYPE) \
405 \ 406 \
406 V(JS_MESSAGE_OBJECT_TYPE) \ 407 V(JS_MESSAGE_OBJECT_TYPE) \
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 // object type in this causes the compiler to generate most of the boilerplate 492 // object type in this causes the compiler to generate most of the boilerplate
492 // code for the class including allocation and garbage collection routines, 493 // code for the class including allocation and garbage collection routines,
493 // casts and predicates. All you need to define is the class, methods and 494 // casts and predicates. All you need to define is the class, methods and
494 // object verification routines. Easy, no? 495 // object verification routines. Easy, no?
495 // 496 //
496 // Note that for subtle reasons related to the ordering or numerical values of 497 // Note that for subtle reasons related to the ordering or numerical values of
497 // type tags, elements in this list have to be added to the INSTANCE_TYPE_LIST 498 // type tags, elements in this list have to be added to the INSTANCE_TYPE_LIST
498 // manually. 499 // manually.
499 #define STRUCT_LIST(V) \ 500 #define STRUCT_LIST(V) \
500 V(BOX, Box, box) \ 501 V(BOX, Box, box) \
502 V(PROMISE_CONTAINER, PromiseContainer, promise_container) \
501 V(ACCESSOR_INFO, AccessorInfo, accessor_info) \ 503 V(ACCESSOR_INFO, AccessorInfo, accessor_info) \
502 V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \ 504 V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \
503 V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \ 505 V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \
504 V(INTERCEPTOR_INFO, InterceptorInfo, interceptor_info) \ 506 V(INTERCEPTOR_INFO, InterceptorInfo, interceptor_info) \
505 V(CALL_HANDLER_INFO, CallHandlerInfo, call_handler_info) \ 507 V(CALL_HANDLER_INFO, CallHandlerInfo, call_handler_info) \
506 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \ 508 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \
507 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \ 509 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \
508 V(SCRIPT, Script, script) \ 510 V(SCRIPT, Script, script) \
509 V(ALLOCATION_SITE, AllocationSite, allocation_site) \ 511 V(ALLOCATION_SITE, AllocationSite, allocation_site) \
510 V(ALLOCATION_MEMENTO, AllocationMemento, allocation_memento) \ 512 V(ALLOCATION_MEMENTO, AllocationMemento, allocation_memento) \
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 FUNCTION_TEMPLATE_INFO_TYPE, 673 FUNCTION_TEMPLATE_INFO_TYPE,
672 OBJECT_TEMPLATE_INFO_TYPE, 674 OBJECT_TEMPLATE_INFO_TYPE,
673 SIGNATURE_INFO_TYPE, 675 SIGNATURE_INFO_TYPE,
674 TYPE_SWITCH_INFO_TYPE, 676 TYPE_SWITCH_INFO_TYPE,
675 ALLOCATION_SITE_TYPE, 677 ALLOCATION_SITE_TYPE,
676 ALLOCATION_MEMENTO_TYPE, 678 ALLOCATION_MEMENTO_TYPE,
677 SCRIPT_TYPE, 679 SCRIPT_TYPE,
678 TYPE_FEEDBACK_INFO_TYPE, 680 TYPE_FEEDBACK_INFO_TYPE,
679 ALIASED_ARGUMENTS_ENTRY_TYPE, 681 ALIASED_ARGUMENTS_ENTRY_TYPE,
680 BOX_TYPE, 682 BOX_TYPE,
683 PROMISE_CONTAINER_TYPE,
681 DEBUG_INFO_TYPE, 684 DEBUG_INFO_TYPE,
682 BREAK_POINT_INFO_TYPE, 685 BREAK_POINT_INFO_TYPE,
683 FIXED_ARRAY_TYPE, 686 FIXED_ARRAY_TYPE,
684 SHARED_FUNCTION_INFO_TYPE, 687 SHARED_FUNCTION_INFO_TYPE,
685 CELL_TYPE, 688 CELL_TYPE,
686 WEAK_CELL_TYPE, 689 WEAK_CELL_TYPE,
687 TRANSITION_ARRAY_TYPE, 690 TRANSITION_ARRAY_TYPE,
688 PROPERTY_CELL_TYPE, 691 PROPERTY_CELL_TYPE,
689 PROTOTYPE_INFO_TYPE, 692 PROTOTYPE_INFO_TYPE,
690 CONTEXT_EXTENSION_TYPE, 693 CONTEXT_EXTENSION_TYPE,
(...skipping 5895 matching lines...) Expand 10 before | Expand all | Expand 10 after
6586 6589
6587 // An abstract superclass, a marker class really, for simple structure classes. 6590 // An abstract superclass, a marker class really, for simple structure classes.
6588 // It doesn't carry much functionality but allows struct classes to be 6591 // It doesn't carry much functionality but allows struct classes to be
6589 // identified in the type system. 6592 // identified in the type system.
6590 class Struct: public HeapObject { 6593 class Struct: public HeapObject {
6591 public: 6594 public:
6592 inline void InitializeBody(int object_size); 6595 inline void InitializeBody(int object_size);
6593 DECLARE_CAST(Struct) 6596 DECLARE_CAST(Struct)
6594 }; 6597 };
6595 6598
6599 // A container struct to hold state required for
6600 // PromiseResolveThenableJob. {before, after}_debug_event could
6601 // potentially be undefined if the debugger is turned off.
6602 class PromiseContainer : public Struct {
6603 public:
6604 DECL_ACCESSORS(promise, JSObject)
6605 DECL_ACCESSORS(thenable, JSObject)
6606 DECL_ACCESSORS(then, JSFunction)
6607 DECL_ACCESSORS(resolve, JSFunction)
6608 DECL_ACCESSORS(reject, JSFunction)
6609 DECL_ACCESSORS(before_debug_event, Object)
6610 DECL_ACCESSORS(after_debug_event, Object)
6611
6612 static const int kPromiseOffset = Struct::kHeaderSize;
6613 static const int kThenableOffset = kPromiseOffset + kPointerSize;
6614 static const int kThenOffset = kThenableOffset + kPointerSize;
6615 static const int kResolveOffset = kThenOffset + kPointerSize;
6616 static const int kRejectOffset = kResolveOffset + kPointerSize;
6617 static const int kBeforeDebugEventOffset = kRejectOffset + kPointerSize;
6618 static const int kAfterDebugEventOffset =
6619 kBeforeDebugEventOffset + kPointerSize;
6620 static const int kSize = kAfterDebugEventOffset + kPointerSize;
6621
6622 DECLARE_CAST(PromiseContainer)
6623 DECLARE_PRINTER(PromiseContainer)
6624 DECLARE_VERIFIER(PromiseContainer)
6625
6626 private:
6627 DISALLOW_IMPLICIT_CONSTRUCTORS(PromiseContainer);
6628 };
6596 6629
6597 // A simple one-element struct, useful where smis need to be boxed. 6630 // A simple one-element struct, useful where smis need to be boxed.
6598 class Box : public Struct { 6631 class Box : public Struct {
6599 public: 6632 public:
6600 // [value]: the boxed contents. 6633 // [value]: the boxed contents.
6601 DECL_ACCESSORS(value, Object) 6634 DECL_ACCESSORS(value, Object)
6602 6635
6603 DECLARE_CAST(Box) 6636 DECLARE_CAST(Box)
6604 6637
6605 // Dispatched behavior. 6638 // Dispatched behavior.
(...skipping 4620 matching lines...) Expand 10 before | Expand all | Expand 10 after
11226 } 11259 }
11227 return value; 11260 return value;
11228 } 11261 }
11229 }; 11262 };
11230 11263
11231 11264
11232 } // NOLINT, false-positive due to second-order macros. 11265 } // NOLINT, false-positive due to second-order macros.
11233 } // NOLINT, false-positive due to second-order macros. 11266 } // NOLINT, false-positive due to second-order macros.
11234 11267
11235 #endif // V8_OBJECTS_H_ 11268 #endif // V8_OBJECTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698