| OLD | NEW |
| 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 "factory.h" | 5 #include "factory.h" |
| 6 | 6 |
| 7 #include "isolate-inl.h" | 7 #include "isolate-inl.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 : String::TWO_BYTE_ENCODING); | 511 : String::TWO_BYTE_ENCODING); |
| 512 | 512 |
| 513 slice->set_hash_field(String::kEmptyHashField); | 513 slice->set_hash_field(String::kEmptyHashField); |
| 514 slice->set_length(length); | 514 slice->set_length(length); |
| 515 slice->set_parent(*str); | 515 slice->set_parent(*str); |
| 516 slice->set_offset(offset); | 516 slice->set_offset(offset); |
| 517 return slice; | 517 return slice; |
| 518 } | 518 } |
| 519 | 519 |
| 520 | 520 |
| 521 Handle<String> Factory::NewExternalStringFromAscii( | 521 MaybeHandle<String> Factory::NewExternalStringFromAscii( |
| 522 const ExternalAsciiString::Resource* resource) { | 522 const ExternalAsciiString::Resource* resource) { |
| 523 CALL_HEAP_FUNCTION( | 523 CALL_HEAP_FUNCTION( |
| 524 isolate(), | 524 isolate(), |
| 525 isolate()->heap()->AllocateExternalStringFromAscii(resource), | 525 isolate()->heap()->AllocateExternalStringFromAscii(resource), |
| 526 String); | 526 String); |
| 527 } | 527 } |
| 528 | 528 |
| 529 | 529 |
| 530 Handle<String> Factory::NewExternalStringFromTwoByte( | 530 MaybeHandle<String> Factory::NewExternalStringFromTwoByte( |
| 531 const ExternalTwoByteString::Resource* resource) { | 531 const ExternalTwoByteString::Resource* resource) { |
| 532 CALL_HEAP_FUNCTION( | 532 CALL_HEAP_FUNCTION( |
| 533 isolate(), | 533 isolate(), |
| 534 isolate()->heap()->AllocateExternalStringFromTwoByte(resource), | 534 isolate()->heap()->AllocateExternalStringFromTwoByte(resource), |
| 535 String); | 535 String); |
| 536 } | 536 } |
| 537 | 537 |
| 538 | 538 |
| 539 Handle<Symbol> Factory::NewSymbol() { | 539 Handle<Symbol> Factory::NewSymbol() { |
| 540 CALL_HEAP_FUNCTION( | 540 CALL_HEAP_FUNCTION( |
| (...skipping 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1946 if (name->Equals(h->infinity_string())) return infinity_value(); | 1946 if (name->Equals(h->infinity_string())) return infinity_value(); |
| 1947 return Handle<Object>::null(); | 1947 return Handle<Object>::null(); |
| 1948 } | 1948 } |
| 1949 | 1949 |
| 1950 | 1950 |
| 1951 Handle<Object> Factory::ToBoolean(bool value) { | 1951 Handle<Object> Factory::ToBoolean(bool value) { |
| 1952 return value ? true_value() : false_value(); | 1952 return value ? true_value() : false_value(); |
| 1953 } | 1953 } |
| 1954 | 1954 |
| 1955 } } // namespace v8::internal | 1955 } } // namespace v8::internal |
| OLD | NEW |