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

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

Issue 8883011: Implement ICs for constructor calls. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years 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/ia32/stub-cache-ia32.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 fcae7a2fcf78c1a4c73efc80998531309cb8bf09..8540d168ea7c96703a6dab2b453c00b220348b1f 100644
--- a/src/ia32/macro-assembler-ia32.cc
+++ b/src/ia32/macro-assembler-ia32.cc
@@ -2034,6 +2034,45 @@ void MacroAssembler::InvokeFunction(Handle<JSFunction> function,
}
+void MacroAssembler::InvokeConstruct(Register fun,
+ const ParameterCount& actual) {
+ // Load argument count into eax.
+ if (actual.is_immediate()) {
+ SafeSet(eax, Immediate(actual.immediate()));
+ } else {
+ ASSERT(actual.reg().is(eax));
+ }
+
+ // Dispatch to the function-specific construct stub.
+ ASSERT(fun.is(edi));
+ mov(ebx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
+ mov(ebx, FieldOperand(ebx, SharedFunctionInfo::kConstructStubOffset));
+ lea(ebx, FieldOperand(ebx, Code::kHeaderSize));
+ jmp(ebx);
+}
+
+
+void MacroAssembler::InvokeConstruct(Handle<JSFunction> function,
+ const ParameterCount& actual) {
+ // Get the function and setup the context.
+ mov(edi, Immediate(function));
+ mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
+
+ // Load argument count into eax.
+ if (actual.is_immediate()) {
+ SafeSet(eax, Immediate(actual.immediate()));
+ } else {
+ ASSERT(actual.reg().is(eax));
+ }
+
+ // Dispatch to the function-specific construct stub.
+ mov(ebx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
+ mov(ebx, FieldOperand(ebx, SharedFunctionInfo::kConstructStubOffset));
+ lea(ebx, FieldOperand(ebx, Code::kHeaderSize));
+ jmp(ebx);
+}
+
+
void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id,
InvokeFlag flag,
const CallWrapper& call_wrapper) {
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/ia32/stub-cache-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698