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

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

Issue 2084913006: [ic] Let LoadGlobalIC load the variable name from TypeFeedbackMetadata. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@fix-load-ic-slow-stub
Patch Set: Addressing comments Created 4 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/runtime/runtime.h ('k') | src/type-feedback-vector.h » ('j') | 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 d16fad8c1a2b6d2f2098caace96a376cf885830d..bd0df900c11326e3a760a7ef40235c8e211df2dc 100644
--- a/src/runtime/runtime-object.cc
+++ b/src/runtime/runtime-object.cc
@@ -350,8 +350,14 @@ RUNTIME_FUNCTION(Runtime_GetProperty) {
namespace {
-Object* GetGlobal(Isolate* isolate, Handle<String> name,
+Object* GetGlobal(Isolate* isolate, int slot, Handle<TypeFeedbackVector> vector,
bool should_throw_reference_error) {
+ 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(
@@ -382,16 +388,18 @@ Object* GetGlobal(Isolate* isolate, Handle<String> name,
RUNTIME_FUNCTION(Runtime_GetGlobalInsideTypeof) {
HandleScope scope(isolate);
- DCHECK_EQ(1, args.length());
- CONVERT_ARG_HANDLE_CHECKED(String, name, 0);
- return GetGlobal(isolate, name, false);
+ DCHECK_EQ(2, args.length());
+ CONVERT_SMI_ARG_CHECKED(slot, 0);
+ CONVERT_ARG_HANDLE_CHECKED(TypeFeedbackVector, vector, 1);
+ return GetGlobal(isolate, slot, vector, false);
}
RUNTIME_FUNCTION(Runtime_GetGlobalNotInsideTypeof) {
HandleScope scope(isolate);
- DCHECK_EQ(1, args.length());
- CONVERT_ARG_HANDLE_CHECKED(String, name, 0);
- return GetGlobal(isolate, name, true);
+ DCHECK_EQ(2, args.length());
+ CONVERT_SMI_ARG_CHECKED(slot, 0);
+ CONVERT_ARG_HANDLE_CHECKED(TypeFeedbackVector, vector, 1);
+ return GetGlobal(isolate, slot, vector, true);
}
// KeyedGetProperty is called from KeyedLoadIC::GenerateGeneric.
« no previous file with comments | « src/runtime/runtime.h ('k') | src/type-feedback-vector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698