| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 4080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4091 buffer[0] = static_cast<uint8_t>(code); | 4091 buffer[0] = static_cast<uint8_t>(code); |
| 4092 Object* result; | 4092 Object* result; |
| 4093 MaybeObject* maybe_result = | 4093 MaybeObject* maybe_result = |
| 4094 InternalizeOneByteString(Vector<const uint8_t>(buffer, 1)); | 4094 InternalizeOneByteString(Vector<const uint8_t>(buffer, 1)); |
| 4095 | 4095 |
| 4096 if (!maybe_result->ToObject(&result)) return maybe_result; | 4096 if (!maybe_result->ToObject(&result)) return maybe_result; |
| 4097 single_character_string_cache()->set(code, result); | 4097 single_character_string_cache()->set(code, result); |
| 4098 return result; | 4098 return result; |
| 4099 } | 4099 } |
| 4100 | 4100 |
| 4101 Object* result; | 4101 SeqTwoByteString* result; |
| 4102 { MaybeObject* maybe_result = AllocateRawTwoByteString(1); | 4102 { MaybeObject* maybe_result = AllocateRawTwoByteString(1); |
| 4103 if (!maybe_result->ToObject(&result)) return maybe_result; | 4103 if (!maybe_result->To<SeqTwoByteString>(&result)) return maybe_result; |
| 4104 } | 4104 } |
| 4105 String* answer = String::cast(result); | 4105 result->SeqTwoByteStringSet(0, code); |
| 4106 answer->Set(0, code); | 4106 return result; |
| 4107 return answer; | |
| 4108 } | 4107 } |
| 4109 | 4108 |
| 4110 | 4109 |
| 4111 MaybeObject* Heap::AllocateByteArray(int length, PretenureFlag pretenure) { | 4110 MaybeObject* Heap::AllocateByteArray(int length, PretenureFlag pretenure) { |
| 4112 if (length < 0 || length > ByteArray::kMaxLength) { | 4111 if (length < 0 || length > ByteArray::kMaxLength) { |
| 4113 return Failure::OutOfMemoryException(0x7); | 4112 return Failure::OutOfMemoryException(0x7); |
| 4114 } | 4113 } |
| 4115 int size = ByteArray::SizeFor(length); | 4114 int size = ByteArray::SizeFor(length); |
| 4116 AllocationSpace space = SelectSpace(size, OLD_DATA_SPACE, pretenure); | 4115 AllocationSpace space = SelectSpace(size, OLD_DATA_SPACE, pretenure); |
| 4117 Object* result; | 4116 Object* result; |
| (...skipping 3787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7905 if (FLAG_concurrent_recompilation) { | 7904 if (FLAG_concurrent_recompilation) { |
| 7906 heap_->relocation_mutex_->Lock(); | 7905 heap_->relocation_mutex_->Lock(); |
| 7907 #ifdef DEBUG | 7906 #ifdef DEBUG |
| 7908 heap_->relocation_mutex_locked_by_optimizer_thread_ = | 7907 heap_->relocation_mutex_locked_by_optimizer_thread_ = |
| 7909 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); | 7908 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); |
| 7910 #endif // DEBUG | 7909 #endif // DEBUG |
| 7911 } | 7910 } |
| 7912 } | 7911 } |
| 7913 | 7912 |
| 7914 } } // namespace v8::internal | 7913 } } // namespace v8::internal |
| OLD | NEW |