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

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

Issue 3186: Refactor the enum RelocMode changing the naming scheme from lower case to... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 12 years, 3 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/builtins-arm.cc ('k') | src/codegen.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-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 __ mov(ecx, Operand(eax)); 259 __ mov(ecx, Operand(eax));
260 __ jmp(&entry); 260 __ jmp(&entry);
261 __ bind(&loop); 261 __ bind(&loop);
262 __ push(Operand(ebx, ecx, times_4, 0)); 262 __ push(Operand(ebx, ecx, times_4, 0));
263 __ bind(&entry); 263 __ bind(&entry);
264 __ dec(ecx); 264 __ dec(ecx);
265 __ j(greater_equal, &loop); 265 __ j(greater_equal, &loop);
266 266
267 // Call the function. 267 // Call the function.
268 Label return_site; 268 Label return_site;
269 __ RecordPosition(position);
270 ParameterCount actual(eax); 269 ParameterCount actual(eax);
271 __ InvokeFunction(edi, actual, CALL_FUNCTION); 270 __ InvokeFunction(edi, actual, CALL_FUNCTION);
272 __ bind(&return_site); 271 __ bind(&return_site);
273 272
274 // Restore context from the frame. 273 // Restore context from the frame.
275 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); 274 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
276 275
277 // If the result is an object (in the ECMA sense), we should get rid 276 // If the result is an object (in the ECMA sense), we should get rid
278 // of the receiver and use the result; see ECMA-262 section 13.2.2-7 277 // of the receiver and use the result; see ECMA-262 section 13.2.2-7
279 // on page 74. 278 // on page 74.
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 __ bind(&entry); 347 __ bind(&entry);
349 __ cmp(ecx, Operand(eax)); 348 __ cmp(ecx, Operand(eax));
350 __ j(not_equal, &loop); 349 __ j(not_equal, &loop);
351 350
352 // Get the function from the stack and call it. 351 // Get the function from the stack and call it.
353 __ mov(edi, Operand(esp, eax, times_4, +1 * kPointerSize)); // +1 ~ receiver 352 __ mov(edi, Operand(esp, eax, times_4, +1 * kPointerSize)); // +1 ~ receiver
354 353
355 // Invoke the code. 354 // Invoke the code.
356 if (is_construct) { 355 if (is_construct) {
357 __ call(Handle<Code>(Builtins::builtin(Builtins::JSConstructCall)), 356 __ call(Handle<Code>(Builtins::builtin(Builtins::JSConstructCall)),
358 code_target); 357 RelocInfo::CODE_TARGET);
359 } else { 358 } else {
360 ParameterCount actual(eax); 359 ParameterCount actual(eax);
361 __ InvokeFunction(edi, actual, CALL_FUNCTION); 360 __ InvokeFunction(edi, actual, CALL_FUNCTION);
362 } 361 }
363 362
364 // Exit the JS frame. Notice that this also removes the empty 363 // Exit the JS frame. Notice that this also removes the empty
365 // context and the function left on the stack by the code 364 // context and the function left on the stack by the code
366 // invocation. 365 // invocation.
367 __ ExitInternalFrame(); 366 __ ExitInternalFrame();
368 __ ret(1 * kPointerSize); // remove receiver 367 __ ret(1 * kPointerSize); // remove receiver
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 __ dec(eax); 482 __ dec(eax);
484 483
485 // 6. Check that function really was a function and get the code to 484 // 6. Check that function really was a function and get the code to
486 // call from the function and check that the number of expected 485 // call from the function and check that the number of expected
487 // arguments matches what we're providing. 486 // arguments matches what we're providing.
488 { Label invoke; 487 { Label invoke;
489 __ test(edi, Operand(edi)); 488 __ test(edi, Operand(edi));
490 __ j(not_zero, &invoke, taken); 489 __ j(not_zero, &invoke, taken);
491 __ xor_(ebx, Operand(ebx)); 490 __ xor_(ebx, Operand(ebx));
492 __ GetBuiltinEntry(edx, Builtins::CALL_NON_FUNCTION); 491 __ GetBuiltinEntry(edx, Builtins::CALL_NON_FUNCTION);
493 __ jmp(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)), code_target); 492 __ jmp(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)),
493 RelocInfo::CODE_TARGET);
494 494
495 __ bind(&invoke); 495 __ bind(&invoke);
496 __ mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); 496 __ mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
497 __ mov(ebx, 497 __ mov(ebx,
498 FieldOperand(edx, SharedFunctionInfo::kFormalParameterCountOffset)); 498 FieldOperand(edx, SharedFunctionInfo::kFormalParameterCountOffset));
499 __ mov(edx, FieldOperand(edx, SharedFunctionInfo::kCodeOffset)); 499 __ mov(edx, FieldOperand(edx, SharedFunctionInfo::kCodeOffset));
500 __ lea(edx, FieldOperand(edx, Code::kHeaderSize)); 500 __ lea(edx, FieldOperand(edx, Code::kHeaderSize));
501 __ cmp(eax, Operand(ebx)); 501 __ cmp(eax, Operand(ebx));
502 __ j(not_equal, Handle<Code>(builtin(ArgumentsAdaptorTrampoline))); 502 __ j(not_equal, Handle<Code>(builtin(ArgumentsAdaptorTrampoline)));
503 } 503 }
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 Label entry, loop; 585 Label entry, loop;
586 __ mov(eax, Operand(ebp, kIndexOffset)); 586 __ mov(eax, Operand(ebp, kIndexOffset));
587 __ jmp(&entry); 587 __ jmp(&entry);
588 __ bind(&loop); 588 __ bind(&loop);
589 __ mov(ecx, Operand(ebp, 2 * kPointerSize)); // load arguments 589 __ mov(ecx, Operand(ebp, 2 * kPointerSize)); // load arguments
590 __ push(ecx); 590 __ push(ecx);
591 __ push(eax); 591 __ push(eax);
592 592
593 // Use inline caching to speed up access to arguments. 593 // Use inline caching to speed up access to arguments.
594 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize)); 594 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
595 __ call(ic, code_target); 595 __ call(ic, RelocInfo::CODE_TARGET);
596 596
597 // Remove IC arguments from the stack and push the nth argument. 597 // Remove IC arguments from the stack and push the nth argument.
598 __ add(Operand(esp), Immediate(2 * kPointerSize)); 598 __ add(Operand(esp), Immediate(2 * kPointerSize));
599 __ push(eax); 599 __ push(eax);
600 600
601 // Update the index on the stack and in register eax. 601 // Update the index on the stack and in register eax.
602 __ mov(eax, Operand(ebp, kIndexOffset)); 602 __ mov(eax, Operand(ebp, kIndexOffset));
603 __ add(Operand(eax), Immediate(1 << kSmiTagSize)); 603 __ add(Operand(eax), Immediate(1 << kSmiTagSize));
604 __ mov(Operand(ebp, kIndexOffset), eax); 604 __ mov(Operand(ebp, kIndexOffset), eax);
605 605
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 // Register state for stub CallFunction (from CallFunctionStub in ic-ia32.cc). 876 // Register state for stub CallFunction (from CallFunctionStub in ic-ia32.cc).
877 // ----------- S t a t e ------------- 877 // ----------- S t a t e -------------
878 // No registers used on entry. 878 // No registers used on entry.
879 // ----------------------------------- 879 // -----------------------------------
880 Generate_DebugBreakCallHelper(masm, 0, false); 880 Generate_DebugBreakCallHelper(masm, 0, false);
881 } 881 }
882 882
883 #undef __ 883 #undef __
884 884
885 } } // namespace v8::internal 885 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/builtins-arm.cc ('k') | src/codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698