| 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 3254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3265 &if_true, &if_false, &fall_through); | 3265 &if_true, &if_false, &fall_through); |
| 3266 | 3266 |
| 3267 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3267 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 3268 __ SmiTst(v0, t0); | 3268 __ SmiTst(v0, t0); |
| 3269 Split(eq, t0, Operand(zero_reg), if_true, if_false, fall_through); | 3269 Split(eq, t0, Operand(zero_reg), if_true, if_false, fall_through); |
| 3270 | 3270 |
| 3271 context()->Plug(if_true, if_false); | 3271 context()->Plug(if_true, if_false); |
| 3272 } | 3272 } |
| 3273 | 3273 |
| 3274 | 3274 |
| 3275 void FullCodeGenerator::EmitIsNonNegativeSmi(CallRuntime* expr) { | |
| 3276 ZoneList<Expression*>* args = expr->arguments(); | |
| 3277 DCHECK(args->length() == 1); | |
| 3278 | |
| 3279 VisitForAccumulatorValue(args->at(0)); | |
| 3280 | |
| 3281 Label materialize_true, materialize_false; | |
| 3282 Label* if_true = NULL; | |
| 3283 Label* if_false = NULL; | |
| 3284 Label* fall_through = NULL; | |
| 3285 context()->PrepareTest(&materialize_true, &materialize_false, | |
| 3286 &if_true, &if_false, &fall_through); | |
| 3287 | |
| 3288 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | |
| 3289 __ NonNegativeSmiTst(v0, at); | |
| 3290 Split(eq, at, Operand(zero_reg), if_true, if_false, fall_through); | |
| 3291 | |
| 3292 context()->Plug(if_true, if_false); | |
| 3293 } | |
| 3294 | |
| 3295 | |
| 3296 void FullCodeGenerator::EmitIsSpecObject(CallRuntime* expr) { | 3275 void FullCodeGenerator::EmitIsSpecObject(CallRuntime* expr) { |
| 3297 ZoneList<Expression*>* args = expr->arguments(); | 3276 ZoneList<Expression*>* args = expr->arguments(); |
| 3298 DCHECK(args->length() == 1); | 3277 DCHECK(args->length() == 1); |
| 3299 | 3278 |
| 3300 VisitForAccumulatorValue(args->at(0)); | 3279 VisitForAccumulatorValue(args->at(0)); |
| 3301 | 3280 |
| 3302 Label materialize_true, materialize_false; | 3281 Label materialize_true, materialize_false; |
| 3303 Label* if_true = NULL; | 3282 Label* if_true = NULL; |
| 3304 Label* if_false = NULL; | 3283 Label* if_false = NULL; |
| 3305 Label* fall_through = NULL; | 3284 Label* fall_through = NULL; |
| (...skipping 1759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5065 Label* if_false = NULL; | 5044 Label* if_false = NULL; |
| 5066 Label* fall_through = NULL; | 5045 Label* fall_through = NULL; |
| 5067 context()->PrepareTest(&materialize_true, &materialize_false, | 5046 context()->PrepareTest(&materialize_true, &materialize_false, |
| 5068 &if_true, &if_false, &fall_through); | 5047 &if_true, &if_false, &fall_through); |
| 5069 | 5048 |
| 5070 Token::Value op = expr->op(); | 5049 Token::Value op = expr->op(); |
| 5071 VisitForStackValue(expr->left()); | 5050 VisitForStackValue(expr->left()); |
| 5072 switch (op) { | 5051 switch (op) { |
| 5073 case Token::IN: | 5052 case Token::IN: |
| 5074 VisitForStackValue(expr->right()); | 5053 VisitForStackValue(expr->right()); |
| 5075 __ InvokeBuiltin(Context::IN_BUILTIN_INDEX, CALL_FUNCTION); | 5054 __ CallRuntime(Runtime::kHasProperty, 2); |
| 5076 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 5055 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
| 5077 __ LoadRoot(t0, Heap::kTrueValueRootIndex); | 5056 __ LoadRoot(t0, Heap::kTrueValueRootIndex); |
| 5078 Split(eq, v0, Operand(t0), if_true, if_false, fall_through); | 5057 Split(eq, v0, Operand(t0), if_true, if_false, fall_through); |
| 5079 break; | 5058 break; |
| 5080 | 5059 |
| 5081 case Token::INSTANCEOF: { | 5060 case Token::INSTANCEOF: { |
| 5082 VisitForAccumulatorValue(expr->right()); | 5061 VisitForAccumulatorValue(expr->right()); |
| 5083 __ mov(a0, result_register()); | 5062 __ mov(a0, result_register()); |
| 5084 __ pop(a1); | 5063 __ pop(a1); |
| 5085 InstanceOfStub stub(isolate()); | 5064 InstanceOfStub stub(isolate()); |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5339 reinterpret_cast<uint32_t>( | 5318 reinterpret_cast<uint32_t>( |
| 5340 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5319 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 5341 return OSR_AFTER_STACK_CHECK; | 5320 return OSR_AFTER_STACK_CHECK; |
| 5342 } | 5321 } |
| 5343 | 5322 |
| 5344 | 5323 |
| 5345 } // namespace internal | 5324 } // namespace internal |
| 5346 } // namespace v8 | 5325 } // namespace v8 |
| 5347 | 5326 |
| 5348 #endif // V8_TARGET_ARCH_MIPS | 5327 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |