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

Side by Side Diff: src/ia32/code-stubs-ia32.cc

Issue 14429003: Refactor ExternalReference::isolate_address() to not rely on Isolate::Current(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 7 years, 8 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/deoptimizer.h ('k') | src/ia32/deoptimizer-ia32.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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 for (int i = 0; i < XMMRegister::kNumRegisters; i++) { 549 for (int i = 0; i < XMMRegister::kNumRegisters; i++) {
550 XMMRegister reg = XMMRegister::from_code(i); 550 XMMRegister reg = XMMRegister::from_code(i);
551 __ movdbl(Operand(esp, i * kDoubleSize), reg); 551 __ movdbl(Operand(esp, i * kDoubleSize), reg);
552 } 552 }
553 } 553 }
554 const int argument_count = 1; 554 const int argument_count = 1;
555 555
556 AllowExternalCallThatCantCauseGC scope(masm); 556 AllowExternalCallThatCantCauseGC scope(masm);
557 __ PrepareCallCFunction(argument_count, ecx); 557 __ PrepareCallCFunction(argument_count, ecx);
558 __ mov(Operand(esp, 0 * kPointerSize), 558 __ mov(Operand(esp, 0 * kPointerSize),
559 Immediate(ExternalReference::isolate_address())); 559 Immediate(ExternalReference::isolate_address(masm->isolate())));
560 __ CallCFunction( 560 __ CallCFunction(
561 ExternalReference::store_buffer_overflow_function(masm->isolate()), 561 ExternalReference::store_buffer_overflow_function(masm->isolate()),
562 argument_count); 562 argument_count);
563 if (save_doubles_ == kSaveFPRegs) { 563 if (save_doubles_ == kSaveFPRegs) {
564 CpuFeatureScope scope(masm, SSE2); 564 CpuFeatureScope scope(masm, SSE2);
565 for (int i = 0; i < XMMRegister::kNumRegisters; i++) { 565 for (int i = 0; i < XMMRegister::kNumRegisters; i++) {
566 XMMRegister reg = XMMRegister::from_code(i); 566 XMMRegister reg = XMMRegister::from_code(i);
567 __ movdbl(reg, Operand(esp, i * kDoubleSize)); 567 __ movdbl(reg, Operand(esp, i * kDoubleSize));
568 } 568 }
569 __ add(esp, Immediate(kDoubleSize * XMMRegister::kNumRegisters)); 569 __ add(esp, Immediate(kDoubleSize * XMMRegister::kNumRegisters));
(...skipping 3299 matching lines...) Expand 10 before | Expand all | Expand 10 after
3869 // All checks done. Now push arguments for native regexp code. 3869 // All checks done. Now push arguments for native regexp code.
3870 Counters* counters = masm->isolate()->counters(); 3870 Counters* counters = masm->isolate()->counters();
3871 __ IncrementCounter(counters->regexp_entry_native(), 1); 3871 __ IncrementCounter(counters->regexp_entry_native(), 1);
3872 3872
3873 // Isolates: note we add an additional parameter here (isolate pointer). 3873 // Isolates: note we add an additional parameter here (isolate pointer).
3874 static const int kRegExpExecuteArguments = 9; 3874 static const int kRegExpExecuteArguments = 9;
3875 __ EnterApiExitFrame(kRegExpExecuteArguments); 3875 __ EnterApiExitFrame(kRegExpExecuteArguments);
3876 3876
3877 // Argument 9: Pass current isolate address. 3877 // Argument 9: Pass current isolate address.
3878 __ mov(Operand(esp, 8 * kPointerSize), 3878 __ mov(Operand(esp, 8 * kPointerSize),
3879 Immediate(ExternalReference::isolate_address())); 3879 Immediate(ExternalReference::isolate_address(masm->isolate())));
3880 3880
3881 // Argument 8: Indicate that this is a direct call from JavaScript. 3881 // Argument 8: Indicate that this is a direct call from JavaScript.
3882 __ mov(Operand(esp, 7 * kPointerSize), Immediate(1)); 3882 __ mov(Operand(esp, 7 * kPointerSize), Immediate(1));
3883 3883
3884 // Argument 7: Start (high end) of backtracking stack memory area. 3884 // Argument 7: Start (high end) of backtracking stack memory area.
3885 __ mov(esi, Operand::StaticVariable(address_of_regexp_stack_memory_address)); 3885 __ mov(esi, Operand::StaticVariable(address_of_regexp_stack_memory_address));
3886 __ add(esi, Operand::StaticVariable(address_of_regexp_stack_memory_size)); 3886 __ add(esi, Operand::StaticVariable(address_of_regexp_stack_memory_size));
3887 __ mov(Operand(esp, 6 * kPointerSize), esi); 3887 __ mov(Operand(esp, 6 * kPointerSize), esi);
3888 3888
3889 // Argument 6: Set the number of capture registers to zero to force global 3889 // Argument 6: Set the number of capture registers to zero to force global
(...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after
5023 ExternalReference scope_depth = 5023 ExternalReference scope_depth =
5024 ExternalReference::heap_always_allocate_scope_depth(masm->isolate()); 5024 ExternalReference::heap_always_allocate_scope_depth(masm->isolate());
5025 if (always_allocate_scope) { 5025 if (always_allocate_scope) {
5026 __ inc(Operand::StaticVariable(scope_depth)); 5026 __ inc(Operand::StaticVariable(scope_depth));
5027 } 5027 }
5028 5028
5029 // Call C function. 5029 // Call C function.
5030 __ mov(Operand(esp, 0 * kPointerSize), edi); // argc. 5030 __ mov(Operand(esp, 0 * kPointerSize), edi); // argc.
5031 __ mov(Operand(esp, 1 * kPointerSize), esi); // argv. 5031 __ mov(Operand(esp, 1 * kPointerSize), esi); // argv.
5032 __ mov(Operand(esp, 2 * kPointerSize), 5032 __ mov(Operand(esp, 2 * kPointerSize),
5033 Immediate(ExternalReference::isolate_address())); 5033 Immediate(ExternalReference::isolate_address(masm->isolate())));
5034 __ call(ebx); 5034 __ call(ebx);
5035 // Result is in eax or edx:eax - do not destroy these registers! 5035 // Result is in eax or edx:eax - do not destroy these registers!
5036 5036
5037 if (always_allocate_scope) { 5037 if (always_allocate_scope) {
5038 __ dec(Operand::StaticVariable(scope_depth)); 5038 __ dec(Operand::StaticVariable(scope_depth));
5039 } 5039 }
5040 5040
5041 // Make sure we're not trying to return 'the hole' from the runtime 5041 // Make sure we're not trying to return 'the hole' from the runtime
5042 // call as this may lead to crashes in the IC code later. 5042 // call as this may lead to crashes in the IC code later.
5043 if (FLAG_debug_code) { 5043 if (FLAG_debug_code) {
(...skipping 2420 matching lines...) Expand 10 before | Expand all | Expand 10 after
7464 } 7464 }
7465 7465
7466 7466
7467 void RecordWriteStub::InformIncrementalMarker(MacroAssembler* masm, Mode mode) { 7467 void RecordWriteStub::InformIncrementalMarker(MacroAssembler* masm, Mode mode) {
7468 regs_.SaveCallerSaveRegisters(masm, save_fp_regs_mode_); 7468 regs_.SaveCallerSaveRegisters(masm, save_fp_regs_mode_);
7469 int argument_count = 3; 7469 int argument_count = 3;
7470 __ PrepareCallCFunction(argument_count, regs_.scratch0()); 7470 __ PrepareCallCFunction(argument_count, regs_.scratch0());
7471 __ mov(Operand(esp, 0 * kPointerSize), regs_.object()); 7471 __ mov(Operand(esp, 0 * kPointerSize), regs_.object());
7472 __ mov(Operand(esp, 1 * kPointerSize), regs_.address()); // Slot. 7472 __ mov(Operand(esp, 1 * kPointerSize), regs_.address()); // Slot.
7473 __ mov(Operand(esp, 2 * kPointerSize), 7473 __ mov(Operand(esp, 2 * kPointerSize),
7474 Immediate(ExternalReference::isolate_address())); 7474 Immediate(ExternalReference::isolate_address(masm->isolate())));
7475 7475
7476 AllowExternalCallThatCantCauseGC scope(masm); 7476 AllowExternalCallThatCantCauseGC scope(masm);
7477 if (mode == INCREMENTAL_COMPACTION) { 7477 if (mode == INCREMENTAL_COMPACTION) {
7478 __ CallCFunction( 7478 __ CallCFunction(
7479 ExternalReference::incremental_evacuation_record_write_function( 7479 ExternalReference::incremental_evacuation_record_write_function(
7480 masm->isolate()), 7480 masm->isolate()),
7481 argument_count); 7481 argument_count);
7482 } else { 7482 } else {
7483 ASSERT(mode == INCREMENTAL); 7483 ASSERT(mode == INCREMENTAL);
7484 __ CallCFunction( 7484 __ CallCFunction(
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
7709 // Restore ecx. 7709 // Restore ecx.
7710 __ pop(ecx); 7710 __ pop(ecx);
7711 __ ret(0); 7711 __ ret(0);
7712 } 7712 }
7713 7713
7714 #undef __ 7714 #undef __
7715 7715
7716 } } // namespace v8::internal 7716 } } // namespace v8::internal
7717 7717
7718 #endif // V8_TARGET_ARCH_IA32 7718 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/deoptimizer.h ('k') | src/ia32/deoptimizer-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698