OLD | NEW |
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 2288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2299 MaybeObject* BinaryOpIC::Transition(Handle<Object> left, Handle<Object> right) { | 2299 MaybeObject* BinaryOpIC::Transition(Handle<Object> left, Handle<Object> right) { |
2300 Code::ExtraICState extra_ic_state = target()->extended_extra_ic_state(); | 2300 Code::ExtraICState extra_ic_state = target()->extended_extra_ic_state(); |
2301 BinaryOpStub stub(extra_ic_state); | 2301 BinaryOpStub stub(extra_ic_state); |
2302 | 2302 |
2303 Handle<Type> left_type = stub.GetLeftType(isolate()); | 2303 Handle<Type> left_type = stub.GetLeftType(isolate()); |
2304 Handle<Type> right_type = stub.GetRightType(isolate()); | 2304 Handle<Type> right_type = stub.GetRightType(isolate()); |
2305 bool smi_was_enabled = left_type->Maybe(Type::Smi()) && | 2305 bool smi_was_enabled = left_type->Maybe(Type::Smi()) && |
2306 right_type->Maybe(Type::Smi()); | 2306 right_type->Maybe(Type::Smi()); |
2307 | 2307 |
2308 Maybe<Handle<Object> > result = stub.Result(left, right, isolate()); | 2308 Maybe<Handle<Object> > result = stub.Result(left, right, isolate()); |
| 2309 if (!result.has_value) return Failure::Exception(); |
2309 | 2310 |
2310 #ifdef DEBUG | 2311 #ifdef DEBUG |
2311 if (FLAG_trace_ic) { | 2312 if (FLAG_trace_ic) { |
2312 char buffer[100]; | 2313 char buffer[100]; |
2313 NoAllocationStringAllocator allocator(buffer, | 2314 NoAllocationStringAllocator allocator(buffer, |
2314 static_cast<unsigned>(sizeof(buffer))); | 2315 static_cast<unsigned>(sizeof(buffer))); |
2315 StringStream stream(&allocator); | 2316 StringStream stream(&allocator); |
2316 stream.Add("["); | 2317 stream.Add("["); |
2317 stub.PrintName(&stream); | 2318 stub.PrintName(&stream); |
2318 | 2319 |
(...skipping 20 matching lines...) Expand all Loading... |
2339 right_type = stub.GetRightType(isolate()); | 2340 right_type = stub.GetRightType(isolate()); |
2340 bool enable_smi = left_type->Maybe(Type::Smi()) && | 2341 bool enable_smi = left_type->Maybe(Type::Smi()) && |
2341 right_type->Maybe(Type::Smi()); | 2342 right_type->Maybe(Type::Smi()); |
2342 | 2343 |
2343 if (!smi_was_enabled && enable_smi) { | 2344 if (!smi_was_enabled && enable_smi) { |
2344 PatchInlinedSmiCode(address(), ENABLE_INLINED_SMI_CHECK); | 2345 PatchInlinedSmiCode(address(), ENABLE_INLINED_SMI_CHECK); |
2345 } else if (smi_was_enabled && !enable_smi) { | 2346 } else if (smi_was_enabled && !enable_smi) { |
2346 PatchInlinedSmiCode(address(), DISABLE_INLINED_SMI_CHECK); | 2347 PatchInlinedSmiCode(address(), DISABLE_INLINED_SMI_CHECK); |
2347 } | 2348 } |
2348 | 2349 |
2349 return result.has_value | 2350 ASSERT(result.has_value); |
2350 ? static_cast<MaybeObject*>(*result.value) | 2351 return static_cast<MaybeObject*>(*result.value); |
2351 : Failure::Exception(); | |
2352 } | 2352 } |
2353 | 2353 |
2354 | 2354 |
2355 RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_Miss) { | 2355 RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_Miss) { |
2356 HandleScope scope(isolate); | 2356 HandleScope scope(isolate); |
2357 Handle<Object> left = args.at<Object>(0); | 2357 Handle<Object> left = args.at<Object>(0); |
2358 Handle<Object> right = args.at<Object>(1); | 2358 Handle<Object> right = args.at<Object>(1); |
2359 BinaryOpIC ic(isolate); | 2359 BinaryOpIC ic(isolate); |
2360 return ic.Transition(left, right); | 2360 return ic.Transition(left, right); |
2361 } | 2361 } |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2726 #undef ADDR | 2726 #undef ADDR |
2727 }; | 2727 }; |
2728 | 2728 |
2729 | 2729 |
2730 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 2730 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
2731 return IC_utilities[id]; | 2731 return IC_utilities[id]; |
2732 } | 2732 } |
2733 | 2733 |
2734 | 2734 |
2735 } } // namespace v8::internal | 2735 } } // namespace v8::internal |
OLD | NEW |