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

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

Issue 1288923002: Revert of [runtime] Remove useless IN builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 // Note on Mips implementation: 7 // Note on Mips implementation:
8 // 8 //
9 // The result_register() for mips is the 'v0' register, which is defined 9 // The result_register() for mips is the 'v0' register, which is defined
10 // by the ABI to contain function return values. However, the first 10 // by the ABI to contain function return values. However, the first
(...skipping 3321 matching lines...) Expand 10 before | Expand all | Expand 10 after
3332 Label* fall_through = NULL; 3332 Label* fall_through = NULL;
3333 context()->PrepareTest(&materialize_true, &materialize_false, 3333 context()->PrepareTest(&materialize_true, &materialize_false,
3334 &if_true, &if_false, &fall_through); 3334 &if_true, &if_false, &fall_through);
3335 3335
3336 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); 3336 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
3337 __ SmiTst(v0, t0); 3337 __ SmiTst(v0, t0);
3338 Split(eq, t0, Operand(zero_reg), if_true, if_false, fall_through); 3338 Split(eq, t0, Operand(zero_reg), if_true, if_false, fall_through);
3339 3339
3340 context()->Plug(if_true, if_false); 3340 context()->Plug(if_true, if_false);
3341 } 3341 }
3342
3343
3344 void FullCodeGenerator::EmitIsNonNegativeSmi(CallRuntime* expr) {
3345 ZoneList<Expression*>* args = expr->arguments();
3346 DCHECK(args->length() == 1);
3347
3348 VisitForAccumulatorValue(args->at(0));
3349
3350 Label materialize_true, materialize_false;
3351 Label* if_true = NULL;
3352 Label* if_false = NULL;
3353 Label* fall_through = NULL;
3354 context()->PrepareTest(&materialize_true, &materialize_false,
3355 &if_true, &if_false, &fall_through);
3356
3357 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
3358 __ NonNegativeSmiTst(v0, at);
3359 Split(eq, at, Operand(zero_reg), if_true, if_false, fall_through);
3360
3361 context()->Plug(if_true, if_false);
3362 }
3342 3363
3343 3364
3344 void FullCodeGenerator::EmitIsObject(CallRuntime* expr) { 3365 void FullCodeGenerator::EmitIsObject(CallRuntime* expr) {
3345 ZoneList<Expression*>* args = expr->arguments(); 3366 ZoneList<Expression*>* args = expr->arguments();
3346 DCHECK(args->length() == 1); 3367 DCHECK(args->length() == 1);
3347 3368
3348 VisitForAccumulatorValue(args->at(0)); 3369 VisitForAccumulatorValue(args->at(0));
3349 3370
3350 Label materialize_true, materialize_false; 3371 Label materialize_true, materialize_false;
3351 Label* if_true = NULL; 3372 Label* if_true = NULL;
(...skipping 1731 matching lines...) Expand 10 before | Expand all | Expand 10 after
5083 Label* if_false = NULL; 5104 Label* if_false = NULL;
5084 Label* fall_through = NULL; 5105 Label* fall_through = NULL;
5085 context()->PrepareTest(&materialize_true, &materialize_false, 5106 context()->PrepareTest(&materialize_true, &materialize_false,
5086 &if_true, &if_false, &fall_through); 5107 &if_true, &if_false, &fall_through);
5087 5108
5088 Token::Value op = expr->op(); 5109 Token::Value op = expr->op();
5089 VisitForStackValue(expr->left()); 5110 VisitForStackValue(expr->left());
5090 switch (op) { 5111 switch (op) {
5091 case Token::IN: 5112 case Token::IN:
5092 VisitForStackValue(expr->right()); 5113 VisitForStackValue(expr->right());
5093 __ CallRuntime(Runtime::kHasProperty, 2); 5114 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION);
5094 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); 5115 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL);
5095 __ LoadRoot(t0, Heap::kTrueValueRootIndex); 5116 __ LoadRoot(t0, Heap::kTrueValueRootIndex);
5096 Split(eq, v0, Operand(t0), if_true, if_false, fall_through); 5117 Split(eq, v0, Operand(t0), if_true, if_false, fall_through);
5097 break; 5118 break;
5098 5119
5099 case Token::INSTANCEOF: { 5120 case Token::INSTANCEOF: {
5100 VisitForStackValue(expr->right()); 5121 VisitForStackValue(expr->right());
5101 InstanceofStub stub(isolate(), InstanceofStub::kNoFlags); 5122 InstanceofStub stub(isolate(), InstanceofStub::kNoFlags);
5102 __ CallStub(&stub); 5123 __ CallStub(&stub);
5103 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); 5124 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
5355 reinterpret_cast<uint32_t>( 5376 reinterpret_cast<uint32_t>(
5356 isolate->builtins()->OsrAfterStackCheck()->entry())); 5377 isolate->builtins()->OsrAfterStackCheck()->entry()));
5357 return OSR_AFTER_STACK_CHECK; 5378 return OSR_AFTER_STACK_CHECK;
5358 } 5379 }
5359 5380
5360 5381
5361 } // namespace internal 5382 } // namespace internal
5362 } // namespace v8 5383 } // namespace v8
5363 5384
5364 #endif // V8_TARGET_ARCH_MIPS 5385 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/full-codegen/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698