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

Unified Diff: src/runtime/runtime-scopes.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/runtime/runtime-internal.cc ('k') | src/templates.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-scopes.cc
diff --git a/src/runtime/runtime-scopes.cc b/src/runtime/runtime-scopes.cc
index 17ae043ae8e1e7470c54c8bc6768f071e9720da1..fa8f7a811a8d96c91eb2fa30e9627f278df0df34 100644
--- a/src/runtime/runtime-scopes.cc
+++ b/src/runtime/runtime-scopes.cc
@@ -265,7 +265,7 @@ Object* DeclareLookupSlot(Isolate* isolate, Handle<String> name,
if (is_var) return isolate->heap()->undefined_value();
DCHECK(is_function);
- if (index >= 0) {
+ if (index != Context::kNotFound) {
DCHECK(holder.is_identical_to(context));
context->set(index, *initial_value);
return isolate->heap()->undefined_value();
@@ -346,7 +346,7 @@ RUNTIME_FUNCTION(Runtime_InitializeLegacyConstLookupSlot) {
if (isolate->has_pending_exception()) return isolate->heap()->exception();
}
- if (index >= 0) {
+ if (index != Context::kNotFound) {
DCHECK(holder->IsContext());
// Property was found in a context. Perform the assignment if the constant
// was uninitialized.
@@ -950,8 +950,7 @@ static ObjectPair LoadLookupSlotHelper(Arguments args, Isolate* isolate,
return MakePair(isolate->heap()->exception(), NULL);
}
- // If the index is non-negative, the slot has been found in a context.
- if (index >= 0) {
+ if (index != Context::kNotFound) {
DCHECK(holder->IsContext());
// If the "property" we were looking for is a local variable, the
// receiver is the global object; see ECMA-262, 3rd., 10.1.6 and 10.2.3.
@@ -1053,7 +1052,7 @@ RUNTIME_FUNCTION(Runtime_StoreLookupSlot) {
}
// The property was found in a context slot.
- if (index >= 0) {
+ if (index != Context::kNotFound) {
if ((binding_flags == MUTABLE_CHECK_INITIALIZED ||
binding_flags == IMMUTABLE_CHECK_INITIALIZED_HARMONY) &&
Handle<Context>::cast(holder)->is_the_hole(index)) {
« no previous file with comments | « src/runtime/runtime-internal.cc ('k') | src/templates.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698