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

Side by Side Diff: src/arm/macro-assembler-arm.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/arm/codegen-arm.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-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 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 Register expected_reg = r2; 750 Register expected_reg = r2;
751 Register code_reg = r3; 751 Register code_reg = r3;
752 752
753 ldr(code_reg, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); 753 ldr(code_reg, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset));
754 ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset)); 754 ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
755 ldr(expected_reg, 755 ldr(expected_reg,
756 FieldMemOperand(code_reg, 756 FieldMemOperand(code_reg,
757 SharedFunctionInfo::kFormalParameterCountOffset)); 757 SharedFunctionInfo::kFormalParameterCountOffset));
758 mov(expected_reg, Operand(expected_reg, ASR, kSmiTagSize)); 758 mov(expected_reg, Operand(expected_reg, ASR, kSmiTagSize));
759 ldr(code_reg, 759 ldr(code_reg,
760 MemOperand(code_reg, SharedFunctionInfo::kCodeOffset - kHeapObjectTag)); 760 MemOperand(r1, JSFunction::kCodeOffset - kHeapObjectTag));
761 add(code_reg, code_reg, Operand(Code::kHeaderSize - kHeapObjectTag)); 761 add(code_reg, code_reg, Operand(Code::kHeaderSize - kHeapObjectTag));
762 762
763 ParameterCount expected(expected_reg); 763 ParameterCount expected(expected_reg);
764 InvokeCode(code_reg, expected, actual, flag); 764 InvokeCode(code_reg, expected, actual, flag);
765 } 765 }
766 766
767 767
768 void MacroAssembler::InvokeFunction(JSFunction* function, 768 void MacroAssembler::InvokeFunction(JSFunction* function,
769 const ParameterCount& actual, 769 const ParameterCount& actual,
770 InvokeFlag flag) { 770 InvokeFlag flag) {
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
1501 ldr(r1, FieldMemOperand(target, 1501 ldr(r1, FieldMemOperand(target,
1502 JSBuiltinsObject::OffsetOfFunctionWithId(id))); 1502 JSBuiltinsObject::OffsetOfFunctionWithId(id)));
1503 1503
1504 // Load the code entry point from the builtins object. 1504 // Load the code entry point from the builtins object.
1505 ldr(target, FieldMemOperand(target, 1505 ldr(target, FieldMemOperand(target,
1506 JSBuiltinsObject::OffsetOfCodeWithId(id))); 1506 JSBuiltinsObject::OffsetOfCodeWithId(id)));
1507 if (FLAG_debug_code) { 1507 if (FLAG_debug_code) {
1508 // Make sure the code objects in the builtins object and in the 1508 // Make sure the code objects in the builtins object and in the
1509 // builtin function are the same. 1509 // builtin function are the same.
1510 push(r1); 1510 push(r1);
1511 ldr(r1, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); 1511 ldr(r1, FieldMemOperand(r1, JSFunction::kCodeOffset));
1512 ldr(r1, FieldMemOperand(r1, SharedFunctionInfo::kCodeOffset));
1513 cmp(r1, target); 1512 cmp(r1, target);
1514 Assert(eq, "Builtin code object changed"); 1513 Assert(eq, "Builtin code object changed");
1515 pop(r1); 1514 pop(r1);
1516 } 1515 }
1517 add(target, target, Operand(Code::kHeaderSize - kHeapObjectTag)); 1516 add(target, target, Operand(Code::kHeaderSize - kHeapObjectTag));
1518 } 1517 }
1519 1518
1520 1519
1521 void MacroAssembler::SetCounter(StatsCounter* counter, int value, 1520 void MacroAssembler::SetCounter(StatsCounter* counter, int value,
1522 Register scratch1, Register scratch2) { 1521 Register scratch1, Register scratch2) {
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
1911 1910
1912 void CodePatcher::Emit(Address addr) { 1911 void CodePatcher::Emit(Address addr) {
1913 masm()->emit(reinterpret_cast<Instr>(addr)); 1912 masm()->emit(reinterpret_cast<Instr>(addr));
1914 } 1913 }
1915 #endif // ENABLE_DEBUGGER_SUPPORT 1914 #endif // ENABLE_DEBUGGER_SUPPORT
1916 1915
1917 1916
1918 } } // namespace v8::internal 1917 } } // namespace v8::internal
1919 1918
1920 #endif // V8_TARGET_ARCH_ARM 1919 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/codegen-arm.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698