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

Side by Side Diff: src/scopeinfo.cc

Issue 225283005: Return MaybeHandle from SetProperty. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/runtime.cc ('k') | src/stub-cache.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 Handle<Context> context, 365 Handle<Context> context,
366 Handle<JSObject> scope_object) { 366 Handle<JSObject> scope_object) {
367 Isolate* isolate = scope_info->GetIsolate(); 367 Isolate* isolate = scope_info->GetIsolate();
368 int local_count = scope_info->ContextLocalCount(); 368 int local_count = scope_info->ContextLocalCount();
369 if (local_count == 0) return true; 369 if (local_count == 0) return true;
370 // Fill all context locals to the context extension. 370 // Fill all context locals to the context extension.
371 int start = scope_info->ContextLocalNameEntriesIndex(); 371 int start = scope_info->ContextLocalNameEntriesIndex();
372 int end = start + local_count; 372 int end = start + local_count;
373 for (int i = start; i < end; ++i) { 373 for (int i = start; i < end; ++i) {
374 int context_index = Context::MIN_CONTEXT_SLOTS + i - start; 374 int context_index = Context::MIN_CONTEXT_SLOTS + i - start;
375 Handle<Object> result = Runtime::SetObjectProperty( 375 RETURN_ON_EXCEPTION_VALUE(
376 isolate, 376 isolate,
377 scope_object, 377 Runtime::SetObjectProperty(
378 Handle<String>(String::cast(scope_info->get(i))), 378 isolate,
379 Handle<Object>(context->get(context_index), isolate), 379 scope_object,
380 ::NONE, 380 Handle<String>(String::cast(scope_info->get(i))),
381 SLOPPY); 381 Handle<Object>(context->get(context_index), isolate),
382 RETURN_IF_EMPTY_HANDLE_VALUE(isolate, result, false); 382 ::NONE,
383 SLOPPY),
384 false);
383 } 385 }
384 return true; 386 return true;
385 } 387 }
386 388
387 389
388 int ScopeInfo::ParameterEntriesIndex() { 390 int ScopeInfo::ParameterEntriesIndex() {
389 ASSERT(length() > 0); 391 ASSERT(length() > 0);
390 return kVariablePartIndex; 392 return kVariablePartIndex;
391 } 393 }
392 394
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 } else { 554 } else {
553 ASSERT(var->index() >= 0); 555 ASSERT(var->index() >= 0);
554 info->set_index(i, var->index()); 556 info->set_index(i, var->index());
555 } 557 }
556 } 558 }
557 ASSERT(i == info->length()); 559 ASSERT(i == info->length());
558 return info; 560 return info;
559 } 561 }
560 562
561 } } // namespace v8::internal 563 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | src/stub-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698