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

Side by Side Diff: src/frames.h

Issue 2803853005: Inline Array.prototype.forEach in TurboFan (Closed)
Patch Set: Remove stray changes Created 3 years, 6 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 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_FRAMES_H_ 5 #ifndef V8_FRAMES_H_
6 #define V8_FRAMES_H_ 6 #define V8_FRAMES_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/flags.h" 9 #include "src/flags.h"
10 #include "src/handles.h" 10 #include "src/handles.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // Get the next stack handler in the chain. 91 // Get the next stack handler in the chain.
92 inline StackHandler* next() const; 92 inline StackHandler* next() const;
93 93
94 // Conversion support. 94 // Conversion support.
95 static inline StackHandler* FromAddress(Address address); 95 static inline StackHandler* FromAddress(Address address);
96 96
97 private: 97 private:
98 DISALLOW_IMPLICIT_CONSTRUCTORS(StackHandler); 98 DISALLOW_IMPLICIT_CONSTRUCTORS(StackHandler);
99 }; 99 };
100 100
101 #define STACK_FRAME_TYPE_LIST(V) \ 101 #define STACK_FRAME_TYPE_LIST(V) \
102 V(ENTRY, EntryFrame) \ 102 V(ENTRY, EntryFrame) \
103 V(ENTRY_CONSTRUCT, EntryConstructFrame) \ 103 V(ENTRY_CONSTRUCT, EntryConstructFrame) \
104 V(EXIT, ExitFrame) \ 104 V(EXIT, ExitFrame) \
105 V(JAVA_SCRIPT, JavaScriptFrame) \ 105 V(JAVA_SCRIPT, JavaScriptFrame) \
106 V(OPTIMIZED, OptimizedFrame) \ 106 V(OPTIMIZED, OptimizedFrame) \
107 V(WASM_COMPILED, WasmCompiledFrame) \ 107 V(WASM_COMPILED, WasmCompiledFrame) \
108 V(WASM_TO_JS, WasmToJsFrame) \ 108 V(WASM_TO_JS, WasmToJsFrame) \
109 V(JS_TO_WASM, JsToWasmFrame) \ 109 V(JS_TO_WASM, JsToWasmFrame) \
110 V(WASM_INTERPRETER_ENTRY, WasmInterpreterEntryFrame) \ 110 V(WASM_INTERPRETER_ENTRY, WasmInterpreterEntryFrame) \
111 V(INTERPRETED, InterpretedFrame) \ 111 V(INTERPRETED, InterpretedFrame) \
112 V(STUB, StubFrame) \ 112 V(STUB, StubFrame) \
113 V(STUB_FAILURE_TRAMPOLINE, StubFailureTrampolineFrame) \ 113 V(STUB_FAILURE_TRAMPOLINE, StubFailureTrampolineFrame) \
114 V(INTERNAL, InternalFrame) \ 114 V(BUILTIN_CONTINUATION, BuiltinContinuationFrame) \
115 V(CONSTRUCT, ConstructFrame) \ 115 V(JAVA_SCRIPT_BUILTIN_CONTINUATION, JavaScriptBuiltinContinuationFrame) \
116 V(ARGUMENTS_ADAPTOR, ArgumentsAdaptorFrame) \ 116 V(INTERNAL, InternalFrame) \
117 V(BUILTIN, BuiltinFrame) \ 117 V(CONSTRUCT, ConstructFrame) \
118 V(ARGUMENTS_ADAPTOR, ArgumentsAdaptorFrame) \
119 V(BUILTIN, BuiltinFrame) \
118 V(BUILTIN_EXIT, BuiltinExitFrame) 120 V(BUILTIN_EXIT, BuiltinExitFrame)
119 121
120 // Every pointer in a frame has a slot id. On 32-bit platforms, doubles consume 122 // Every pointer in a frame has a slot id. On 32-bit platforms, doubles consume
121 // two slots. 123 // two slots.
122 // 124 //
123 // Stack slot indices >= 0 access the callee stack with slot 0 corresponding to 125 // Stack slot indices >= 0 access the callee stack with slot 0 corresponding to
124 // the callee's saved return address and 1 corresponding to the saved frame 126 // the callee's saved return address and 1 corresponding to the saved frame
125 // pointer. Some frames have additional information stored in the fixed header, 127 // pointer. Some frames have additional information stored in the fixed header,
126 // for example JSFunctions store the function context and marker in the fixed 128 // for example JSFunctions store the function context and marker in the fixed
127 // header, with slot index 2 corresponding to the current function context and 3 129 // header, with slot index 2 corresponding to the current function context and 3
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 public: 354 public:
353 // FP-relative. 355 // FP-relative.
354 static const int kContextOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(0); 356 static const int kContextOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(0);
355 static const int kLengthOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(1); 357 static const int kLengthOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(1);
356 static const int kConstructorOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(2); 358 static const int kConstructorOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(2);
357 static const int kNewTargetOrImplicitReceiverOffset = 359 static const int kNewTargetOrImplicitReceiverOffset =
358 TYPED_FRAME_PUSHED_VALUE_OFFSET(3); 360 TYPED_FRAME_PUSHED_VALUE_OFFSET(3);
359 DEFINE_TYPED_FRAME_SIZES(4); 361 DEFINE_TYPED_FRAME_SIZES(4);
360 }; 362 };
361 363
364 class BuiltinContinuationFrameConstants : public TypedFrameConstants {
365 public:
366 // FP-relative.
367 static const int kFunctionOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(0);
368 static const int kBuiltinOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(1);
369 DEFINE_TYPED_FRAME_SIZES(2);
370 };
371
362 class StubFailureTrampolineFrameConstants : public InternalFrameConstants { 372 class StubFailureTrampolineFrameConstants : public InternalFrameConstants {
363 public: 373 public:
364 static const int kArgumentsArgumentsOffset = 374 static const int kArgumentsArgumentsOffset =
365 TYPED_FRAME_PUSHED_VALUE_OFFSET(0); 375 TYPED_FRAME_PUSHED_VALUE_OFFSET(0);
366 static const int kArgumentsLengthOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(1); 376 static const int kArgumentsLengthOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(1);
367 static const int kArgumentsPointerOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(2); 377 static const int kArgumentsPointerOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(2);
368 static const int kFixedHeaderBottomOffset = kArgumentsPointerOffset; 378 static const int kFixedHeaderBottomOffset = kArgumentsPointerOffset;
369 DEFINE_TYPED_FRAME_SIZES(3); 379 DEFINE_TYPED_FRAME_SIZES(3);
370 }; 380 };
371 381
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 bool is_js_to_wasm() const { return type() == JS_TO_WASM; } 528 bool is_js_to_wasm() const { return type() == JS_TO_WASM; }
519 bool is_wasm_interpreter_entry() const { 529 bool is_wasm_interpreter_entry() const {
520 return type() == WASM_INTERPRETER_ENTRY; 530 return type() == WASM_INTERPRETER_ENTRY;
521 } 531 }
522 bool is_arguments_adaptor() const { return type() == ARGUMENTS_ADAPTOR; } 532 bool is_arguments_adaptor() const { return type() == ARGUMENTS_ADAPTOR; }
523 bool is_builtin() const { return type() == BUILTIN; } 533 bool is_builtin() const { return type() == BUILTIN; }
524 bool is_internal() const { return type() == INTERNAL; } 534 bool is_internal() const { return type() == INTERNAL; }
525 bool is_stub_failure_trampoline() const { 535 bool is_stub_failure_trampoline() const {
526 return type() == STUB_FAILURE_TRAMPOLINE; 536 return type() == STUB_FAILURE_TRAMPOLINE;
527 } 537 }
538 bool is_builtin_continuation() const {
539 return type() == BUILTIN_CONTINUATION;
540 }
541 bool is_java_script_builtin_continuation() const {
542 return type() == JAVA_SCRIPT_BUILTIN_CONTINUATION;
543 }
528 bool is_construct() const { return type() == CONSTRUCT; } 544 bool is_construct() const { return type() == CONSTRUCT; }
529 bool is_builtin_exit() const { return type() == BUILTIN_EXIT; } 545 bool is_builtin_exit() const { return type() == BUILTIN_EXIT; }
530 virtual bool is_standard() const { return false; } 546 virtual bool is_standard() const { return false; }
531 547
532 bool is_java_script() const { 548 bool is_java_script() const {
533 Type type = this->type(); 549 Type type = this->type();
534 return (type == JAVA_SCRIPT) || (type == OPTIMIZED) || 550 return (type == JAVA_SCRIPT) || (type == OPTIMIZED) ||
535 (type == INTERPRETED) || (type == BUILTIN); 551 (type == INTERPRETED) || (type == BUILTIN) ||
552 (type == JAVA_SCRIPT_BUILTIN_CONTINUATION);
536 } 553 }
537 bool is_wasm() const { 554 bool is_wasm() const {
538 Type type = this->type(); 555 Type type = this->type();
539 return type == WASM_COMPILED || type == WASM_INTERPRETER_ENTRY; 556 return type == WASM_COMPILED || type == WASM_INTERPRETER_ENTRY;
540 } 557 }
541 558
542 // Accessors. 559 // Accessors.
543 Address sp() const { return state_.sp; } 560 Address sp() const { return state_.sp; }
544 Address fp() const { return state_.fp; } 561 Address fp() const { return state_.fp; }
545 Address callee_pc() const { 562 Address callee_pc() const {
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
1453 return static_cast<ConstructFrame*>(frame); 1470 return static_cast<ConstructFrame*>(frame);
1454 } 1471 }
1455 1472
1456 protected: 1473 protected:
1457 inline explicit ConstructFrame(StackFrameIteratorBase* iterator); 1474 inline explicit ConstructFrame(StackFrameIteratorBase* iterator);
1458 1475
1459 private: 1476 private:
1460 friend class StackFrameIteratorBase; 1477 friend class StackFrameIteratorBase;
1461 }; 1478 };
1462 1479
1480 class BuiltinContinuationFrame : public InternalFrame {
1481 public:
1482 Type type() const override { return BUILTIN_CONTINUATION; }
1483
1484 static BuiltinContinuationFrame* cast(StackFrame* frame) {
1485 DCHECK(frame->is_builtin_continuation());
1486 return static_cast<BuiltinContinuationFrame*>(frame);
1487 }
1488
1489 protected:
1490 inline explicit BuiltinContinuationFrame(StackFrameIteratorBase* iterator);
1491
1492 private:
1493 friend class StackFrameIteratorBase;
1494 };
1495
1496 class JavaScriptBuiltinContinuationFrame : public JavaScriptFrame {
1497 public:
1498 Type type() const override { return JAVA_SCRIPT_BUILTIN_CONTINUATION; }
1499
1500 static JavaScriptBuiltinContinuationFrame* cast(StackFrame* frame) {
1501 DCHECK(frame->is_java_script_builtin_continuation());
1502 return static_cast<JavaScriptBuiltinContinuationFrame*>(frame);
1503 }
1504
1505 protected:
1506 inline explicit JavaScriptBuiltinContinuationFrame(
1507 StackFrameIteratorBase* iterator);
1508
1509 private:
1510 friend class StackFrameIteratorBase;
1511 };
1463 1512
1464 class StackFrameIteratorBase BASE_EMBEDDED { 1513 class StackFrameIteratorBase BASE_EMBEDDED {
1465 public: 1514 public:
1466 Isolate* isolate() const { return isolate_; } 1515 Isolate* isolate() const { return isolate_; }
1467 1516
1468 bool done() const { return frame_ == NULL; } 1517 bool done() const { return frame_ == NULL; }
1469 1518
1470 protected: 1519 protected:
1471 // An iterator that iterates over a given thread's stack. 1520 // An iterator that iterates over a given thread's stack.
1472 StackFrameIteratorBase(Isolate* isolate, bool can_access_heap_objects); 1521 StackFrameIteratorBase(Isolate* isolate, bool can_access_heap_objects);
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
1605 1654
1606 1655
1607 // Reads all frames on the current stack and copies them into the current 1656 // Reads all frames on the current stack and copies them into the current
1608 // zone memory. 1657 // zone memory.
1609 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); 1658 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone);
1610 1659
1611 } // namespace internal 1660 } // namespace internal
1612 } // namespace v8 1661 } // namespace v8
1613 1662
1614 #endif // V8_FRAMES_H_ 1663 #endif // V8_FRAMES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698