Index: src/ic/ic.cc |
diff --git a/src/ic/ic.cc b/src/ic/ic.cc |
index a6ae92a892c06ac9dcc88ecf093a0201e9f0eb12..e71692592a12faa10c84be01279a8c472213b536 100644 |
--- a/src/ic/ic.cc |
+++ b/src/ic/ic.cc |
@@ -2568,7 +2568,7 @@ MaybeHandle<Object> BinaryOpIC::Transition( |
// Compute the actual result using the builtin for the binary operation. |
Object* builtin = isolate()->js_builtins_object()->javascript_builtin( |
- TokenToJSBuiltin(state.op())); |
+ TokenToJSBuiltin(state.op(), state.language_mode())); |
Handle<JSFunction> function = handle(JSFunction::cast(builtin), isolate()); |
Handle<Object> result; |
ASSIGN_RETURN_ON_EXCEPTION( |
@@ -2805,43 +2805,38 @@ RUNTIME_FUNCTION(Unreachable) { |
} |
-Builtins::JavaScript BinaryOpIC::TokenToJSBuiltin(Token::Value op) { |
- switch (op) { |
- default: |
- UNREACHABLE(); |
- case Token::ADD: |
- return Builtins::ADD; |
- break; |
- case Token::SUB: |
- return Builtins::SUB; |
- break; |
- case Token::MUL: |
- return Builtins::MUL; |
- break; |
- case Token::DIV: |
- return Builtins::DIV; |
- break; |
- case Token::MOD: |
- return Builtins::MOD; |
- break; |
- case Token::BIT_OR: |
- return Builtins::BIT_OR; |
- break; |
- case Token::BIT_AND: |
- return Builtins::BIT_AND; |
- break; |
- case Token::BIT_XOR: |
- return Builtins::BIT_XOR; |
- break; |
- case Token::SAR: |
- return Builtins::SAR; |
- break; |
- case Token::SHR: |
- return Builtins::SHR; |
- break; |
- case Token::SHL: |
- return Builtins::SHL; |
- break; |
+Builtins::JavaScript BinaryOpIC::TokenToJSBuiltin(Token::Value op, |
+ LanguageMode language_mode) { |
+ if (is_strong(language_mode)) { |
arv (Not doing code reviews)
2015/04/24 14:14:23
Why is this needed? The two branches looks identic
conradw
2015/04/24 14:42:32
In strong mode, the strong version of the builtin
|
+ switch (op) { |
+ default: UNREACHABLE(); |
+ case Token::ADD: return Builtins::ADD; |
+ case Token::SUB: return Builtins::SUB_STRONG; |
+ case Token::MUL: return Builtins::MUL_STRONG; |
+ case Token::DIV: return Builtins::DIV_STRONG; |
+ case Token::MOD: return Builtins::MOD_STRONG; |
+ case Token::BIT_OR: return Builtins::BIT_OR; |
+ case Token::BIT_AND: return Builtins::BIT_AND; |
+ case Token::BIT_XOR: return Builtins::BIT_XOR; |
+ case Token::SAR: return Builtins::SAR; |
+ case Token::SHR: return Builtins::SHR; |
+ case Token::SHL: return Builtins::SHL; |
+ } |
+ } else { |
+ switch (op) { |
+ default: UNREACHABLE(); |
+ case Token::ADD: return Builtins::ADD; |
+ case Token::SUB: return Builtins::SUB; |
+ case Token::MUL: return Builtins::MUL; |
+ case Token::DIV: return Builtins::DIV; |
+ case Token::MOD: return Builtins::MOD; |
+ case Token::BIT_OR: return Builtins::BIT_OR; |
+ case Token::BIT_AND: return Builtins::BIT_AND; |
+ case Token::BIT_XOR: return Builtins::BIT_XOR; |
+ case Token::SAR: return Builtins::SAR; |
+ case Token::SHR: return Builtins::SHR; |
+ case Token::SHL: return Builtins::SHL; |
+ } |
} |
} |