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

Side by Side Diff: src/isolate.cc

Issue 2106883003: [builtins] Add receiver to builtin exit frames (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments Created 4 years, 5 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/ia32/builtins-ia32.cc ('k') | src/js/messages.js » ('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/isolate.h" 5 #include "src/isolate.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include <fstream> // NOLINT(readability/streams) 9 #include <fstream> // NOLINT(readability/streams)
10 #include <sstream> 10 #include <sstream>
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 } 426 }
427 } break; 427 } break;
428 428
429 case StackFrame::BUILTIN_EXIT: { 429 case StackFrame::BUILTIN_EXIT: {
430 BuiltinExitFrame* exit_frame = BuiltinExitFrame::cast(frame); 430 BuiltinExitFrame* exit_frame = BuiltinExitFrame::cast(frame);
431 Handle<JSFunction> fun = handle(exit_frame->function(), this); 431 Handle<JSFunction> fun = handle(exit_frame->function(), this);
432 Handle<Code> code = handle(exit_frame->LookupCode(), this); 432 Handle<Code> code = handle(exit_frame->LookupCode(), this);
433 int offset = 433 int offset =
434 static_cast<int>(exit_frame->pc() - code->instruction_start()); 434 static_cast<int>(exit_frame->pc() - code->instruction_start());
435 435
436 // For now, builtin exit frames do not pass along a receiver. 436 // In order to help CallSite::IsConstructor detect builtin constructors,
437 // we reuse the receiver field to pass along a special symbol.
438 Handle<Object> recv;
439 if (exit_frame->IsConstructor()) {
440 recv = handle(heap()->call_site_constructor_symbol(), this);
441 } else {
442 recv = handle(exit_frame->receiver(), this);
443 }
444
437 elements = MaybeGrow(this, elements, cursor, cursor + 4); 445 elements = MaybeGrow(this, elements, cursor, cursor + 4);
438 elements->set(cursor++, *factory()->undefined_value()); 446 elements->set(cursor++, *recv);
439 elements->set(cursor++, *fun); 447 elements->set(cursor++, *fun);
440 elements->set(cursor++, *code); 448 elements->set(cursor++, *code);
441 elements->set(cursor++, Smi::FromInt(offset)); 449 elements->set(cursor++, Smi::FromInt(offset));
442 frames_seen++; 450 frames_seen++;
443 } break; 451 } break;
444 452
445 case StackFrame::WASM: { 453 case StackFrame::WASM: {
446 WasmFrame* wasm_frame = WasmFrame::cast(frame); 454 WasmFrame* wasm_frame = WasmFrame::cast(frame);
447 Code* code = wasm_frame->unchecked_code(); 455 Code* code = wasm_frame->unchecked_code();
448 Handle<AbstractCode> abstract_code = 456 Handle<AbstractCode> abstract_code =
(...skipping 2629 matching lines...) Expand 10 before | Expand all | Expand 10 after
3078 // Then check whether this scope intercepts. 3086 // Then check whether this scope intercepts.
3079 if ((flag & intercept_mask_)) { 3087 if ((flag & intercept_mask_)) {
3080 intercepted_flags_ |= flag; 3088 intercepted_flags_ |= flag;
3081 return true; 3089 return true;
3082 } 3090 }
3083 return false; 3091 return false;
3084 } 3092 }
3085 3093
3086 } // namespace internal 3094 } // namespace internal
3087 } // namespace v8 3095 } // namespace v8
OLDNEW
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/js/messages.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698