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

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: Remove patch dependency 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
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 // CallSite::IsConstructor does not correctly detect builtin
Yang 2016/06/30 12:34:23 Isn't this comment outdated now that you actually
jgruber 2016/06/30 14:40:29 Done.
437 // constructors. Instead, we reuse the receiver field to pass along a
438 // special symbol marking builtin constructors.
439 Handle<Object> recv;
440 if (exit_frame->IsConstructor()) {
441 recv = handle(heap()->call_site_constructor_symbol(), this);
442 } else {
443 recv = handle(exit_frame->receiver(), this);
444 }
445
437 elements = MaybeGrow(this, elements, cursor, cursor + 4); 446 elements = MaybeGrow(this, elements, cursor, cursor + 4);
438 elements->set(cursor++, *factory()->undefined_value()); 447 elements->set(cursor++, *recv);
439 elements->set(cursor++, *fun); 448 elements->set(cursor++, *fun);
440 elements->set(cursor++, *code); 449 elements->set(cursor++, *code);
441 elements->set(cursor++, Smi::FromInt(offset)); 450 elements->set(cursor++, Smi::FromInt(offset));
442 frames_seen++; 451 frames_seen++;
443 } break; 452 } break;
444 453
445 case StackFrame::WASM: { 454 case StackFrame::WASM: {
446 WasmFrame* wasm_frame = WasmFrame::cast(frame); 455 WasmFrame* wasm_frame = WasmFrame::cast(frame);
447 Code* code = wasm_frame->unchecked_code(); 456 Code* code = wasm_frame->unchecked_code();
448 Handle<AbstractCode> abstract_code = 457 Handle<AbstractCode> abstract_code =
(...skipping 2629 matching lines...) Expand 10 before | Expand all | Expand 10 after
3078 // Then check whether this scope intercepts. 3087 // Then check whether this scope intercepts.
3079 if ((flag & intercept_mask_)) { 3088 if ((flag & intercept_mask_)) {
3080 intercepted_flags_ |= flag; 3089 intercepted_flags_ |= flag;
3081 return true; 3090 return true;
3082 } 3091 }
3083 return false; 3092 return false;
3084 } 3093 }
3085 3094
3086 } // namespace internal 3095 } // namespace internal
3087 } // namespace v8 3096 } // namespace v8
OLDNEW
« src/builtins.cc ('K') | « 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