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

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

Issue 12317141: Added Isolate parameter to CodeStub::GetCode(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed whitespace. Rebased. Created 7 years, 9 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/arm/code-stubs-arm.cc ('k') | src/arm/lithium-codegen-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 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after
1028 1028
1029 __ cmp(r1, r0); 1029 __ cmp(r1, r0);
1030 __ b(ne, &next_test); 1030 __ b(ne, &next_test);
1031 __ Drop(1); // Switch value is no longer needed. 1031 __ Drop(1); // Switch value is no longer needed.
1032 __ b(clause->body_target()); 1032 __ b(clause->body_target());
1033 __ bind(&slow_case); 1033 __ bind(&slow_case);
1034 } 1034 }
1035 1035
1036 // Record position before stub call for type feedback. 1036 // Record position before stub call for type feedback.
1037 SetSourcePosition(clause->position()); 1037 SetSourcePosition(clause->position());
1038 Handle<Code> ic = CompareIC::GetUninitialized(Token::EQ_STRICT); 1038 Handle<Code> ic = CompareIC::GetUninitialized(isolate(), Token::EQ_STRICT);
1039 CallIC(ic, RelocInfo::CODE_TARGET, clause->CompareId()); 1039 CallIC(ic, RelocInfo::CODE_TARGET, clause->CompareId());
1040 patch_site.EmitPatchInfo(); 1040 patch_site.EmitPatchInfo();
1041 1041
1042 __ cmp(r0, Operand::Zero()); 1042 __ cmp(r0, Operand::Zero());
1043 __ b(ne, &next_test); 1043 __ b(ne, &next_test);
1044 __ Drop(1); // Switch value is no longer needed. 1044 __ Drop(1); // Switch value is no longer needed.
1045 __ b(clause->body_target()); 1045 __ b(clause->body_target());
1046 } 1046 }
1047 1047
1048 // Discard the test value and jump to the default if present, otherwise to 1048 // Discard the test value and jump to the default if present, otherwise to
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
1943 __ pop(left); 1943 __ pop(left);
1944 1944
1945 // Perform combined smi check on both operands. 1945 // Perform combined smi check on both operands.
1946 __ orr(scratch1, left, Operand(right)); 1946 __ orr(scratch1, left, Operand(right));
1947 STATIC_ASSERT(kSmiTag == 0); 1947 STATIC_ASSERT(kSmiTag == 0);
1948 JumpPatchSite patch_site(masm_); 1948 JumpPatchSite patch_site(masm_);
1949 patch_site.EmitJumpIfSmi(scratch1, &smi_case); 1949 patch_site.EmitJumpIfSmi(scratch1, &smi_case);
1950 1950
1951 __ bind(&stub_call); 1951 __ bind(&stub_call);
1952 BinaryOpStub stub(op, mode); 1952 BinaryOpStub stub(op, mode);
1953 CallIC(stub.GetCode(), RelocInfo::CODE_TARGET, 1953 CallIC(stub.GetCode(isolate()), RelocInfo::CODE_TARGET,
1954 expr->BinaryOperationFeedbackId()); 1954 expr->BinaryOperationFeedbackId());
1955 patch_site.EmitPatchInfo(); 1955 patch_site.EmitPatchInfo();
1956 __ jmp(&done); 1956 __ jmp(&done);
1957 1957
1958 __ bind(&smi_case); 1958 __ bind(&smi_case);
1959 // Smi case. This code works the same way as the smi-smi case in the type 1959 // Smi case. This code works the same way as the smi-smi case in the type
1960 // recording binary operation stub, see 1960 // recording binary operation stub, see
1961 // BinaryOpStub::GenerateSmiSmiOperation for comments. 1961 // BinaryOpStub::GenerateSmiSmiOperation for comments.
1962 switch (op) { 1962 switch (op) {
1963 case Token::SAR: 1963 case Token::SAR:
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
2027 context()->Plug(r0); 2027 context()->Plug(r0);
2028 } 2028 }
2029 2029
2030 2030
2031 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, 2031 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr,
2032 Token::Value op, 2032 Token::Value op,
2033 OverwriteMode mode) { 2033 OverwriteMode mode) {
2034 __ pop(r1); 2034 __ pop(r1);
2035 BinaryOpStub stub(op, mode); 2035 BinaryOpStub stub(op, mode);
2036 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. 2036 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
2037 CallIC(stub.GetCode(), RelocInfo::CODE_TARGET, 2037 CallIC(stub.GetCode(isolate()), RelocInfo::CODE_TARGET,
2038 expr->BinaryOperationFeedbackId()); 2038 expr->BinaryOperationFeedbackId());
2039 patch_site.EmitPatchInfo(); 2039 patch_site.EmitPatchInfo();
2040 context()->Plug(r0); 2040 context()->Plug(r0);
2041 } 2041 }
2042 2042
2043 2043
2044 void FullCodeGenerator::EmitAssignment(Expression* expr) { 2044 void FullCodeGenerator::EmitAssignment(Expression* expr) {
2045 // Invalid left-hand sides are rewritten by the parser to have a 'throw 2045 // Invalid left-hand sides are rewritten by the parser to have a 'throw
2046 // ReferenceError' on the left-hand side. 2046 // ReferenceError' on the left-hand side.
2047 if (!expr->IsValidLeftHandSide()) { 2047 if (!expr->IsValidLeftHandSide()) {
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
2529 2529
2530 // Record call targets in unoptimized code. 2530 // Record call targets in unoptimized code.
2531 Handle<Object> uninitialized = 2531 Handle<Object> uninitialized =
2532 TypeFeedbackCells::UninitializedSentinel(isolate()); 2532 TypeFeedbackCells::UninitializedSentinel(isolate());
2533 Handle<JSGlobalPropertyCell> cell = 2533 Handle<JSGlobalPropertyCell> cell =
2534 isolate()->factory()->NewJSGlobalPropertyCell(uninitialized); 2534 isolate()->factory()->NewJSGlobalPropertyCell(uninitialized);
2535 RecordTypeFeedbackCell(expr->CallNewFeedbackId(), cell); 2535 RecordTypeFeedbackCell(expr->CallNewFeedbackId(), cell);
2536 __ mov(r2, Operand(cell)); 2536 __ mov(r2, Operand(cell));
2537 2537
2538 CallConstructStub stub(RECORD_CALL_TARGET); 2538 CallConstructStub stub(RECORD_CALL_TARGET);
2539 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); 2539 __ Call(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL);
2540 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); 2540 PrepareForBailoutForId(expr->ReturnId(), TOS_REG);
2541 context()->Plug(r0); 2541 context()->Plug(r0);
2542 } 2542 }
2543 2543
2544 2544
2545 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { 2545 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) {
2546 ZoneList<Expression*>* args = expr->arguments(); 2546 ZoneList<Expression*>* args = expr->arguments();
2547 ASSERT(args->length() == 1); 2547 ASSERT(args->length() == 1);
2548 2548
2549 VisitForAccumulatorValue(args->at(0)); 2549 VisitForAccumulatorValue(args->at(0));
(...skipping 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after
4009 // TODO(svenpanne): Allowing format strings in Comment would be nice here... 4009 // TODO(svenpanne): Allowing format strings in Comment would be nice here...
4010 Comment cmt(masm_, comment); 4010 Comment cmt(masm_, comment);
4011 bool can_overwrite = expr->expression()->ResultOverwriteAllowed(); 4011 bool can_overwrite = expr->expression()->ResultOverwriteAllowed();
4012 UnaryOverwriteMode overwrite = 4012 UnaryOverwriteMode overwrite =
4013 can_overwrite ? UNARY_OVERWRITE : UNARY_NO_OVERWRITE; 4013 can_overwrite ? UNARY_OVERWRITE : UNARY_NO_OVERWRITE;
4014 UnaryOpStub stub(expr->op(), overwrite); 4014 UnaryOpStub stub(expr->op(), overwrite);
4015 // UnaryOpStub expects the argument to be in the 4015 // UnaryOpStub expects the argument to be in the
4016 // accumulator register r0. 4016 // accumulator register r0.
4017 VisitForAccumulatorValue(expr->expression()); 4017 VisitForAccumulatorValue(expr->expression());
4018 SetSourcePosition(expr->position()); 4018 SetSourcePosition(expr->position());
4019 CallIC(stub.GetCode(), RelocInfo::CODE_TARGET, 4019 CallIC(stub.GetCode(isolate()), RelocInfo::CODE_TARGET,
4020 expr->UnaryOperationFeedbackId()); 4020 expr->UnaryOperationFeedbackId());
4021 context()->Plug(r0); 4021 context()->Plug(r0);
4022 } 4022 }
4023 4023
4024 4024
4025 void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { 4025 void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
4026 Comment cmnt(masm_, "[ CountOperation"); 4026 Comment cmnt(masm_, "[ CountOperation");
4027 SetSourcePosition(expr->position()); 4027 SetSourcePosition(expr->position());
4028 4028
4029 // Invalid left-hand sides are rewritten to have a 'throw ReferenceError' 4029 // Invalid left-hand sides are rewritten to have a 'throw ReferenceError'
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
4122 // Call stub. Undo operation first. 4122 // Call stub. Undo operation first.
4123 __ sub(r0, r0, Operand(Smi::FromInt(count_value))); 4123 __ sub(r0, r0, Operand(Smi::FromInt(count_value)));
4124 } 4124 }
4125 __ mov(r1, r0); 4125 __ mov(r1, r0);
4126 __ mov(r0, Operand(Smi::FromInt(count_value))); 4126 __ mov(r0, Operand(Smi::FromInt(count_value)));
4127 4127
4128 // Record position before stub call. 4128 // Record position before stub call.
4129 SetSourcePosition(expr->position()); 4129 SetSourcePosition(expr->position());
4130 4130
4131 BinaryOpStub stub(Token::ADD, NO_OVERWRITE); 4131 BinaryOpStub stub(Token::ADD, NO_OVERWRITE);
4132 CallIC(stub.GetCode(), RelocInfo::CODE_TARGET, expr->CountBinOpFeedbackId()); 4132 CallIC(stub.GetCode(isolate()),
4133 RelocInfo::CODE_TARGET,
4134 expr->CountBinOpFeedbackId());
4133 patch_site.EmitPatchInfo(); 4135 patch_site.EmitPatchInfo();
4134 __ bind(&done); 4136 __ bind(&done);
4135 4137
4136 // Store the value returned in r0. 4138 // Store the value returned in r0.
4137 switch (assign_type) { 4139 switch (assign_type) {
4138 case VARIABLE: 4140 case VARIABLE:
4139 if (expr->is_postfix()) { 4141 if (expr->is_postfix()) {
4140 { EffectContext context(this); 4142 { EffectContext context(this);
4141 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), 4143 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
4142 Token::ASSIGN); 4144 Token::ASSIGN);
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
4357 Label slow_case; 4359 Label slow_case;
4358 __ orr(r2, r0, Operand(r1)); 4360 __ orr(r2, r0, Operand(r1));
4359 patch_site.EmitJumpIfNotSmi(r2, &slow_case); 4361 patch_site.EmitJumpIfNotSmi(r2, &slow_case);
4360 __ cmp(r1, r0); 4362 __ cmp(r1, r0);
4361 Split(cond, if_true, if_false, NULL); 4363 Split(cond, if_true, if_false, NULL);
4362 __ bind(&slow_case); 4364 __ bind(&slow_case);
4363 } 4365 }
4364 4366
4365 // Record position and call the compare IC. 4367 // Record position and call the compare IC.
4366 SetSourcePosition(expr->position()); 4368 SetSourcePosition(expr->position());
4367 Handle<Code> ic = CompareIC::GetUninitialized(op); 4369 Handle<Code> ic = CompareIC::GetUninitialized(isolate(), op);
4368 CallIC(ic, RelocInfo::CODE_TARGET, expr->CompareOperationFeedbackId()); 4370 CallIC(ic, RelocInfo::CODE_TARGET, expr->CompareOperationFeedbackId());
4369 patch_site.EmitPatchInfo(); 4371 patch_site.EmitPatchInfo();
4370 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); 4372 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
4371 __ cmp(r0, Operand::Zero()); 4373 __ cmp(r0, Operand::Zero());
4372 Split(cond, if_true, if_false, fall_through); 4374 Split(cond, if_true, if_false, fall_through);
4373 } 4375 }
4374 } 4376 }
4375 4377
4376 // Convert the result of the comparison into one expected for this 4378 // Convert the result of the comparison into one expected for this
4377 // expression's context. 4379 // expression's context.
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
4564 *context_length = 0; 4566 *context_length = 0;
4565 return previous_; 4567 return previous_;
4566 } 4568 }
4567 4569
4568 4570
4569 #undef __ 4571 #undef __
4570 4572
4571 } } // namespace v8::internal 4573 } } // namespace v8::internal
4572 4574
4573 #endif // V8_TARGET_ARCH_ARM 4575 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698