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_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 3175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3186 &if_true, &if_false, &fall_through); | 3186 &if_true, &if_false, &fall_through); |
3187 | 3187 |
3188 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3188 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
3189 __ test(eax, Immediate(kSmiTagMask)); | 3189 __ test(eax, Immediate(kSmiTagMask)); |
3190 Split(zero, if_true, if_false, fall_through); | 3190 Split(zero, if_true, if_false, fall_through); |
3191 | 3191 |
3192 context()->Plug(if_true, if_false); | 3192 context()->Plug(if_true, if_false); |
3193 } | 3193 } |
3194 | 3194 |
3195 | 3195 |
3196 void FullCodeGenerator::EmitIsNonNegativeSmi(CallRuntime* expr) { | |
3197 ZoneList<Expression*>* args = expr->arguments(); | |
3198 DCHECK(args->length() == 1); | |
3199 | |
3200 VisitForAccumulatorValue(args->at(0)); | |
3201 | |
3202 Label materialize_true, materialize_false; | |
3203 Label* if_true = NULL; | |
3204 Label* if_false = NULL; | |
3205 Label* fall_through = NULL; | |
3206 context()->PrepareTest(&materialize_true, &materialize_false, | |
3207 &if_true, &if_false, &fall_through); | |
3208 | |
3209 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | |
3210 __ test(eax, Immediate(kSmiTagMask | 0x80000000)); | |
3211 Split(zero, if_true, if_false, fall_through); | |
3212 | |
3213 context()->Plug(if_true, if_false); | |
3214 } | |
3215 | |
3216 | |
3217 void FullCodeGenerator::EmitIsSpecObject(CallRuntime* expr) { | 3196 void FullCodeGenerator::EmitIsSpecObject(CallRuntime* expr) { |
3218 ZoneList<Expression*>* args = expr->arguments(); | 3197 ZoneList<Expression*>* args = expr->arguments(); |
3219 DCHECK(args->length() == 1); | 3198 DCHECK(args->length() == 1); |
3220 | 3199 |
3221 VisitForAccumulatorValue(args->at(0)); | 3200 VisitForAccumulatorValue(args->at(0)); |
3222 | 3201 |
3223 Label materialize_true, materialize_false; | 3202 Label materialize_true, materialize_false; |
3224 Label* if_true = NULL; | 3203 Label* if_true = NULL; |
3225 Label* if_false = NULL; | 3204 Label* if_false = NULL; |
3226 Label* fall_through = NULL; | 3205 Label* fall_through = NULL; |
(...skipping 1739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4966 Label* if_false = NULL; | 4945 Label* if_false = NULL; |
4967 Label* fall_through = NULL; | 4946 Label* fall_through = NULL; |
4968 context()->PrepareTest(&materialize_true, &materialize_false, | 4947 context()->PrepareTest(&materialize_true, &materialize_false, |
4969 &if_true, &if_false, &fall_through); | 4948 &if_true, &if_false, &fall_through); |
4970 | 4949 |
4971 Token::Value op = expr->op(); | 4950 Token::Value op = expr->op(); |
4972 VisitForStackValue(expr->left()); | 4951 VisitForStackValue(expr->left()); |
4973 switch (op) { | 4952 switch (op) { |
4974 case Token::IN: | 4953 case Token::IN: |
4975 VisitForStackValue(expr->right()); | 4954 VisitForStackValue(expr->right()); |
4976 __ InvokeBuiltin(Context::IN_BUILTIN_INDEX, CALL_FUNCTION); | 4955 __ CallRuntime(Runtime::kHasPropert, 2); |
4977 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 4956 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
4978 __ cmp(eax, isolate()->factory()->true_value()); | 4957 __ cmp(eax, isolate()->factory()->true_value()); |
4979 Split(equal, if_true, if_false, fall_through); | 4958 Split(equal, if_true, if_false, fall_through); |
4980 break; | 4959 break; |
4981 | 4960 |
4982 case Token::INSTANCEOF: { | 4961 case Token::INSTANCEOF: { |
4983 VisitForAccumulatorValue(expr->right()); | 4962 VisitForAccumulatorValue(expr->right()); |
4984 __ Pop(edx); | 4963 __ Pop(edx); |
4985 InstanceOfStub stub(isolate()); | 4964 InstanceOfStub stub(isolate()); |
4986 __ CallStub(&stub); | 4965 __ CallStub(&stub); |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5239 Assembler::target_address_at(call_target_address, | 5218 Assembler::target_address_at(call_target_address, |
5240 unoptimized_code)); | 5219 unoptimized_code)); |
5241 return OSR_AFTER_STACK_CHECK; | 5220 return OSR_AFTER_STACK_CHECK; |
5242 } | 5221 } |
5243 | 5222 |
5244 | 5223 |
5245 } // namespace internal | 5224 } // namespace internal |
5246 } // namespace v8 | 5225 } // namespace v8 |
5247 | 5226 |
5248 #endif // V8_TARGET_ARCH_X87 | 5227 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |