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

Side by Side Diff: src/arm/builtins-arm.cc

Issue 9227007: Version 3.8.6 (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 8 years, 11 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/assembler-arm-inl.h ('k') | src/arm/code-stubs-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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 // Handle construction of an empty array. 326 // Handle construction of an empty array.
327 __ bind(&empty_array); 327 __ bind(&empty_array);
328 AllocateEmptyJSArray(masm, 328 AllocateEmptyJSArray(masm,
329 r1, 329 r1,
330 r2, 330 r2,
331 r3, 331 r3,
332 r4, 332 r4,
333 r5, 333 r5,
334 call_generic_code); 334 call_generic_code);
335 __ IncrementCounter(counters->array_function_native(), 1, r3, r4); 335 __ IncrementCounter(counters->array_function_native(), 1, r3, r4);
336 // Setup return value, remove receiver from stack and return. 336 // Set up return value, remove receiver from stack and return.
337 __ mov(r0, r2); 337 __ mov(r0, r2);
338 __ add(sp, sp, Operand(kPointerSize)); 338 __ add(sp, sp, Operand(kPointerSize));
339 __ Jump(lr); 339 __ Jump(lr);
340 340
341 // Check for one argument. Bail out if argument is not smi or if it is 341 // Check for one argument. Bail out if argument is not smi or if it is
342 // negative. 342 // negative.
343 __ bind(&argc_one_or_more); 343 __ bind(&argc_one_or_more);
344 __ cmp(r0, Operand(1)); 344 __ cmp(r0, Operand(1));
345 __ b(ne, &argc_two_or_more); 345 __ b(ne, &argc_two_or_more);
346 STATIC_ASSERT(kSmiTag == 0); 346 STATIC_ASSERT(kSmiTag == 0);
(...skipping 22 matching lines...) Expand all
369 r1, 369 r1,
370 r2, 370 r2,
371 r3, 371 r3,
372 r4, 372 r4,
373 r5, 373 r5,
374 r6, 374 r6,
375 r7, 375 r7,
376 true, 376 true,
377 call_generic_code); 377 call_generic_code);
378 __ IncrementCounter(counters->array_function_native(), 1, r2, r4); 378 __ IncrementCounter(counters->array_function_native(), 1, r2, r4);
379 // Setup return value, remove receiver and argument from stack and return. 379 // Set up return value, remove receiver and argument from stack and return.
380 __ mov(r0, r3); 380 __ mov(r0, r3);
381 __ add(sp, sp, Operand(2 * kPointerSize)); 381 __ add(sp, sp, Operand(2 * kPointerSize));
382 __ Jump(lr); 382 __ Jump(lr);
383 383
384 // Handle construction of an array from a list of arguments. 384 // Handle construction of an array from a list of arguments.
385 __ bind(&argc_two_or_more); 385 __ bind(&argc_two_or_more);
386 __ mov(r2, Operand(r0, LSL, kSmiTagSize)); // Convet argc to a smi. 386 __ mov(r2, Operand(r0, LSL, kSmiTagSize)); // Convet argc to a smi.
387 387
388 // r0: argc 388 // r0: argc
389 // r1: constructor 389 // r1: constructor
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
944 944
945 // Reload the number of arguments from the stack. 945 // Reload the number of arguments from the stack.
946 // r1: constructor function 946 // r1: constructor function
947 // sp[0]: receiver 947 // sp[0]: receiver
948 // sp[1]: constructor function 948 // sp[1]: constructor function
949 // sp[2]: receiver 949 // sp[2]: receiver
950 // sp[3]: constructor function 950 // sp[3]: constructor function
951 // sp[4]: number of arguments (smi-tagged) 951 // sp[4]: number of arguments (smi-tagged)
952 __ ldr(r3, MemOperand(sp, 4 * kPointerSize)); 952 __ ldr(r3, MemOperand(sp, 4 * kPointerSize));
953 953
954 // Setup pointer to last argument. 954 // Set up pointer to last argument.
955 __ add(r2, fp, Operand(StandardFrameConstants::kCallerSPOffset)); 955 __ add(r2, fp, Operand(StandardFrameConstants::kCallerSPOffset));
956 956
957 // Setup number of arguments for function call below 957 // Set up number of arguments for function call below
958 __ mov(r0, Operand(r3, LSR, kSmiTagSize)); 958 __ mov(r0, Operand(r3, LSR, kSmiTagSize));
959 959
960 // Copy arguments and receiver to the expression stack. 960 // Copy arguments and receiver to the expression stack.
961 // r0: number of arguments 961 // r0: number of arguments
962 // r2: address of last argument (caller sp) 962 // r2: address of last argument (caller sp)
963 // r1: constructor function 963 // r1: constructor function
964 // r3: number of arguments (smi-tagged) 964 // r3: number of arguments (smi-tagged)
965 // sp[0]: receiver 965 // sp[0]: receiver
966 // sp[1]: constructor function 966 // sp[1]: constructor function
967 // sp[2]: receiver 967 // sp[2]: receiver
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 // Clear the context before we push it when entering the internal frame. 1075 // Clear the context before we push it when entering the internal frame.
1076 __ mov(cp, Operand(0, RelocInfo::NONE)); 1076 __ mov(cp, Operand(0, RelocInfo::NONE));
1077 1077
1078 // Enter an internal frame. 1078 // Enter an internal frame.
1079 { 1079 {
1080 FrameScope scope(masm, StackFrame::INTERNAL); 1080 FrameScope scope(masm, StackFrame::INTERNAL);
1081 1081
1082 // Set up the context from the function argument. 1082 // Set up the context from the function argument.
1083 __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset)); 1083 __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
1084 1084
1085 // Set up the roots register. 1085 __ InitializeRootRegister();
1086 ExternalReference roots_array_start =
1087 ExternalReference::roots_array_start(masm->isolate());
1088 __ mov(r10, Operand(roots_array_start));
1089 1086
1090 // Push the function and the receiver onto the stack. 1087 // Push the function and the receiver onto the stack.
1091 __ push(r1); 1088 __ push(r1);
1092 __ push(r2); 1089 __ push(r2);
1093 1090
1094 // Copy arguments to the stack in a loop. 1091 // Copy arguments to the stack in a loop.
1095 // r1: function 1092 // r1: function
1096 // r3: argc 1093 // r3: argc
1097 // r4: argv, i.e. points to first arg 1094 // r4: argv, i.e. points to first arg
1098 Label loop, entry; 1095 Label loop, entry;
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
1774 __ bind(&dont_adapt_arguments); 1771 __ bind(&dont_adapt_arguments);
1775 __ Jump(r3); 1772 __ Jump(r3);
1776 } 1773 }
1777 1774
1778 1775
1779 #undef __ 1776 #undef __
1780 1777
1781 } } // namespace v8::internal 1778 } } // namespace v8::internal
1782 1779
1783 #endif // V8_TARGET_ARCH_ARM 1780 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/assembler-arm-inl.h ('k') | src/arm/code-stubs-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698