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

Unified Diff: src/x64/code-stubs-x64.cc

Issue 2841913003: [WIP] Initial CallFunctionCallback builtin.
Patch Set: Fix wrong register for arm64. Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mips64/macro-assembler-mips64.cc ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/code-stubs-x64.cc
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc
index 84630928d49ee3a256af73a9a2268d49e029d49c..ae15de94d299d644e8cfd6e7949569c7a8b15793 100644
--- a/src/x64/code-stubs-x64.cc
+++ b/src/x64/code-stubs-x64.cc
@@ -2636,40 +2636,8 @@ static void CallApiFunctionAndReturn(MacroAssembler* masm,
__ Cmp(Operand(rdi, 0), factory->the_hole_value());
__ j(not_equal, &promote_scheduled_exception);
-#if DEBUG
// Check if the function returned a valid JavaScript value.
- Label ok;
- Register return_value = rax;
- Register map = rcx;
-
- __ JumpIfSmi(return_value, &ok, Label::kNear);
- __ movp(map, FieldOperand(return_value, HeapObject::kMapOffset));
-
- __ CmpInstanceType(map, LAST_NAME_TYPE);
- __ j(below_equal, &ok, Label::kNear);
-
- __ CmpInstanceType(map, FIRST_JS_RECEIVER_TYPE);
- __ j(above_equal, &ok, Label::kNear);
-
- __ CompareRoot(map, Heap::kHeapNumberMapRootIndex);
- __ j(equal, &ok, Label::kNear);
-
- __ CompareRoot(return_value, Heap::kUndefinedValueRootIndex);
- __ j(equal, &ok, Label::kNear);
-
- __ CompareRoot(return_value, Heap::kTrueValueRootIndex);
- __ j(equal, &ok, Label::kNear);
-
- __ CompareRoot(return_value, Heap::kFalseValueRootIndex);
- __ j(equal, &ok, Label::kNear);
-
- __ CompareRoot(return_value, Heap::kNullValueRootIndex);
- __ j(equal, &ok, Label::kNear);
-
- __ Abort(kAPICallReturnedInvalidObject);
-
- __ bind(&ok);
-#endif
+ __ AssertApiCallResult(rax);
if (stack_space_operand != nullptr) {
DCHECK_EQ(stack_space, 0);
@@ -2764,6 +2732,12 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
__ movp(context, FieldOperand(callee, JSFunction::kContextOffset));
}
+ if (!this->is_store()) {
+ __ Set(rax, this->argc());
+ __ jmp(masm->isolate()->builtins()->CallFunctionCallback(),
+ RelocInfo::CODE_TARGET);
+ }
+
// Allocate the v8::Arguments structure in the arguments' space since
// it's not controlled by GC.
const int kApiStackSpace = 3;
« no previous file with comments | « src/mips64/macro-assembler-mips64.cc ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698