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

Side by Side Diff: src/frames.h

Issue 2555243002: [wasm] Fix location for error in asm.js ToNumber conversion (Closed)
Patch Set: Fix gc error by storing callee_pc_address Created 4 years 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
« no previous file with comments | « src/compiler/wasm-compiler.cc ('k') | src/frames.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 // 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/handles.h" 9 #include "src/handles.h"
10 #include "src/safepoint-table.h" 10 #include "src/safepoint-table.h"
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 NO_ID = 0 434 NO_ID = 0
435 }; 435 };
436 436
437 // Used to mark the outermost JS entry frame. 437 // Used to mark the outermost JS entry frame.
438 enum JsFrameMarker { 438 enum JsFrameMarker {
439 INNER_JSENTRY_FRAME = 0, 439 INNER_JSENTRY_FRAME = 0,
440 OUTERMOST_JSENTRY_FRAME = 1 440 OUTERMOST_JSENTRY_FRAME = 1
441 }; 441 };
442 442
443 struct State { 443 struct State {
444 State() : sp(NULL), fp(NULL), pc_address(NULL), 444 Address sp = nullptr;
445 constant_pool_address(NULL) { } 445 Address fp = nullptr;
446 Address sp; 446 Address* pc_address = nullptr;
447 Address fp; 447 Address* callee_pc_address = nullptr;
448 Address* pc_address; 448 Address* constant_pool_address = nullptr;
449 Address* constant_pool_address;
450 }; 449 };
451 450
452 // Copy constructor; it breaks the connection to host iterator 451 // Copy constructor; it breaks the connection to host iterator
453 // (as an iterator usually lives on stack). 452 // (as an iterator usually lives on stack).
454 StackFrame(const StackFrame& original) { 453 StackFrame(const StackFrame& original) {
455 this->state_ = original.state_; 454 this->state_ = original.state_;
456 this->iterator_ = NULL; 455 this->iterator_ = NULL;
457 this->isolate_ = original.isolate_; 456 this->isolate_ = original.isolate_;
458 } 457 }
459 458
(...skipping 18 matching lines...) Expand all
478 477
479 bool is_java_script() const { 478 bool is_java_script() const {
480 Type type = this->type(); 479 Type type = this->type();
481 return (type == JAVA_SCRIPT) || (type == OPTIMIZED) || 480 return (type == JAVA_SCRIPT) || (type == OPTIMIZED) ||
482 (type == INTERPRETED) || (type == BUILTIN); 481 (type == INTERPRETED) || (type == BUILTIN);
483 } 482 }
484 483
485 // Accessors. 484 // Accessors.
486 Address sp() const { return state_.sp; } 485 Address sp() const { return state_.sp; }
487 Address fp() const { return state_.fp; } 486 Address fp() const { return state_.fp; }
487 Address callee_pc() const { return *state_.callee_pc_address; }
488 Address caller_sp() const { return GetCallerStackPointer(); } 488 Address caller_sp() const { return GetCallerStackPointer(); }
489 489
490 // If this frame is optimized and was dynamically aligned return its old 490 // If this frame is optimized and was dynamically aligned return its old
491 // unaligned frame pointer. When the frame is deoptimized its FP will shift 491 // unaligned frame pointer. When the frame is deoptimized its FP will shift
492 // up one word and become unaligned. 492 // up one word and become unaligned.
493 Address UnpaddedFP() const; 493 Address UnpaddedFP() const;
494 494
495 Address pc() const { return *pc_address(); } 495 Address pc() const { return *pc_address(); }
496 void set_pc(Address pc) { *pc_address() = pc; } 496 void set_pc(Address pc) { *pc_address() = pc; }
497 497
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 int LookupExceptionHandlerInTable(int* data); 1104 int LookupExceptionHandlerInTable(int* data);
1105 1105
1106 // Determine the code for the frame. 1106 // Determine the code for the frame.
1107 Code* unchecked_code() const override; 1107 Code* unchecked_code() const override;
1108 1108
1109 // Accessors. 1109 // Accessors.
1110 Object* wasm_instance() const; 1110 Object* wasm_instance() const;
1111 uint32_t function_index() const; 1111 uint32_t function_index() const;
1112 Script* script() const override; 1112 Script* script() const override;
1113 int position() const override; 1113 int position() const override;
1114 bool at_to_number_conversion() const;
1114 1115
1115 static WasmFrame* cast(StackFrame* frame) { 1116 static WasmFrame* cast(StackFrame* frame) {
1116 DCHECK(frame->is_wasm()); 1117 DCHECK(frame->is_wasm());
1117 return static_cast<WasmFrame*>(frame); 1118 return static_cast<WasmFrame*>(frame);
1118 } 1119 }
1119 1120
1120 protected: 1121 protected:
1121 inline explicit WasmFrame(StackFrameIteratorBase* iterator); 1122 inline explicit WasmFrame(StackFrameIteratorBase* iterator);
1122 1123
1123 Address GetCallerStackPointer() const override; 1124 Address GetCallerStackPointer() const override;
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
1365 1366
1366 1367
1367 // Reads all frames on the current stack and copies them into the current 1368 // Reads all frames on the current stack and copies them into the current
1368 // zone memory. 1369 // zone memory.
1369 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); 1370 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone);
1370 1371
1371 } // namespace internal 1372 } // namespace internal
1372 } // namespace v8 1373 } // namespace v8
1373 1374
1374 #endif // V8_FRAMES_H_ 1375 #endif // V8_FRAMES_H_
OLDNEW
« no previous file with comments | « src/compiler/wasm-compiler.cc ('k') | src/frames.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698