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

Side by Side Diff: src/arm/codegen-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/builtins-arm.cc ('k') | src/arm/macro-assembler-arm.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 1514 matching lines...) Expand 10 before | Expand all | Expand 10 after
1525 STATIC_ASSERT(LAST_TYPE == JS_FUNCTION_TYPE); 1525 STATIC_ASSERT(LAST_TYPE == JS_FUNCTION_TYPE);
1526 STATIC_ASSERT(JS_FUNCTION_TYPE == LAST_JS_OBJECT_TYPE + 1); 1526 STATIC_ASSERT(JS_FUNCTION_TYPE == LAST_JS_OBJECT_TYPE + 1);
1527 __ CompareObjectType(receiver_reg, r2, r3, FIRST_JS_OBJECT_TYPE); 1527 __ CompareObjectType(receiver_reg, r2, r3, FIRST_JS_OBJECT_TYPE);
1528 __ b(lt, &build_args); 1528 __ b(lt, &build_args);
1529 1529
1530 // Check that applicand.apply is Function.prototype.apply. 1530 // Check that applicand.apply is Function.prototype.apply.
1531 __ ldr(r0, MemOperand(sp, kPointerSize)); 1531 __ ldr(r0, MemOperand(sp, kPointerSize));
1532 __ BranchOnSmi(r0, &build_args); 1532 __ BranchOnSmi(r0, &build_args);
1533 __ CompareObjectType(r0, r1, r2, JS_FUNCTION_TYPE); 1533 __ CompareObjectType(r0, r1, r2, JS_FUNCTION_TYPE);
1534 __ b(ne, &build_args); 1534 __ b(ne, &build_args);
1535 __ ldr(r0, FieldMemOperand(r0, JSFunction::kSharedFunctionInfoOffset));
1536 Handle<Code> apply_code(Builtins::builtin(Builtins::FunctionApply)); 1535 Handle<Code> apply_code(Builtins::builtin(Builtins::FunctionApply));
1537 __ ldr(r1, FieldMemOperand(r0, SharedFunctionInfo::kCodeOffset)); 1536 __ ldr(r1, FieldMemOperand(r0, JSFunction::kCodeOffset));
1538 __ cmp(r1, Operand(apply_code)); 1537 __ cmp(r1, Operand(apply_code));
1539 __ b(ne, &build_args); 1538 __ b(ne, &build_args);
1540 1539
1541 // Check that applicand is a function. 1540 // Check that applicand is a function.
1542 __ ldr(r1, MemOperand(sp, 2 * kPointerSize)); 1541 __ ldr(r1, MemOperand(sp, 2 * kPointerSize));
1543 __ BranchOnSmi(r1, &build_args); 1542 __ BranchOnSmi(r1, &build_args);
1544 __ CompareObjectType(r1, r2, r3, JS_FUNCTION_TYPE); 1543 __ CompareObjectType(r1, r2, r3, JS_FUNCTION_TYPE);
1545 __ b(ne, &build_args); 1544 __ b(ne, &build_args);
1546 1545
1547 // Copy the arguments to this function possibly from the 1546 // Copy the arguments to this function possibly from the
(...skipping 5303 matching lines...) Expand 10 before | Expand all | Expand 10 after
6851 // write barrier because the allocated object is in new space. 6850 // write barrier because the allocated object is in new space.
6852 __ LoadRoot(r1, Heap::kEmptyFixedArrayRootIndex); 6851 __ LoadRoot(r1, Heap::kEmptyFixedArrayRootIndex);
6853 __ LoadRoot(r2, Heap::kTheHoleValueRootIndex); 6852 __ LoadRoot(r2, Heap::kTheHoleValueRootIndex);
6854 __ str(r1, FieldMemOperand(r0, JSObject::kPropertiesOffset)); 6853 __ str(r1, FieldMemOperand(r0, JSObject::kPropertiesOffset));
6855 __ str(r1, FieldMemOperand(r0, JSObject::kElementsOffset)); 6854 __ str(r1, FieldMemOperand(r0, JSObject::kElementsOffset));
6856 __ str(r2, FieldMemOperand(r0, JSFunction::kPrototypeOrInitialMapOffset)); 6855 __ str(r2, FieldMemOperand(r0, JSFunction::kPrototypeOrInitialMapOffset));
6857 __ str(r3, FieldMemOperand(r0, JSFunction::kSharedFunctionInfoOffset)); 6856 __ str(r3, FieldMemOperand(r0, JSFunction::kSharedFunctionInfoOffset));
6858 __ str(cp, FieldMemOperand(r0, JSFunction::kContextOffset)); 6857 __ str(cp, FieldMemOperand(r0, JSFunction::kContextOffset));
6859 __ str(r1, FieldMemOperand(r0, JSFunction::kLiteralsOffset)); 6858 __ str(r1, FieldMemOperand(r0, JSFunction::kLiteralsOffset));
6860 6859
6860 // Initialize the code pointer in the function to be the one
6861 // found in the shared function info object.
6862 __ ldr(r3, FieldMemOperand(r3, SharedFunctionInfo::kCodeOffset));
6863 __ str(r3, FieldMemOperand(r0, JSFunction::kCodeOffset));
6864
6861 // Return result. The argument function info has been popped already. 6865 // Return result. The argument function info has been popped already.
6862 __ Ret(); 6866 __ Ret();
6863 6867
6864 // Create a new closure through the slower runtime call. 6868 // Create a new closure through the slower runtime call.
6865 __ bind(&gc); 6869 __ bind(&gc);
6866 __ Push(cp, r3); 6870 __ Push(cp, r3);
6867 __ TailCallRuntime(Runtime::kNewClosure, 2, 1); 6871 __ TailCallRuntime(Runtime::kNewClosure, 2, 1);
6868 } 6872 }
6869 6873
6870 6874
(...skipping 4570 matching lines...) Expand 10 before | Expand all | Expand 10 after
11441 __ bind(&string_add_runtime); 11445 __ bind(&string_add_runtime);
11442 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); 11446 __ TailCallRuntime(Runtime::kStringAdd, 2, 1);
11443 } 11447 }
11444 11448
11445 11449
11446 #undef __ 11450 #undef __
11447 11451
11448 } } // namespace v8::internal 11452 } } // namespace v8::internal
11449 11453
11450 #endif // V8_TARGET_ARCH_ARM 11454 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/arm/macro-assembler-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698