| OLD | NEW |
| 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 3323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 3342 |
| 3343 | 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 } | |
| 3363 | |
| 3364 | |
| 3365 void FullCodeGenerator::EmitIsObject(CallRuntime* expr) { | 3344 void FullCodeGenerator::EmitIsObject(CallRuntime* expr) { |
| 3366 ZoneList<Expression*>* args = expr->arguments(); | 3345 ZoneList<Expression*>* args = expr->arguments(); |
| 3367 DCHECK(args->length() == 1); | 3346 DCHECK(args->length() == 1); |
| 3368 | 3347 |
| 3369 VisitForAccumulatorValue(args->at(0)); | 3348 VisitForAccumulatorValue(args->at(0)); |
| 3370 | 3349 |
| 3371 Label materialize_true, materialize_false; | 3350 Label materialize_true, materialize_false; |
| 3372 Label* if_true = NULL; | 3351 Label* if_true = NULL; |
| 3373 Label* if_false = NULL; | 3352 Label* if_false = NULL; |
| 3374 Label* fall_through = NULL; | 3353 Label* fall_through = NULL; |
| (...skipping 1729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5104 Label* if_false = NULL; | 5083 Label* if_false = NULL; |
| 5105 Label* fall_through = NULL; | 5084 Label* fall_through = NULL; |
| 5106 context()->PrepareTest(&materialize_true, &materialize_false, | 5085 context()->PrepareTest(&materialize_true, &materialize_false, |
| 5107 &if_true, &if_false, &fall_through); | 5086 &if_true, &if_false, &fall_through); |
| 5108 | 5087 |
| 5109 Token::Value op = expr->op(); | 5088 Token::Value op = expr->op(); |
| 5110 VisitForStackValue(expr->left()); | 5089 VisitForStackValue(expr->left()); |
| 5111 switch (op) { | 5090 switch (op) { |
| 5112 case Token::IN: | 5091 case Token::IN: |
| 5113 VisitForStackValue(expr->right()); | 5092 VisitForStackValue(expr->right()); |
| 5114 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION); | 5093 __ CallRuntime(Runtime::kHasProperty, 2); |
| 5115 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 5094 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
| 5116 __ LoadRoot(t0, Heap::kTrueValueRootIndex); | 5095 __ LoadRoot(t0, Heap::kTrueValueRootIndex); |
| 5117 Split(eq, v0, Operand(t0), if_true, if_false, fall_through); | 5096 Split(eq, v0, Operand(t0), if_true, if_false, fall_through); |
| 5118 break; | 5097 break; |
| 5119 | 5098 |
| 5120 case Token::INSTANCEOF: { | 5099 case Token::INSTANCEOF: { |
| 5121 VisitForStackValue(expr->right()); | 5100 VisitForStackValue(expr->right()); |
| 5122 InstanceofStub stub(isolate(), InstanceofStub::kNoFlags); | 5101 InstanceofStub stub(isolate(), InstanceofStub::kNoFlags); |
| 5123 __ CallStub(&stub); | 5102 __ CallStub(&stub); |
| 5124 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 5103 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5376 reinterpret_cast<uint32_t>( | 5355 reinterpret_cast<uint32_t>( |
| 5377 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5356 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 5378 return OSR_AFTER_STACK_CHECK; | 5357 return OSR_AFTER_STACK_CHECK; |
| 5379 } | 5358 } |
| 5380 | 5359 |
| 5381 | 5360 |
| 5382 } // namespace internal | 5361 } // namespace internal |
| 5383 } // namespace v8 | 5362 } // namespace v8 |
| 5384 | 5363 |
| 5385 #endif // V8_TARGET_ARCH_MIPS | 5364 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |