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

Side by Side Diff: src/frames.cc

Issue 1965343002: [Interpreter] Support compiling for baseline on return from interpreted function. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test for nosnap build Created 4 years, 7 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
« no previous file with comments | « src/compiler.cc ('k') | src/ia32/builtins-ia32.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 #include "src/frames.h" 5 #include "src/frames.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/ast/ast.h" 9 #include "src/ast/ast.h"
10 #include "src/ast/scopeinfo.h" 10 #include "src/ast/scopeinfo.h"
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 ReturnAddressLocationResolver resolver) { 393 ReturnAddressLocationResolver resolver) {
394 DCHECK(return_address_location_resolver_ == NULL); 394 DCHECK(return_address_location_resolver_ == NULL);
395 return_address_location_resolver_ = resolver; 395 return_address_location_resolver_ = resolver;
396 } 396 }
397 397
398 static bool IsInterpreterFramePc(Isolate* isolate, Address pc) { 398 static bool IsInterpreterFramePc(Isolate* isolate, Address pc) {
399 Code* interpreter_entry_trampoline = 399 Code* interpreter_entry_trampoline =
400 isolate->builtins()->builtin(Builtins::kInterpreterEntryTrampoline); 400 isolate->builtins()->builtin(Builtins::kInterpreterEntryTrampoline);
401 Code* interpreter_bytecode_dispatch = 401 Code* interpreter_bytecode_dispatch =
402 isolate->builtins()->builtin(Builtins::kInterpreterEnterBytecodeDispatch); 402 isolate->builtins()->builtin(Builtins::kInterpreterEnterBytecodeDispatch);
403 Code* interpreter_baseline_on_return =
404 isolate->builtins()->builtin(Builtins::kInterpreterMarkBaselineOnReturn);
403 405
404 return (pc >= interpreter_entry_trampoline->instruction_start() && 406 return (pc >= interpreter_entry_trampoline->instruction_start() &&
405 pc < interpreter_entry_trampoline->instruction_end()) || 407 pc < interpreter_entry_trampoline->instruction_end()) ||
406 (pc >= interpreter_bytecode_dispatch->instruction_start() && 408 (pc >= interpreter_bytecode_dispatch->instruction_start() &&
407 pc < interpreter_bytecode_dispatch->instruction_end()); 409 pc < interpreter_bytecode_dispatch->instruction_end()) ||
410 (pc >= interpreter_baseline_on_return->instruction_start() &&
411 pc < interpreter_baseline_on_return->instruction_end());
408 } 412 }
409 413
410 StackFrame::Type StackFrame::ComputeType(const StackFrameIteratorBase* iterator, 414 StackFrame::Type StackFrame::ComputeType(const StackFrameIteratorBase* iterator,
411 State* state) { 415 State* state) {
412 DCHECK(state->fp != NULL); 416 DCHECK(state->fp != NULL);
413 417
414 #if defined(USE_SIMULATOR) 418 #if defined(USE_SIMULATOR)
415 MSAN_MEMORY_IS_INITIALIZED( 419 MSAN_MEMORY_IS_INITIALIZED(
416 state->fp + CommonFrameConstants::kContextOrFrameTypeOffset, 420 state->fp + CommonFrameConstants::kContextOrFrameTypeOffset,
417 kPointerSize); 421 kPointerSize);
(...skipping 20 matching lines...) Expand all
438 return INTERPRETED; 442 return INTERPRETED;
439 } else { 443 } else {
440 return JAVA_SCRIPT; 444 return JAVA_SCRIPT;
441 } 445 }
442 } 446 }
443 } else { 447 } else {
444 // Look up the code object to figure out the type of the stack frame. 448 // Look up the code object to figure out the type of the stack frame.
445 Code* code_obj = 449 Code* code_obj =
446 GetContainingCode(iterator->isolate(), *(state->pc_address)); 450 GetContainingCode(iterator->isolate(), *(state->pc_address));
447 if (code_obj != nullptr) { 451 if (code_obj != nullptr) {
448 if (code_obj->is_interpreter_entry_trampoline() ||
449 code_obj->is_interpreter_enter_bytecode_dispatch()) {
450 return INTERPRETED;
451 }
452 switch (code_obj->kind()) { 452 switch (code_obj->kind()) {
453 case Code::BUILTIN: 453 case Code::BUILTIN:
454 if (marker->IsSmi()) break; 454 if (marker->IsSmi()) break;
455 if (code_obj->is_interpreter_trampoline_builtin()) {
456 return INTERPRETED;
457 }
455 // We treat frames for BUILTIN Code objects as OptimizedFrame for now 458 // We treat frames for BUILTIN Code objects as OptimizedFrame for now
456 // (all the builtins with JavaScript linkage are actually generated 459 // (all the builtins with JavaScript linkage are actually generated
457 // with TurboFan currently, so this is sound). 460 // with TurboFan currently, so this is sound).
458 return OPTIMIZED; 461 return OPTIMIZED;
459 case Code::FUNCTION: 462 case Code::FUNCTION:
460 return JAVA_SCRIPT; 463 return JAVA_SCRIPT;
461 case Code::OPTIMIZED_FUNCTION: 464 case Code::OPTIMIZED_FUNCTION:
462 return OPTIMIZED; 465 return OPTIMIZED;
463 case Code::WASM_FUNCTION: 466 case Code::WASM_FUNCTION:
464 return WASM; 467 return WASM;
(...skipping 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after
1792 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { 1795 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) {
1793 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); 1796 StackFrame* frame = AllocateFrameCopy(it.frame(), zone);
1794 list.Add(frame, zone); 1797 list.Add(frame, zone);
1795 } 1798 }
1796 return list.ToVector(); 1799 return list.ToVector();
1797 } 1800 }
1798 1801
1799 1802
1800 } // namespace internal 1803 } // namespace internal
1801 } // namespace v8 1804 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698