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

Side by Side Diff: src/factory.cc

Issue 407953002: Support setting named properties on non-JSObjects. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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/debug.cc ('k') | src/ic.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/conversions.h" 8 #include "src/conversions.h"
9 #include "src/isolate-inl.h" 9 #include "src/isolate-inl.h"
10 #include "src/macro-assembler.h" 10 #include "src/macro-assembler.h"
(...skipping 2066 matching lines...) Expand 10 before | Expand all | Expand 10 after
2077 int length) { 2077 int length) {
2078 bool strict_mode_callee = callee->shared()->strict_mode() == STRICT; 2078 bool strict_mode_callee = callee->shared()->strict_mode() == STRICT;
2079 Handle<Map> map = strict_mode_callee ? isolate()->strict_arguments_map() 2079 Handle<Map> map = strict_mode_callee ? isolate()->strict_arguments_map()
2080 : isolate()->sloppy_arguments_map(); 2080 : isolate()->sloppy_arguments_map();
2081 2081
2082 AllocationSiteUsageContext context(isolate(), Handle<AllocationSite>(), 2082 AllocationSiteUsageContext context(isolate(), Handle<AllocationSite>(),
2083 false); 2083 false);
2084 ASSERT(!isolate()->has_pending_exception()); 2084 ASSERT(!isolate()->has_pending_exception());
2085 Handle<JSObject> result = NewJSObjectFromMap(map); 2085 Handle<JSObject> result = NewJSObjectFromMap(map);
2086 Handle<Smi> value(Smi::FromInt(length), isolate()); 2086 Handle<Smi> value(Smi::FromInt(length), isolate());
2087 JSReceiver::SetProperty(result, length_string(), value, STRICT).Assert(); 2087 Object::SetProperty(result, length_string(), value, STRICT).Assert();
2088 if (!strict_mode_callee) { 2088 if (!strict_mode_callee) {
2089 JSReceiver::SetProperty(result, callee_string(), callee, STRICT).Assert(); 2089 Object::SetProperty(result, callee_string(), callee, STRICT).Assert();
2090 } 2090 }
2091 return result; 2091 return result;
2092 } 2092 }
2093 2093
2094 2094
2095 Handle<JSFunction> Factory::CreateApiFunction( 2095 Handle<JSFunction> Factory::CreateApiFunction(
2096 Handle<FunctionTemplateInfo> obj, 2096 Handle<FunctionTemplateInfo> obj,
2097 Handle<Object> prototype, 2097 Handle<Object> prototype,
2098 ApiInstanceType instance_type) { 2098 ApiInstanceType instance_type) {
2099 Handle<Code> code = isolate()->builtins()->HandleApiCall(); 2099 Handle<Code> code = isolate()->builtins()->HandleApiCall();
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
2365 return Handle<Object>::null(); 2365 return Handle<Object>::null();
2366 } 2366 }
2367 2367
2368 2368
2369 Handle<Object> Factory::ToBoolean(bool value) { 2369 Handle<Object> Factory::ToBoolean(bool value) {
2370 return value ? true_value() : false_value(); 2370 return value ? true_value() : false_value();
2371 } 2371 }
2372 2372
2373 2373
2374 } } // namespace v8::internal 2374 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/debug.cc ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698