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

Unified Diff: src/ia32/macro-assembler-ia32.cc

Issue 596096: Refactoring various pieces of post interceptor caching. (Closed)
Patch Set: Fix incorrect indentation Created 10 years, 10 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
Index: src/ia32/macro-assembler-ia32.cc
diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc
index 0bb6894097df50e809dd94c43618699ff860daca..826a4fbe01576bf24ac41f0988690046be4380ad 100644
--- a/src/ia32/macro-assembler-ia32.cc
+++ b/src/ia32/macro-assembler-ia32.cc
@@ -1145,6 +1145,16 @@ void MacroAssembler::CallRuntime(Runtime::Function* f, int num_arguments) {
}
+void MacroAssembler::CallExternalReference(ExternalReference ref,
+ int num_arguments) {
+ mov(eax, Immediate(num_arguments));
+ mov(ebx, Immediate(ref));
+
+ CEntryStub stub(1);
+ CallStub(&stub);
+}
+
+
Object* MacroAssembler::TryCallRuntime(Runtime::Function* f,
int num_arguments) {
if (f->nargs >= 0 && f->nargs != num_arguments) {
@@ -1365,6 +1375,20 @@ void MacroAssembler::InvokeFunction(Register fun,
}
+void MacroAssembler::InvokeFunction(JSFunction* function,
+ const ParameterCount& actual) {
+ ASSERT(function->is_compiled());
+ // Get the function and setup the context.
+ mov(edi, Immediate(Handle<JSFunction>(function)));
+ mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
+
+ // Jump to the cached code (tail call).
+ Handle<Code> code(function->code());
+ ParameterCount expected(function->shared()->formal_parameter_count());
+ InvokeCode(code, expected, actual, RelocInfo::CODE_TARGET, JUMP_FUNCTION);
+}
+
+
void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, InvokeFlag flag) {
// Calls are not allowed in some stubs.
ASSERT(flag == JUMP_FUNCTION || allow_stub_calls());

Powered by Google App Engine
This is Rietveld 408576698