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

Unified Diff: src/contexts.cc

Issue 1306993003: Call JS functions via native context instead of js builtins object. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase 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/contexts.h ('k') | src/date.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/contexts.cc
diff --git a/src/contexts.cc b/src/contexts.cc
index e3ace3c8c1e967a87d049578b6dc082e1bf8c6cf..0e89821c7f683e63517c5f0d003aac3d3896e1a4 100644
--- a/src/contexts.cc
+++ b/src/contexts.cc
@@ -244,7 +244,7 @@ Handle<Object> Context::Lookup(Handle<String> name,
Handle<Context> context(this, isolate);
bool follow_context_chain = (flags & FOLLOW_CONTEXT_CHAIN) != 0;
- *index = -1;
+ *index = kNotFound;
*attributes = ABSENT;
*binding_flags = MISSING_BINDING;
@@ -537,6 +537,23 @@ Handle<Object> Context::ErrorMessageForCodeGenerationFromStrings() {
}
+#define COMPARE_NAME(index, type, name) \
+ if (string->IsOneByteEqualTo(STATIC_CHAR_VECTOR(#name))) return index;
+
+int Context::ImportedFieldIndexForName(Handle<String> string) {
+ NATIVE_CONTEXT_IMPORTED_FIELDS(COMPARE_NAME)
+ return kNotFound;
+}
+
+
+int Context::IntrinsicIndexForName(Handle<String> string) {
+ NATIVE_CONTEXT_INTRINSIC_FUNCTIONS(COMPARE_NAME);
+ return kNotFound;
+}
+
+#undef COMPARE_NAME
+
+
#ifdef DEBUG
bool Context::IsBootstrappingOrValidParentContext(
Object* object, Context* child) {
« no previous file with comments | « src/contexts.h ('k') | src/date.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698