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

Unified Diff: src/runtime/runtime-classes.cc

Issue 1700993002: Remove strong mode support from property loads. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix comment. Created 4 years, 10 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/runtime/runtime.h ('k') | src/runtime/runtime-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-classes.cc
diff --git a/src/runtime/runtime-classes.cc b/src/runtime/runtime-classes.cc
index f6bf66a5e55f51b0dedb334c531f0378664c4f00..e27685dd3f7a5cc79c571795b30f5acdb0c59ad4 100644
--- a/src/runtime/runtime-classes.cc
+++ b/src/runtime/runtime-classes.cc
@@ -104,8 +104,7 @@ static MaybeHandle<Object> DefineClass(Isolate* isolate,
ASSIGN_RETURN_ON_EXCEPTION(
isolate, prototype_parent,
Runtime::GetObjectProperty(isolate, super_class,
- isolate->factory()->prototype_string(),
- SLOPPY),
+ isolate->factory()->prototype_string()),
Object);
if (!prototype_parent->IsNull() && !prototype_parent->IsJSReceiver()) {
THROW_NEW_ERROR(
@@ -223,12 +222,10 @@ RUNTIME_FUNCTION(Runtime_FinalizeClassDefinition) {
return *constructor;
}
-
static MaybeHandle<Object> LoadFromSuper(Isolate* isolate,
Handle<Object> receiver,
Handle<JSObject> home_object,
- Handle<Name> name,
- LanguageMode language_mode) {
+ Handle<Name> name) {
if (home_object->IsAccessCheckNeeded() &&
!isolate->MayAccess(handle(isolate->context()), home_object)) {
isolate->ReportFailedAccessCheck(home_object);
@@ -238,22 +235,19 @@ static MaybeHandle<Object> LoadFromSuper(Isolate* isolate,
PrototypeIterator iter(isolate, home_object);
Handle<Object> proto = PrototypeIterator::GetCurrent(iter);
if (!proto->IsJSReceiver()) {
- return Object::ReadAbsentProperty(isolate, proto, name, language_mode);
+ return Object::ReadAbsentProperty(isolate, proto, name);
}
LookupIterator it(receiver, name, Handle<JSReceiver>::cast(proto));
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);
return result;
}
-
static MaybeHandle<Object> LoadElementFromSuper(Isolate* isolate,
Handle<Object> receiver,
Handle<JSObject> home_object,
- uint32_t index,
- LanguageMode language_mode) {
+ uint32_t index) {
if (home_object->IsAccessCheckNeeded() &&
!isolate->MayAccess(handle(isolate->context()), home_object)) {
isolate->ReportFailedAccessCheck(home_object);
@@ -264,50 +258,44 @@ static MaybeHandle<Object> LoadElementFromSuper(Isolate* isolate,
Handle<Object> proto = PrototypeIterator::GetCurrent(iter);
if (!proto->IsJSReceiver()) {
Handle<Object> name = isolate->factory()->NewNumberFromUint(index);
- return Object::ReadAbsentProperty(isolate, proto, name, language_mode);
+ return Object::ReadAbsentProperty(isolate, proto, name);
}
LookupIterator it(isolate, receiver, index, Handle<JSReceiver>::cast(proto));
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);
return result;
}
-// TODO(conradw): It would be more efficient to have a separate runtime function
-// for strong mode.
RUNTIME_FUNCTION(Runtime_LoadFromSuper) {
HandleScope scope(isolate);
- DCHECK(args.length() == 4);
+ DCHECK_EQ(3, args.length());
CONVERT_ARG_HANDLE_CHECKED(Object, receiver, 0);
CONVERT_ARG_HANDLE_CHECKED(JSObject, home_object, 1);
CONVERT_ARG_HANDLE_CHECKED(Name, name, 2);
- CONVERT_LANGUAGE_MODE_ARG_CHECKED(language_mode, 3);
Handle<Object> result;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, result,
- LoadFromSuper(isolate, receiver, home_object, name, language_mode));
+ isolate, result, LoadFromSuper(isolate, receiver, home_object, name));
return *result;
}
RUNTIME_FUNCTION(Runtime_LoadKeyedFromSuper) {
HandleScope scope(isolate);
- DCHECK(args.length() == 4);
+ DCHECK_EQ(3, args.length());
CONVERT_ARG_HANDLE_CHECKED(Object, receiver, 0);
CONVERT_ARG_HANDLE_CHECKED(JSObject, home_object, 1);
CONVERT_ARG_HANDLE_CHECKED(Object, key, 2);
- CONVERT_LANGUAGE_MODE_ARG_CHECKED(language_mode, 3);
uint32_t index = 0;
Handle<Object> result;
if (key->ToArrayIndex(&index)) {
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, result, LoadElementFromSuper(isolate, receiver, home_object,
- index, language_mode));
+ isolate, result,
+ LoadElementFromSuper(isolate, receiver, home_object, index));
return *result;
}
@@ -317,13 +305,12 @@ RUNTIME_FUNCTION(Runtime_LoadKeyedFromSuper) {
// TODO(verwaest): Unify using LookupIterator.
if (name->AsArrayIndex(&index)) {
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, result, LoadElementFromSuper(isolate, receiver, home_object,
- index, language_mode));
+ isolate, result,
+ LoadElementFromSuper(isolate, receiver, home_object, index));
return *result;
}
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, result,
- LoadFromSuper(isolate, receiver, home_object, name, language_mode));
+ isolate, result, LoadFromSuper(isolate, receiver, home_object, name));
return *result;
}
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698