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

Side by Side Diff: src/arm/code-stubs-arm.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 | « no previous file | src/arm/deoptimizer-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 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after
1288 const Register scratch = r1; 1288 const Register scratch = r1;
1289 1289
1290 if (save_doubles_ == kSaveFPRegs) { 1290 if (save_doubles_ == kSaveFPRegs) {
1291 __ SaveFPRegs(sp, scratch); 1291 __ SaveFPRegs(sp, scratch);
1292 } 1292 }
1293 const int argument_count = 1; 1293 const int argument_count = 1;
1294 const int fp_argument_count = 0; 1294 const int fp_argument_count = 0;
1295 1295
1296 AllowExternalCallThatCantCauseGC scope(masm); 1296 AllowExternalCallThatCantCauseGC scope(masm);
1297 __ PrepareCallCFunction(argument_count, fp_argument_count, scratch); 1297 __ PrepareCallCFunction(argument_count, fp_argument_count, scratch);
1298 __ mov(r0, Operand(ExternalReference::isolate_address())); 1298 __ mov(r0, Operand(ExternalReference::isolate_address(masm->isolate())));
1299 __ CallCFunction( 1299 __ CallCFunction(
1300 ExternalReference::store_buffer_overflow_function(masm->isolate()), 1300 ExternalReference::store_buffer_overflow_function(masm->isolate()),
1301 argument_count); 1301 argument_count);
1302 if (save_doubles_ == kSaveFPRegs) { 1302 if (save_doubles_ == kSaveFPRegs) {
1303 __ RestoreFPRegs(sp, scratch); 1303 __ RestoreFPRegs(sp, scratch);
1304 } 1304 }
1305 __ ldm(ia_w, sp, kCallerSaved | pc.bit()); // Also pop pc to get Ret(0). 1305 __ ldm(ia_w, sp, kCallerSaved | pc.bit()); // Also pop pc to get Ret(0).
1306 } 1306 }
1307 1307
1308 1308
(...skipping 1786 matching lines...) Expand 10 before | Expand all | Expand 10 after
3095 ASSERT(IsPowerOf2(frame_alignment)); 3095 ASSERT(IsPowerOf2(frame_alignment));
3096 __ tst(sp, Operand(frame_alignment_mask)); 3096 __ tst(sp, Operand(frame_alignment_mask));
3097 __ b(eq, &alignment_as_expected); 3097 __ b(eq, &alignment_as_expected);
3098 // Don't use Check here, as it will call Runtime_Abort re-entering here. 3098 // Don't use Check here, as it will call Runtime_Abort re-entering here.
3099 __ stop("Unexpected alignment"); 3099 __ stop("Unexpected alignment");
3100 __ bind(&alignment_as_expected); 3100 __ bind(&alignment_as_expected);
3101 } 3101 }
3102 } 3102 }
3103 #endif 3103 #endif
3104 3104
3105 __ mov(r2, Operand(ExternalReference::isolate_address())); 3105 __ mov(r2, Operand(ExternalReference::isolate_address(isolate)));
3106 3106
3107 // To let the GC traverse the return address of the exit frames, we need to 3107 // To let the GC traverse the return address of the exit frames, we need to
3108 // know where the return address is. The CEntryStub is unmovable, so 3108 // know where the return address is. The CEntryStub is unmovable, so
3109 // we can store the address on the stack to be able to find it again and 3109 // we can store the address on the stack to be able to find it again and
3110 // we never have to restore it, because it will not change. 3110 // we never have to restore it, because it will not change.
3111 // Compute the return address in lr to return to after the jump below. Pc is 3111 // Compute the return address in lr to return to after the jump below. Pc is
3112 // already at '+ 8' from the current instruction but return is after three 3112 // already at '+ 8' from the current instruction but return is after three
3113 // instructions so add another 4 to pc to get the return address. 3113 // instructions so add another 4 to pc to get the return address.
3114 { 3114 {
3115 // Prevent literal pool emission before return address. 3115 // Prevent literal pool emission before return address.
(...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after
4312 4312
4313 // Isolates: note we add an additional parameter here (isolate pointer). 4313 // Isolates: note we add an additional parameter here (isolate pointer).
4314 const int kRegExpExecuteArguments = 9; 4314 const int kRegExpExecuteArguments = 9;
4315 const int kParameterRegisters = 4; 4315 const int kParameterRegisters = 4;
4316 __ EnterExitFrame(false, kRegExpExecuteArguments - kParameterRegisters); 4316 __ EnterExitFrame(false, kRegExpExecuteArguments - kParameterRegisters);
4317 4317
4318 // Stack pointer now points to cell where return address is to be written. 4318 // Stack pointer now points to cell where return address is to be written.
4319 // Arguments are before that on the stack or in registers. 4319 // Arguments are before that on the stack or in registers.
4320 4320
4321 // Argument 9 (sp[20]): Pass current isolate address. 4321 // Argument 9 (sp[20]): Pass current isolate address.
4322 __ mov(r0, Operand(ExternalReference::isolate_address())); 4322 __ mov(r0, Operand(ExternalReference::isolate_address(isolate)));
4323 __ str(r0, MemOperand(sp, 5 * kPointerSize)); 4323 __ str(r0, MemOperand(sp, 5 * kPointerSize));
4324 4324
4325 // Argument 8 (sp[16]): Indicate that this is a direct call from JavaScript. 4325 // Argument 8 (sp[16]): Indicate that this is a direct call from JavaScript.
4326 __ mov(r0, Operand(1)); 4326 __ mov(r0, Operand(1));
4327 __ str(r0, MemOperand(sp, 4 * kPointerSize)); 4327 __ str(r0, MemOperand(sp, 4 * kPointerSize));
4328 4328
4329 // Argument 7 (sp[12]): Start (high end) of backtracking stack memory area. 4329 // Argument 7 (sp[12]): Start (high end) of backtracking stack memory area.
4330 __ mov(r0, Operand(address_of_regexp_stack_memory_address)); 4330 __ mov(r0, Operand(address_of_regexp_stack_memory_address));
4331 __ ldr(r0, MemOperand(r0, 0)); 4331 __ ldr(r0, MemOperand(r0, 0));
4332 __ mov(r2, Operand(address_of_regexp_stack_memory_size)); 4332 __ mov(r2, Operand(address_of_regexp_stack_memory_size));
(...skipping 2576 matching lines...) Expand 10 before | Expand all | Expand 10 after
6909 regs_.SaveCallerSaveRegisters(masm, save_fp_regs_mode_); 6909 regs_.SaveCallerSaveRegisters(masm, save_fp_regs_mode_);
6910 int argument_count = 3; 6910 int argument_count = 3;
6911 __ PrepareCallCFunction(argument_count, regs_.scratch0()); 6911 __ PrepareCallCFunction(argument_count, regs_.scratch0());
6912 Register address = 6912 Register address =
6913 r0.is(regs_.address()) ? regs_.scratch0() : regs_.address(); 6913 r0.is(regs_.address()) ? regs_.scratch0() : regs_.address();
6914 ASSERT(!address.is(regs_.object())); 6914 ASSERT(!address.is(regs_.object()));
6915 ASSERT(!address.is(r0)); 6915 ASSERT(!address.is(r0));
6916 __ Move(address, regs_.address()); 6916 __ Move(address, regs_.address());
6917 __ Move(r0, regs_.object()); 6917 __ Move(r0, regs_.object());
6918 __ Move(r1, address); 6918 __ Move(r1, address);
6919 __ mov(r2, Operand(ExternalReference::isolate_address())); 6919 __ mov(r2, Operand(ExternalReference::isolate_address(masm->isolate())));
6920 6920
6921 AllowExternalCallThatCantCauseGC scope(masm); 6921 AllowExternalCallThatCantCauseGC scope(masm);
6922 if (mode == INCREMENTAL_COMPACTION) { 6922 if (mode == INCREMENTAL_COMPACTION) {
6923 __ CallCFunction( 6923 __ CallCFunction(
6924 ExternalReference::incremental_evacuation_record_write_function( 6924 ExternalReference::incremental_evacuation_record_write_function(
6925 masm->isolate()), 6925 masm->isolate()),
6926 argument_count); 6926 argument_count);
6927 } else { 6927 } else {
6928 ASSERT(mode == INCREMENTAL); 6928 ASSERT(mode == INCREMENTAL);
6929 __ CallCFunction( 6929 __ CallCFunction(
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
7151 7151
7152 __ Pop(lr, r5, r1); 7152 __ Pop(lr, r5, r1);
7153 __ Ret(); 7153 __ Ret();
7154 } 7154 }
7155 7155
7156 #undef __ 7156 #undef __
7157 7157
7158 } } // namespace v8::internal 7158 } } // namespace v8::internal
7159 7159
7160 #endif // V8_TARGET_ARCH_ARM 7160 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/deoptimizer-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698