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

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

Issue 3156028: Change code pointer in function objects to a pointer to the first... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 4 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/x64/macro-assembler-x64.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/macro-assembler-x64.cc
===================================================================
--- src/x64/macro-assembler-x64.cc (revision 5298)
+++ src/x64/macro-assembler-x64.cc (working copy)
@@ -581,28 +581,21 @@
}
-void MacroAssembler::GetBuiltinEntry(Register target, Builtins::JavaScript id) {
- ASSERT(!target.is(rdi));
-
+void MacroAssembler::GetBuiltinFunction(Register target,
+ Builtins::JavaScript id) {
// Load the builtins object into target register.
movq(target, Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX)));
movq(target, FieldOperand(target, GlobalObject::kBuiltinsOffset));
+ movq(target, FieldOperand(target,
+ JSBuiltinsObject::OffsetOfFunctionWithId(id)));
+}
- // Load the JavaScript builtin function from the builtins object.
- movq(rdi, FieldOperand(target, JSBuiltinsObject::OffsetOfFunctionWithId(id)));
- // Load the code entry point from the builtins object.
- movq(target, FieldOperand(target, JSBuiltinsObject::OffsetOfCodeWithId(id)));
- if (FLAG_debug_code) {
- // Make sure the code objects in the builtins object and in the
- // builtin function are the same.
- push(target);
- movq(target, FieldOperand(rdi, JSFunction::kCodeOffset));
- cmpq(target, Operand(rsp, 0));
- Assert(equal, "Builtin code object changed");
- pop(target);
- }
- lea(target, FieldOperand(target, Code::kHeaderSize));
+void MacroAssembler::GetBuiltinEntry(Register target, Builtins::JavaScript id) {
+ ASSERT(!target.is(rdi));
+ // Load the JavaScript builtin function from the builtins object.
+ GetBuiltinFunction(rdi, id);
+ movq(target, FieldOperand(rdi, JSFunction::kCodeEntryOffset));
}
@@ -2311,10 +2304,9 @@
movq(rsi, FieldOperand(function, JSFunction::kContextOffset));
movsxlq(rbx,
FieldOperand(rdx, SharedFunctionInfo::kFormalParameterCountOffset));
- movq(rdx, FieldOperand(rdi, JSFunction::kCodeOffset));
// Advances rdx to the end of the Code object header, to the start of
// the executable code.
- lea(rdx, FieldOperand(rdx, Code::kHeaderSize));
+ movq(rdx, FieldOperand(rdi, JSFunction::kCodeEntryOffset));
ParameterCount expected(rbx);
InvokeCode(rdx, expected, actual, flag);
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698