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

Unified Diff: src/ic/ic.cc

Issue 1189153002: Revert of [strong] Implement strong mode restrictions on property access (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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/ic/ic-compiler.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 5499d805428ccf5f01e616b61f1eeddc874e6aff..7c14b5625beb49203ee114964068d6a8cb6e1bad 100644
--- a/src/ic/ic.cc
+++ b/src/ic/ic.cc
@@ -571,14 +571,11 @@
// static
-Handle<Code> KeyedLoadIC::ChooseMegamorphicStub(Isolate* isolate,
- ExtraICState extra_state) {
+Handle<Code> KeyedLoadIC::ChooseMegamorphicStub(Isolate* isolate) {
if (FLAG_compiled_keyed_generic_loads) {
- return KeyedLoadGenericStub(isolate, LoadICState(extra_state)).GetCode();
+ return KeyedLoadGenericStub(isolate).GetCode();
} else {
- return is_strong(LoadICState::GetLanguageMode(extra_state))
- ? isolate->builtins()->KeyedLoadIC_Megamorphic_Strong()
- : isolate->builtins()->KeyedLoadIC_Megamorphic();
+ return isolate->builtins()->KeyedLoadIC_Megamorphic();
}
}
@@ -682,8 +679,7 @@
Handle<Object> result;
ASSIGN_RETURN_ON_EXCEPTION(
isolate(), result,
- Runtime::GetElementOrCharAt(isolate(), object, index, language_mode()),
- Object);
+ Runtime::GetElementOrCharAt(isolate(), object, index), Object);
return result;
}
@@ -726,9 +722,8 @@
// Get the property.
Handle<Object> result;
-
- ASSIGN_RETURN_ON_EXCEPTION(
- isolate(), result, Object::GetProperty(&it, language_mode()), Object);
+ ASSIGN_RETURN_ON_EXCEPTION(isolate(), result, Object::GetProperty(&it),
+ Object);
if (it.IsFound()) {
return result;
} else if (!IsUndeclaredGlobal(object)) {
@@ -920,20 +915,25 @@
}
-Handle<Code> KeyedLoadIC::initialize_stub(Isolate* isolate,
- ExtraICState extra_state) {
- return KeyedLoadICTrampolineStub(isolate, LoadICState(extra_state)).GetCode();
+Handle<Code> KeyedLoadIC::initialize_stub(Isolate* isolate) {
+ return KeyedLoadICTrampolineStub(isolate).GetCode();
}
Handle<Code> KeyedLoadIC::initialize_stub_in_optimized_code(
- Isolate* isolate, State initialization_state, ExtraICState extra_state) {
+ Isolate* isolate, State initialization_state) {
if (initialization_state != MEGAMORPHIC) {
- return KeyedLoadICStub(isolate, LoadICState(extra_state)).GetCode();
- }
- return is_strong(LoadICState::GetLanguageMode(extra_state))
- ? isolate->builtins()->KeyedLoadIC_Megamorphic_Strong()
- : isolate->builtins()->KeyedLoadIC_Megamorphic();
+ return KeyedLoadICStub(isolate).GetCode();
+ }
+ switch (initialization_state) {
+ case UNINITIALIZED:
+ return isolate->builtins()->KeyedLoadIC_Initialize();
+ case MEGAMORPHIC:
+ return isolate->builtins()->KeyedLoadIC_Megamorphic();
+ default:
+ UNREACHABLE();
+ }
+ return Handle<Code>();
}
@@ -962,7 +962,7 @@
Handle<Code> LoadIC::megamorphic_stub() {
DCHECK_EQ(Code::KEYED_LOAD_IC, kind());
- return KeyedLoadIC::ChooseMegamorphicStub(isolate(), extra_ic_state());
+ return KeyedLoadIC::ChooseMegamorphicStub(isolate());
}
@@ -986,7 +986,7 @@
lookup->state() == LookupIterator::ACCESS_CHECK) {
code = slow_stub();
} else if (!lookup->IsFound()) {
- if (kind() == Code::LOAD_IC && !is_strong(language_mode())) {
+ if (kind() == Code::LOAD_IC) {
code = NamedLoadHandlerCompiler::ComputeLoadNonexistent(lookup->name(),
receiver_map());
// TODO(jkummerow/verwaest): Introduce a builtin that handles this case.
@@ -1245,8 +1245,7 @@
if (target_receiver_maps.length() == 0) {
Handle<Code> handler =
- PropertyICCompiler::ComputeKeyedLoadMonomorphicHandler(
- receiver_map, extra_ic_state());
+ PropertyICCompiler::ComputeKeyedLoadMonomorphicHandler(receiver_map);
ConfigureVectorState(Handle<Name>::null(), receiver_map, handler);
return null_handle;
}
@@ -1263,8 +1262,7 @@
target_receiver_maps.at(0)->elements_kind(),
Handle<JSObject>::cast(receiver)->GetElementsKind())) {
Handle<Code> handler =
- PropertyICCompiler::ComputeKeyedLoadMonomorphicHandler(
- receiver_map, extra_ic_state());
+ PropertyICCompiler::ComputeKeyedLoadMonomorphicHandler(receiver_map);
ConfigureVectorState(Handle<Name>::null(), receiver_map, handler);
return null_handle;
}
@@ -1289,8 +1287,7 @@
CodeHandleList handlers(target_receiver_maps.length());
ElementHandlerCompiler compiler(isolate());
- compiler.CompileElementHandlers(&target_receiver_maps, &handlers,
- language_mode());
+ compiler.CompileElementHandlers(&target_receiver_maps, &handlers);
ConfigureVectorState(Handle<Name>::null(), &target_receiver_maps, &handlers);
return null_handle;
}
@@ -1301,8 +1298,7 @@
if (MigrateDeprecated(object)) {
Handle<Object> result;
ASSIGN_RETURN_ON_EXCEPTION(
- isolate(), result,
- Runtime::GetObjectProperty(isolate(), object, key, language_mode()),
+ isolate(), result, Runtime::GetObjectProperty(isolate(), object, key),
Object);
return result;
}
@@ -1350,12 +1346,10 @@
}
if (!load_handle.is_null()) return load_handle;
-
Handle<Object> result;
- ASSIGN_RETURN_ON_EXCEPTION(
- isolate(), result,
- Runtime::GetObjectProperty(isolate(), object, key, language_mode()),
- Object);
+ ASSIGN_RETURN_ON_EXCEPTION(isolate(), result,
+ Runtime::GetObjectProperty(isolate(), object, key),
+ Object);
return result;
}
@@ -2818,7 +2812,6 @@
Handle<Object> result;
LookupIterator it(receiver, name, holder);
- // TODO(conradw): Investigate strong mode semantics for this.
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
JSObject::GetProperty(&it));
@@ -2864,11 +2857,8 @@
DCHECK(args.smi_at(1) >= 0);
uint32_t index = args.smi_at(1);
Handle<Object> result;
- // TODO(conradw): Investigate strong mode semantics for this.
- LanguageMode language_mode = SLOPPY;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, result,
- Object::GetElement(isolate, receiver, index, language_mode));
+ isolate, result, Object::GetElement(isolate, receiver, index));
return *result;
}
@@ -2904,36 +2894,6 @@
}
-RUNTIME_FUNCTION(LoadIC_Slow) {
- HandleScope scope(isolate);
- DCHECK(args.length() == 2);
-
- Handle<Object> receiver = args.at<Object>(0);
- Handle<Name> name = args.at<Name>(1);
- LoadIC ic(IC::NO_EXTRA_FRAME, isolate, true);
- Handle<Object> result;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, result,
- Runtime::GetObjectProperty(isolate, receiver, name, ic.language_mode()));
- return *result;
-}
-
-
-RUNTIME_FUNCTION(KeyedLoadIC_Slow) {
- HandleScope scope(isolate);
- DCHECK(args.length() == 2);
-
- Handle<Object> receiver = args.at<Object>(0);
- Handle<Object> key = args.at<Object>(1);
- LoadIC ic(IC::NO_EXTRA_FRAME, isolate, true);
- Handle<Object> result;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, result, Runtime::KeyedGetObjectProperty(isolate, receiver, key,
- ic.language_mode()));
- return *result;
-}
-
-
static const Address IC_utilities[] = {
#define ADDR(name) FUNCTION_ADDR(name),
IC_UTIL_LIST(ADDR) NULL
@@ -2942,5 +2902,5 @@
Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; }
-}
-} // namespace v8::internal
+} // namespace internal
+} // namespace v8
« no previous file with comments | « src/ic/ic.h ('k') | src/ic/ic-compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698