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

Unified Diff: src/ia32/code-stubs-ia32.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/builtins/x64/builtins-x64.cc ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/code-stubs-ia32.cc
diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc
index 6550d6e016cb587cb9bc22a6ac3c61333ac1ad6b..9053a431cf9cfed99a79f4c18d835c0171acecb9 100644
--- a/src/ia32/code-stubs-ia32.cc
+++ b/src/ia32/code-stubs-ia32.cc
@@ -2670,40 +2670,8 @@ static void CallApiFunctionAndReturn(MacroAssembler* masm,
Immediate(isolate->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 = eax;
- Register map = ecx;
-
- __ JumpIfSmi(return_value, &ok, Label::kNear);
- __ mov(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);
-
- __ cmp(map, isolate->factory()->heap_number_map());
- __ j(equal, &ok, Label::kNear);
-
- __ cmp(return_value, isolate->factory()->undefined_value());
- __ j(equal, &ok, Label::kNear);
-
- __ cmp(return_value, isolate->factory()->true_value());
- __ j(equal, &ok, Label::kNear);
-
- __ cmp(return_value, isolate->factory()->false_value());
- __ j(equal, &ok, Label::kNear);
-
- __ cmp(return_value, isolate->factory()->null_value());
- __ j(equal, &ok, Label::kNear);
-
- __ Abort(kAPICallReturnedInvalidObject);
-
- __ bind(&ok);
-#endif
+ __ AssertApiCallResult(eax);
if (stack_space_operand != nullptr) {
DCHECK_EQ(0, stack_space);
@@ -2800,6 +2768,12 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
__ mov(context, FieldOperand(callee, JSFunction::kContextOffset));
}
+ if (!this->is_store()) {
+ __ mov(eax, Immediate(this->argc()));
+ __ Jump(masm->isolate()->builtins()->CallFunctionCallback(),
+ RelocInfo::CODE_TARGET);
+ }
+
// API function gets reference to the v8::Arguments. If CPU profiler
// is enabled wrapper function will be called and we need to pass
// address of the callback as additional parameter, always allocate
« no previous file with comments | « src/builtins/x64/builtins-x64.cc ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698