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

Unified Diff: src/ic/ic.cc

Issue 1316943002: Move (uppercase) JS builtins from js builtins object to native context. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove Isolate::js_builtins_object Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ic/ic.h ('k') | src/interpreter/interpreter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/ic.cc
diff --git a/src/ic/ic.cc b/src/ic/ic.cc
index b35c2a8aa39ac7989a515789ef985915e42f5f66..e6ee50108bb33699349a0bd32c49454b3c7de5a6 100644
--- a/src/ic/ic.cc
+++ b/src/ic/ic.cc
@@ -2642,8 +2642,8 @@ MaybeHandle<Object> BinaryOpIC::Transition(
BinaryOpICState state(isolate(), target()->extra_ic_state());
// Compute the actual result using the builtin for the binary operation.
- Object* builtin = isolate()->js_builtins_object()->javascript_builtin(
- TokenToJSBuiltin(state.op(), state.strength()));
+ Object* builtin = isolate()->native_context()->get(
+ TokenToContextIndex(state.op(), state.strength()));
Handle<JSFunction> function = handle(JSFunction::cast(builtin), isolate());
Handle<Object> result;
ASSIGN_RETURN_ON_EXCEPTION(
@@ -2882,37 +2882,58 @@ RUNTIME_FUNCTION(Runtime_Unreachable) {
}
-Builtins::JavaScript BinaryOpIC::TokenToJSBuiltin(Token::Value op,
- Strength strength) {
+int BinaryOpIC::TokenToContextIndex(Token::Value op, Strength strength) {
if (is_strong(strength)) {
switch (op) {
default: UNREACHABLE();
- case Token::ADD: return Builtins::ADD_STRONG;
- 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_STRONG;
- case Token::BIT_AND: return Builtins::BIT_AND_STRONG;
- case Token::BIT_XOR: return Builtins::BIT_XOR_STRONG;
- case Token::SAR: return Builtins::SAR_STRONG;
- case Token::SHR: return Builtins::SHR_STRONG;
- case Token::SHL: return Builtins::SHL_STRONG;
+ case Token::ADD:
+ return Context::ADD_STRONG_BUILTIN_INDEX;
+ case Token::SUB:
+ return Context::SUB_STRONG_BUILTIN_INDEX;
+ case Token::MUL:
+ return Context::MUL_STRONG_BUILTIN_INDEX;
+ case Token::DIV:
+ return Context::DIV_STRONG_BUILTIN_INDEX;
+ case Token::MOD:
+ return Context::MOD_STRONG_BUILTIN_INDEX;
+ case Token::BIT_OR:
+ return Context::BIT_OR_STRONG_BUILTIN_INDEX;
+ case Token::BIT_AND:
+ return Context::BIT_AND_STRONG_BUILTIN_INDEX;
+ case Token::BIT_XOR:
+ return Context::BIT_XOR_STRONG_BUILTIN_INDEX;
+ case Token::SAR:
+ return Context::SAR_STRONG_BUILTIN_INDEX;
+ case Token::SHR:
+ return Context::SHR_STRONG_BUILTIN_INDEX;
+ case Token::SHL:
+ return Context::SHL_STRONG_BUILTIN_INDEX;
}
} 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;
+ case Token::ADD:
+ return Context::ADD_BUILTIN_INDEX;
+ case Token::SUB:
+ return Context::SUB_BUILTIN_INDEX;
+ case Token::MUL:
+ return Context::MUL_BUILTIN_INDEX;
+ case Token::DIV:
+ return Context::DIV_BUILTIN_INDEX;
+ case Token::MOD:
+ return Context::MOD_BUILTIN_INDEX;
+ case Token::BIT_OR:
+ return Context::BIT_OR_BUILTIN_INDEX;
+ case Token::BIT_AND:
+ return Context::BIT_AND_BUILTIN_INDEX;
+ case Token::BIT_XOR:
+ return Context::BIT_XOR_BUILTIN_INDEX;
+ case Token::SAR:
+ return Context::SAR_BUILTIN_INDEX;
+ case Token::SHR:
+ return Context::SHR_BUILTIN_INDEX;
+ case Token::SHL:
+ return Context::SHL_BUILTIN_INDEX;
}
}
}
« no previous file with comments | « src/ic/ic.h ('k') | src/interpreter/interpreter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698