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

Side by Side Diff: src/ic.cc

Issue 9584006: Inline ordered relative compares of mixed double/undefined values. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Tweak comment Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/token.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2464 matching lines...) Expand 10 before | Expand all | Expand 10 after
2475 2475
2476 2476
2477 CompareIC::State CompareIC::TargetState(State state, 2477 CompareIC::State CompareIC::TargetState(State state,
2478 bool has_inlined_smi_code, 2478 bool has_inlined_smi_code,
2479 Handle<Object> x, 2479 Handle<Object> x,
2480 Handle<Object> y) { 2480 Handle<Object> y) {
2481 switch (state) { 2481 switch (state) {
2482 case UNINITIALIZED: 2482 case UNINITIALIZED:
2483 if (x->IsSmi() && y->IsSmi()) return SMIS; 2483 if (x->IsSmi() && y->IsSmi()) return SMIS;
2484 if (x->IsNumber() && y->IsNumber()) return HEAP_NUMBERS; 2484 if (x->IsNumber() && y->IsNumber()) return HEAP_NUMBERS;
2485 if (Token::IsOrderedRelationalCompareOp(op_)) {
2486 // Ordered comparisons treat undefined as NaN, so the
2487 // HEAP_NUMBER stub will do the right thing.
2488 if ((x->IsNumber() && y->IsUndefined()) ||
2489 (y->IsNumber() && x->IsUndefined())) {
2490 return HEAP_NUMBERS;
2491 }
2492 }
2485 if (!Token::IsEqualityOp(op_)) return GENERIC; 2493 if (!Token::IsEqualityOp(op_)) return GENERIC;
2486 if (x->IsSymbol() && y->IsSymbol()) return SYMBOLS; 2494 if (x->IsSymbol() && y->IsSymbol()) return SYMBOLS;
2487 if (x->IsString() && y->IsString()) return STRINGS; 2495 if (x->IsString() && y->IsString()) return STRINGS;
2488 if (x->IsJSObject() && y->IsJSObject()) { 2496 if (x->IsJSObject() && y->IsJSObject()) {
2489 if (Handle<JSObject>::cast(x)->map() == 2497 if (Handle<JSObject>::cast(x)->map() ==
2490 Handle<JSObject>::cast(y)->map() && 2498 Handle<JSObject>::cast(y)->map() &&
2491 Token::IsEqualityOp(op_)) { 2499 Token::IsEqualityOp(op_)) {
2492 return KNOWN_OBJECTS; 2500 return KNOWN_OBJECTS;
2493 } else { 2501 } else {
2494 return OBJECTS; 2502 return OBJECTS;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
2556 #undef ADDR 2564 #undef ADDR
2557 }; 2565 };
2558 2566
2559 2567
2560 Address IC::AddressFromUtilityId(IC::UtilityId id) { 2568 Address IC::AddressFromUtilityId(IC::UtilityId id) {
2561 return IC_utilities[id]; 2569 return IC_utilities[id];
2562 } 2570 }
2563 2571
2564 2572
2565 } } // namespace v8::internal 2573 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/token.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698