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

Side by Side Diff: src/x64/full-codegen-x64.cc

Issue 23480013: Turn interrupt and stack check into builtins. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix mips Created 7 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/x64/deoptimizer-x64.cc ('k') | src/x64/lithium-codegen-x64.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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 VisitVariableDeclaration(function); 273 VisitVariableDeclaration(function);
274 } 274 }
275 VisitDeclarations(scope()->declarations()); 275 VisitDeclarations(scope()->declarations());
276 } 276 }
277 277
278 { Comment cmnt(masm_, "[ Stack check"); 278 { Comment cmnt(masm_, "[ Stack check");
279 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); 279 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS);
280 Label ok; 280 Label ok;
281 __ CompareRoot(rsp, Heap::kStackLimitRootIndex); 281 __ CompareRoot(rsp, Heap::kStackLimitRootIndex);
282 __ j(above_equal, &ok, Label::kNear); 282 __ j(above_equal, &ok, Label::kNear);
283 StackCheckStub stub; 283 __ call(isolate()->builtins()->StackCheck(), RelocInfo::CODE_TARGET);
284 __ CallStub(&stub);
285 __ bind(&ok); 284 __ bind(&ok);
286 } 285 }
287 286
288 { Comment cmnt(masm_, "[ Body"); 287 { Comment cmnt(masm_, "[ Body");
289 ASSERT(loop_depth() == 0); 288 ASSERT(loop_depth() == 0);
290 VisitStatements(function()->body()); 289 VisitStatements(function()->body());
291 ASSERT(loop_depth() == 0); 290 ASSERT(loop_depth() == 0);
292 } 291 }
293 } 292 }
294 293
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 333
335 int weight = 1; 334 int weight = 1;
336 if (FLAG_weighted_back_edges) { 335 if (FLAG_weighted_back_edges) {
337 ASSERT(back_edge_target->is_bound()); 336 ASSERT(back_edge_target->is_bound());
338 int distance = masm_->SizeOfCodeGeneratedSince(back_edge_target); 337 int distance = masm_->SizeOfCodeGeneratedSince(back_edge_target);
339 weight = Min(kMaxBackEdgeWeight, 338 weight = Min(kMaxBackEdgeWeight,
340 Max(1, distance / kCodeSizeMultiplier)); 339 Max(1, distance / kCodeSizeMultiplier));
341 } 340 }
342 EmitProfilingCounterDecrement(weight); 341 EmitProfilingCounterDecrement(weight);
343 __ j(positive, &ok, Label::kNear); 342 __ j(positive, &ok, Label::kNear);
344 InterruptStub stub; 343 __ call(isolate()->builtins()->InterruptCheck(), RelocInfo::CODE_TARGET);
345 __ CallStub(&stub);
346 344
347 // Record a mapping of this PC offset to the OSR id. This is used to find 345 // Record a mapping of this PC offset to the OSR id. This is used to find
348 // the AST id from the unoptimized code in order to use it as a key into 346 // the AST id from the unoptimized code in order to use it as a key into
349 // the deoptimization input data found in the optimized code. 347 // the deoptimization input data found in the optimized code.
350 RecordBackEdge(stmt->OsrEntryId()); 348 RecordBackEdge(stmt->OsrEntryId());
351 349
352 EmitProfilingCounterReset(); 350 EmitProfilingCounterReset();
353 351
354 __ bind(&ok); 352 __ bind(&ok);
355 PrepareForBailoutForId(stmt->EntryId(), NO_REGISTERS); 353 PrepareForBailoutForId(stmt->EntryId(), NO_REGISTERS);
(...skipping 25 matching lines...) Expand all
381 Max(1, distance / kCodeSizeMultiplier)); 379 Max(1, distance / kCodeSizeMultiplier));
382 } 380 }
383 EmitProfilingCounterDecrement(weight); 381 EmitProfilingCounterDecrement(weight);
384 Label ok; 382 Label ok;
385 __ j(positive, &ok, Label::kNear); 383 __ j(positive, &ok, Label::kNear);
386 __ push(rax); 384 __ push(rax);
387 if (info_->ShouldSelfOptimize() && FLAG_direct_self_opt) { 385 if (info_->ShouldSelfOptimize() && FLAG_direct_self_opt) {
388 __ push(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); 386 __ push(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
389 __ CallRuntime(Runtime::kOptimizeFunctionOnNextCall, 1); 387 __ CallRuntime(Runtime::kOptimizeFunctionOnNextCall, 1);
390 } else { 388 } else {
391 InterruptStub stub; 389 __ call(isolate()->builtins()->InterruptCheck(),
392 __ CallStub(&stub); 390 RelocInfo::CODE_TARGET);
393 } 391 }
394 __ pop(rax); 392 __ pop(rax);
395 EmitProfilingCounterReset(); 393 EmitProfilingCounterReset();
396 __ bind(&ok); 394 __ bind(&ok);
397 } 395 }
398 #ifdef DEBUG 396 #ifdef DEBUG
399 // Add a label for checking the size of the code used for returning. 397 // Add a label for checking the size of the code used for returning.
400 Label check_exit_codesize; 398 Label check_exit_codesize;
401 masm_->bind(&check_exit_codesize); 399 masm_->bind(&check_exit_codesize);
402 #endif 400 #endif
(...skipping 4475 matching lines...) Expand 10 before | Expand all | Expand 10 after
4878 *context_length = 0; 4876 *context_length = 0;
4879 return previous_; 4877 return previous_;
4880 } 4878 }
4881 4879
4882 4880
4883 #undef __ 4881 #undef __
4884 4882
4885 } } // namespace v8::internal 4883 } } // namespace v8::internal
4886 4884
4887 #endif // V8_TARGET_ARCH_X64 4885 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/deoptimizer-x64.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698