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

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

Issue 255543003: CodeStubs contain their corresponding Isolate* now. (part 2) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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
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 2317 matching lines...) Expand 10 before | Expand all | Expand 10 after
2328 Label done, stub_call, smi_case; 2328 Label done, stub_call, smi_case;
2329 __ Pop(rdx); 2329 __ Pop(rdx);
2330 __ movp(rcx, rax); 2330 __ movp(rcx, rax);
2331 __ orp(rax, rdx); 2331 __ orp(rax, rdx);
2332 JumpPatchSite patch_site(masm_); 2332 JumpPatchSite patch_site(masm_);
2333 patch_site.EmitJumpIfSmi(rax, &smi_case, Label::kNear); 2333 patch_site.EmitJumpIfSmi(rax, &smi_case, Label::kNear);
2334 2334
2335 __ bind(&stub_call); 2335 __ bind(&stub_call);
2336 __ movp(rax, rcx); 2336 __ movp(rax, rcx);
2337 BinaryOpICStub stub(isolate(), op, mode); 2337 BinaryOpICStub stub(isolate(), op, mode);
2338 CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId()); 2338 CallIC(stub.GetCode(), expr->BinaryOperationFeedbackId());
2339 patch_site.EmitPatchInfo(); 2339 patch_site.EmitPatchInfo();
2340 __ jmp(&done, Label::kNear); 2340 __ jmp(&done, Label::kNear);
2341 2341
2342 __ bind(&smi_case); 2342 __ bind(&smi_case);
2343 switch (op) { 2343 switch (op) {
2344 case Token::SAR: 2344 case Token::SAR:
2345 __ SmiShiftArithmeticRight(rax, rdx, rcx); 2345 __ SmiShiftArithmeticRight(rax, rdx, rcx);
2346 break; 2346 break;
2347 case Token::SHL: 2347 case Token::SHL:
2348 __ SmiShiftLeft(rax, rdx, rcx); 2348 __ SmiShiftLeft(rax, rdx, rcx);
(...skipping 28 matching lines...) Expand all
2377 context()->Plug(rax); 2377 context()->Plug(rax);
2378 } 2378 }
2379 2379
2380 2380
2381 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, 2381 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr,
2382 Token::Value op, 2382 Token::Value op,
2383 OverwriteMode mode) { 2383 OverwriteMode mode) {
2384 __ Pop(rdx); 2384 __ Pop(rdx);
2385 BinaryOpICStub stub(isolate(), op, mode); 2385 BinaryOpICStub stub(isolate(), op, mode);
2386 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. 2386 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
2387 CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId()); 2387 CallIC(stub.GetCode(), expr->BinaryOperationFeedbackId());
2388 patch_site.EmitPatchInfo(); 2388 patch_site.EmitPatchInfo();
2389 context()->Plug(rax); 2389 context()->Plug(rax);
2390 } 2390 }
2391 2391
2392 2392
2393 void FullCodeGenerator::EmitAssignment(Expression* expr) { 2393 void FullCodeGenerator::EmitAssignment(Expression* expr) {
2394 ASSERT(expr->IsValidReferenceExpression()); 2394 ASSERT(expr->IsValidReferenceExpression());
2395 2395
2396 // Left-hand side can only be a property, a global or a (parameter or local) 2396 // Left-hand side can only be a property, a global or a (parameter or local)
2397 // slot. 2397 // slot.
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
2875 StoreFeedbackVectorSlot(expr->AllocationSiteFeedbackSlot(), 2875 StoreFeedbackVectorSlot(expr->AllocationSiteFeedbackSlot(),
2876 isolate()->factory()->NewAllocationSite()); 2876 isolate()->factory()->NewAllocationSite());
2877 ASSERT(expr->AllocationSiteFeedbackSlot() == 2877 ASSERT(expr->AllocationSiteFeedbackSlot() ==
2878 expr->CallNewFeedbackSlot() + 1); 2878 expr->CallNewFeedbackSlot() + 1);
2879 } 2879 }
2880 2880
2881 __ Move(rbx, FeedbackVector()); 2881 __ Move(rbx, FeedbackVector());
2882 __ Move(rdx, Smi::FromInt(expr->CallNewFeedbackSlot())); 2882 __ Move(rdx, Smi::FromInt(expr->CallNewFeedbackSlot()));
2883 2883
2884 CallConstructStub stub(isolate(), RECORD_CALL_TARGET); 2884 CallConstructStub stub(isolate(), RECORD_CALL_TARGET);
2885 __ Call(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL); 2885 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL);
2886 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); 2886 PrepareForBailoutForId(expr->ReturnId(), TOS_REG);
2887 context()->Plug(rax); 2887 context()->Plug(rax);
2888 } 2888 }
2889 2889
2890 2890
2891 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { 2891 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) {
2892 ZoneList<Expression*>* args = expr->arguments(); 2892 ZoneList<Expression*>* args = expr->arguments();
2893 ASSERT(args->length() == 1); 2893 ASSERT(args->length() == 1);
2894 2894
2895 VisitForAccumulatorValue(args->at(0)); 2895 VisitForAccumulatorValue(args->at(0));
(...skipping 1525 matching lines...) Expand 10 before | Expand all | Expand 10 after
4421 } 4421 }
4422 4422
4423 // Record position before stub call. 4423 // Record position before stub call.
4424 SetSourcePosition(expr->position()); 4424 SetSourcePosition(expr->position());
4425 4425
4426 // Call stub for +1/-1. 4426 // Call stub for +1/-1.
4427 __ bind(&stub_call); 4427 __ bind(&stub_call);
4428 __ movp(rdx, rax); 4428 __ movp(rdx, rax);
4429 __ Move(rax, Smi::FromInt(1)); 4429 __ Move(rax, Smi::FromInt(1));
4430 BinaryOpICStub stub(isolate(), expr->binary_op(), NO_OVERWRITE); 4430 BinaryOpICStub stub(isolate(), expr->binary_op(), NO_OVERWRITE);
4431 CallIC(stub.GetCode(isolate()), expr->CountBinOpFeedbackId()); 4431 CallIC(stub.GetCode(), expr->CountBinOpFeedbackId());
4432 patch_site.EmitPatchInfo(); 4432 patch_site.EmitPatchInfo();
4433 __ bind(&done); 4433 __ bind(&done);
4434 4434
4435 // Store the value returned in rax. 4435 // Store the value returned in rax.
4436 switch (assign_type) { 4436 switch (assign_type) {
4437 case VARIABLE: 4437 case VARIABLE:
4438 if (expr->is_postfix()) { 4438 if (expr->is_postfix()) {
4439 // Perform the assignment as if via '='. 4439 // Perform the assignment as if via '='.
4440 { EffectContext context(this); 4440 { EffectContext context(this);
4441 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), 4441 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
4929 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), 4929 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(),
4930 Assembler::target_address_at(call_target_address, 4930 Assembler::target_address_at(call_target_address,
4931 unoptimized_code)); 4931 unoptimized_code));
4932 return OSR_AFTER_STACK_CHECK; 4932 return OSR_AFTER_STACK_CHECK;
4933 } 4933 }
4934 4934
4935 4935
4936 } } // namespace v8::internal 4936 } } // namespace v8::internal
4937 4937
4938 #endif // V8_TARGET_ARCH_X64 4938 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698