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

Side by Side Diff: src/factory.cc

Issue 1744163002: [stubs] Introduce a proper ToBooleanStub. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix mips Created 4 years, 9 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/factory.h ('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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 Handle<ScopeInfo> scope_info, Handle<JSObject> extension) { 105 Handle<ScopeInfo> scope_info, Handle<JSObject> extension) {
106 DCHECK(scope_info->is_declaration_scope()); 106 DCHECK(scope_info->is_declaration_scope());
107 Handle<SloppyBlockWithEvalContextExtension> result = 107 Handle<SloppyBlockWithEvalContextExtension> result =
108 Handle<SloppyBlockWithEvalContextExtension>::cast( 108 Handle<SloppyBlockWithEvalContextExtension>::cast(
109 NewStruct(SLOPPY_BLOCK_WITH_EVAL_CONTEXT_EXTENSION_TYPE)); 109 NewStruct(SLOPPY_BLOCK_WITH_EVAL_CONTEXT_EXTENSION_TYPE));
110 result->set_scope_info(*scope_info); 110 result->set_scope_info(*scope_info);
111 result->set_extension(*extension); 111 result->set_extension(*extension);
112 return result; 112 return result;
113 } 113 }
114 114
115
116 Handle<Oddball> Factory::NewOddball(Handle<Map> map, const char* to_string, 115 Handle<Oddball> Factory::NewOddball(Handle<Map> map, const char* to_string,
117 Handle<Object> to_number, 116 Handle<Object> to_number, bool to_boolean,
118 const char* type_of, byte kind) { 117 const char* type_of, byte kind) {
119 Handle<Oddball> oddball = New<Oddball>(map, OLD_SPACE); 118 Handle<Oddball> oddball = New<Oddball>(map, OLD_SPACE);
120 Oddball::Initialize(isolate(), oddball, to_string, to_number, type_of, kind); 119 Oddball::Initialize(isolate(), oddball, to_string, to_number, to_boolean,
120 type_of, kind);
121 return oddball; 121 return oddball;
122 } 122 }
123 123
124 124
125 Handle<FixedArray> Factory::NewFixedArray(int size, PretenureFlag pretenure) { 125 Handle<FixedArray> Factory::NewFixedArray(int size, PretenureFlag pretenure) {
126 DCHECK(0 <= size); 126 DCHECK(0 <= size);
127 CALL_HEAP_FUNCTION( 127 CALL_HEAP_FUNCTION(
128 isolate(), 128 isolate(),
129 isolate()->heap()->AllocateFixedArray(size, pretenure), 129 isolate()->heap()->AllocateFixedArray(size, pretenure),
130 FixedArray); 130 FixedArray);
(...skipping 2266 matching lines...) Expand 10 before | Expand all | Expand 10 after
2397 } 2397 }
2398 2398
2399 2399
2400 Handle<Object> Factory::ToBoolean(bool value) { 2400 Handle<Object> Factory::ToBoolean(bool value) {
2401 return value ? true_value() : false_value(); 2401 return value ? true_value() : false_value();
2402 } 2402 }
2403 2403
2404 2404
2405 } // namespace internal 2405 } // namespace internal
2406 } // namespace v8 2406 } // namespace v8
OLDNEW
« no previous file with comments | « src/factory.h ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698