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

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 3120006: Put direct code pointers into JSFunction objects. This is a first step... (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/x64/codegen-x64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 575
576 // Load the JavaScript builtin function from the builtins object. 576 // Load the JavaScript builtin function from the builtins object.
577 movq(rdi, FieldOperand(target, JSBuiltinsObject::OffsetOfFunctionWithId(id))); 577 movq(rdi, FieldOperand(target, JSBuiltinsObject::OffsetOfFunctionWithId(id)));
578 578
579 // Load the code entry point from the builtins object. 579 // Load the code entry point from the builtins object.
580 movq(target, FieldOperand(target, JSBuiltinsObject::OffsetOfCodeWithId(id))); 580 movq(target, FieldOperand(target, JSBuiltinsObject::OffsetOfCodeWithId(id)));
581 if (FLAG_debug_code) { 581 if (FLAG_debug_code) {
582 // Make sure the code objects in the builtins object and in the 582 // Make sure the code objects in the builtins object and in the
583 // builtin function are the same. 583 // builtin function are the same.
584 push(target); 584 push(target);
585 movq(target, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); 585 movq(target, FieldOperand(rdi, JSFunction::kCodeOffset));
586 movq(target, FieldOperand(target, SharedFunctionInfo::kCodeOffset));
587 cmpq(target, Operand(rsp, 0)); 586 cmpq(target, Operand(rsp, 0));
588 Assert(equal, "Builtin code object changed"); 587 Assert(equal, "Builtin code object changed");
589 pop(target); 588 pop(target);
590 } 589 }
591 lea(target, FieldOperand(target, Code::kHeaderSize)); 590 lea(target, FieldOperand(target, Code::kHeaderSize));
592 } 591 }
593 592
594 593
595 void MacroAssembler::Set(Register dst, int64_t x) { 594 void MacroAssembler::Set(Register dst, int64_t x) {
596 if (x == 0) { 595 if (x == 0) {
(...skipping 1686 matching lines...) Expand 10 before | Expand all | Expand 10 after
2283 2282
2284 2283
2285 void MacroAssembler::InvokeFunction(Register function, 2284 void MacroAssembler::InvokeFunction(Register function,
2286 const ParameterCount& actual, 2285 const ParameterCount& actual,
2287 InvokeFlag flag) { 2286 InvokeFlag flag) {
2288 ASSERT(function.is(rdi)); 2287 ASSERT(function.is(rdi));
2289 movq(rdx, FieldOperand(function, JSFunction::kSharedFunctionInfoOffset)); 2288 movq(rdx, FieldOperand(function, JSFunction::kSharedFunctionInfoOffset));
2290 movq(rsi, FieldOperand(function, JSFunction::kContextOffset)); 2289 movq(rsi, FieldOperand(function, JSFunction::kContextOffset));
2291 movsxlq(rbx, 2290 movsxlq(rbx,
2292 FieldOperand(rdx, SharedFunctionInfo::kFormalParameterCountOffset)); 2291 FieldOperand(rdx, SharedFunctionInfo::kFormalParameterCountOffset));
2293 movq(rdx, FieldOperand(rdx, SharedFunctionInfo::kCodeOffset)); 2292 movq(rdx, FieldOperand(rdi, JSFunction::kCodeOffset));
2294 // Advances rdx to the end of the Code object header, to the start of 2293 // Advances rdx to the end of the Code object header, to the start of
2295 // the executable code. 2294 // the executable code.
2296 lea(rdx, FieldOperand(rdx, Code::kHeaderSize)); 2295 lea(rdx, FieldOperand(rdx, Code::kHeaderSize));
2297 2296
2298 ParameterCount expected(rbx); 2297 ParameterCount expected(rbx);
2299 InvokeCode(rdx, expected, actual, flag); 2298 InvokeCode(rdx, expected, actual, flag);
2300 } 2299 }
2301 2300
2302 2301
2303 void MacroAssembler::InvokeFunction(JSFunction* function, 2302 void MacroAssembler::InvokeFunction(JSFunction* function,
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
2948 CPU::FlushICache(address_, size_); 2947 CPU::FlushICache(address_, size_);
2949 2948
2950 // Check that the code was patched as expected. 2949 // Check that the code was patched as expected.
2951 ASSERT(masm_.pc_ == address_ + size_); 2950 ASSERT(masm_.pc_ == address_ + size_);
2952 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); 2951 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
2953 } 2952 }
2954 2953
2955 } } // namespace v8::internal 2954 } } // namespace v8::internal
2956 2955
2957 #endif // V8_TARGET_ARCH_X64 2956 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698