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

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

Issue 2220203002: [ic] Merge LoadGlobalIC_Slow builtins for inside typeof and outside typeof cases. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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/runtime/runtime.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-object.cc
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc
index 4c994dc1bd6316f025b99fc7a09992cdb6bebc04..6d4bad5c6f889e5f0f833c648a1db335eb10cd0b 100644
--- a/src/runtime/runtime-object.cc
+++ b/src/runtime/runtime-object.cc
@@ -15,9 +15,10 @@
namespace v8 {
namespace internal {
-MaybeHandle<Object> Runtime::GetObjectProperty(
- Isolate* isolate, Handle<Object> object, Handle<Object> key,
- bool should_throw_reference_error) {
+MaybeHandle<Object> Runtime::GetObjectProperty(Isolate* isolate,
+ Handle<Object> object,
+ Handle<Object> key,
+ bool* is_found_out) {
if (object->IsUndefined(isolate) || object->IsNull(isolate)) {
THROW_NEW_ERROR(
isolate,
@@ -31,10 +32,7 @@ MaybeHandle<Object> Runtime::GetObjectProperty(
if (!success) return MaybeHandle<Object>();
MaybeHandle<Object> result = Object::GetProperty(&it);
- if (!result.is_null() && should_throw_reference_error && !it.IsFound()) {
- THROW_NEW_ERROR(
- isolate, NewReferenceError(MessageTemplate::kNotDefined, key), Object);
- }
+ if (is_found_out) *is_found_out = it.IsFound();
return result;
}
@@ -348,47 +346,6 @@ RUNTIME_FUNCTION(Runtime_GetProperty) {
Runtime::GetObjectProperty(isolate, object, key));
}
-RUNTIME_FUNCTION(Runtime_GetGlobal) {
- HandleScope scope(isolate);
- DCHECK_EQ(3, args.length());
- CONVERT_SMI_ARG_CHECKED(slot, 0);
- CONVERT_ARG_HANDLE_CHECKED(TypeFeedbackVector, vector, 1);
- CONVERT_SMI_ARG_CHECKED(typeof_mode_value, 2);
- TypeofMode typeof_mode = static_cast<TypeofMode>(typeof_mode_value);
- bool should_throw_reference_error = typeof_mode == NOT_INSIDE_TYPEOF;
-
- FeedbackVectorSlot vector_slot = vector->ToSlot(slot);
- DCHECK_EQ(FeedbackVectorSlotKind::LOAD_GLOBAL_IC,
- vector->GetKind(vector_slot));
- Handle<String> name(vector->GetName(vector_slot), isolate);
- DCHECK_NE(*name, *isolate->factory()->empty_string());
-
- Handle<JSGlobalObject> global = isolate->global_object();
-
- Handle<ScriptContextTable> script_contexts(
- global->native_context()->script_context_table());
-
- ScriptContextTable::LookupResult lookup_result;
- if (ScriptContextTable::Lookup(script_contexts, name, &lookup_result)) {
- Handle<Context> script_context = ScriptContextTable::GetContext(
- script_contexts, lookup_result.context_index);
- Handle<Object> result =
- FixedArray::get(*script_context, lookup_result.slot_index, isolate);
- if (*result == *isolate->factory()->the_hole_value()) {
- THROW_NEW_ERROR_RETURN_FAILURE(
- isolate, NewReferenceError(MessageTemplate::kNotDefined, name));
- }
- return *result;
- }
-
- Handle<Object> result;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, result,
- Runtime::GetObjectProperty(isolate, global, name,
- should_throw_reference_error));
- return *result;
-}
-
// KeyedGetProperty is called from KeyedLoadIC::GenerateGeneric.
RUNTIME_FUNCTION(Runtime_KeyedGetProperty) {
HandleScope scope(isolate);
« no previous file with comments | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698