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

Side by Side Diff: src/factory.cc

Issue 1278783002: [es6] Use strict arguments objects for destructured parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Doh 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 unified diff | Download patch
« no previous file with comments | « src/compiler.cc ('k') | src/full-codegen/arm/full-codegen-arm.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/factory.h" 5 #include "src/factory.h"
6 6
7 #include "src/allocation-site-scopes.h" 7 #include "src/allocation-site-scopes.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/conversions.h" 10 #include "src/conversions.h"
(...skipping 2330 matching lines...) Expand 10 before | Expand all | Expand 10 after
2341 // Link debug info to function. 2341 // Link debug info to function.
2342 shared->set_debug_info(*debug_info); 2342 shared->set_debug_info(*debug_info);
2343 2343
2344 return debug_info; 2344 return debug_info;
2345 } 2345 }
2346 2346
2347 2347
2348 Handle<JSObject> Factory::NewArgumentsObject(Handle<JSFunction> callee, 2348 Handle<JSObject> Factory::NewArgumentsObject(Handle<JSFunction> callee,
2349 int length) { 2349 int length) {
2350 bool strict_mode_callee = is_strict(callee->shared()->language_mode()) || 2350 bool strict_mode_callee = is_strict(callee->shared()->language_mode()) ||
2351 !callee->is_simple_parameter_list(); 2351 !callee->has_simple_parameters();
2352 Handle<Map> map = strict_mode_callee ? isolate()->strict_arguments_map() 2352 Handle<Map> map = strict_mode_callee ? isolate()->strict_arguments_map()
2353 : isolate()->sloppy_arguments_map(); 2353 : isolate()->sloppy_arguments_map();
2354
2355 AllocationSiteUsageContext context(isolate(), Handle<AllocationSite>(), 2354 AllocationSiteUsageContext context(isolate(), Handle<AllocationSite>(),
2356 false); 2355 false);
2357 DCHECK(!isolate()->has_pending_exception()); 2356 DCHECK(!isolate()->has_pending_exception());
2358 Handle<JSObject> result = NewJSObjectFromMap(map); 2357 Handle<JSObject> result = NewJSObjectFromMap(map);
2359 Handle<Smi> value(Smi::FromInt(length), isolate()); 2358 Handle<Smi> value(Smi::FromInt(length), isolate());
2360 Object::SetProperty(result, length_string(), value, STRICT).Assert(); 2359 Object::SetProperty(result, length_string(), value, STRICT).Assert();
2361 if (!strict_mode_callee) { 2360 if (!strict_mode_callee) {
2362 Object::SetProperty(result, callee_string(), callee, STRICT).Assert(); 2361 Object::SetProperty(result, callee_string(), callee, STRICT).Assert();
2363 } 2362 }
2364 return result; 2363 return result;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
2473 } 2472 }
2474 2473
2475 2474
2476 Handle<Object> Factory::ToBoolean(bool value) { 2475 Handle<Object> Factory::ToBoolean(bool value) {
2477 return value ? true_value() : false_value(); 2476 return value ? true_value() : false_value();
2478 } 2477 }
2479 2478
2480 2479
2481 } // namespace internal 2480 } // namespace internal
2482 } // namespace v8 2481 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698