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

Unified Diff: src/ia32/macro-assembler-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/ia32/macro-assembler-ia32.h ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/macro-assembler-ia32.cc
diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc
index 918c90df7bd5860bd6e2bc8c9fd108e7060fd672..390f0a000f1f711511b9c47b0e09f2ffc2c9ef33 100644
--- a/src/ia32/macro-assembler-ia32.cc
+++ b/src/ia32/macro-assembler-ia32.cc
@@ -892,6 +892,35 @@ void MacroAssembler::AssertUndefinedOrAllocationSite(Register object) {
}
}
+void MacroAssembler::AssertApiCallResult(Register object) {
+ if (emit_debug_code()) {
+ Label done_checking;
+ Push(object);
+
+ // Check for Smis.
+ JumpIfSmi(object, &done_checking, Label::kNear);
+
+ // Check for valid Oddballs.
+ JumpIfRoot(object, Heap::kTrueValueRootIndex, &done_checking, Label::kNear);
+ JumpIfRoot(object, Heap::kFalseValueRootIndex, &done_checking,
+ Label::kNear);
+ JumpIfRoot(object, Heap::kNullValueRootIndex, &done_checking, Label::kNear);
+ JumpIfRoot(object, Heap::kUndefinedValueRootIndex, &done_checking,
+ Label::kNear);
+
+ // Check for other primitives (String, Symbol and HeapNumber).
+ STATIC_ASSERT(LAST_PRIMITIVE_TYPE == ODDBALL_TYPE);
+ CmpObjectType(object, LAST_PRIMITIVE_TYPE, object);
+ j(below, &done_checking, Label::kNear);
+
+ // Check for JSReceivers.
+ CmpInstanceType(object, FIRST_JS_RECEIVER_TYPE);
+ Check(above_equal, kAPICallReturnedInvalidObject);
+
+ bind(&done_checking);
+ Pop(object);
+ }
+}
void MacroAssembler::AssertNotSmi(Register object) {
if (emit_debug_code()) {
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698