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 6189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6200 i::Vector<const char>(data, length)); | 6200 i::Vector<const char>(data, length)); |
6201 i::Handle<i::Symbol> result = i_isolate->factory()->NewSymbol(); | 6201 i::Handle<i::Symbol> result = i_isolate->factory()->NewSymbol(); |
6202 result->set_name(*name); | 6202 result->set_name(*name); |
6203 return Utils::ToLocal(result); | 6203 return Utils::ToLocal(result); |
6204 } | 6204 } |
6205 | 6205 |
6206 | 6206 |
6207 Local<Number> v8::Number::New(double value) { | 6207 Local<Number> v8::Number::New(double value) { |
6208 i::Isolate* isolate = i::Isolate::Current(); | 6208 i::Isolate* isolate = i::Isolate::Current(); |
6209 EnsureInitializedForIsolate(isolate, "v8::Number::New()"); | 6209 EnsureInitializedForIsolate(isolate, "v8::Number::New()"); |
| 6210 return Number::New(reinterpret_cast<Isolate*>(isolate), value); |
| 6211 } |
| 6212 |
| 6213 |
| 6214 Local<Number> v8::Number::New(Isolate* isolate, double value) { |
| 6215 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate); |
| 6216 ASSERT(internal_isolate->IsInitialized()); |
6210 if (std::isnan(value)) { | 6217 if (std::isnan(value)) { |
6211 // Introduce only canonical NaN value into the VM, to avoid signaling NaNs. | 6218 // Introduce only canonical NaN value into the VM, to avoid signaling NaNs. |
6212 value = i::OS::nan_value(); | 6219 value = i::OS::nan_value(); |
6213 } | 6220 } |
6214 ENTER_V8(isolate); | 6221 ENTER_V8(internal_isolate); |
6215 i::Handle<i::Object> result = isolate->factory()->NewNumber(value); | 6222 i::Handle<i::Object> result = internal_isolate->factory()->NewNumber(value); |
6216 return Utils::NumberToLocal(result); | 6223 return Utils::NumberToLocal(result); |
6217 } | 6224 } |
6218 | 6225 |
6219 | 6226 |
6220 Local<Integer> v8::Integer::New(int32_t value) { | 6227 Local<Integer> v8::Integer::New(int32_t value) { |
6221 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); | 6228 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); |
6222 EnsureInitializedForIsolate(isolate, "v8::Integer::New()"); | 6229 EnsureInitializedForIsolate(isolate, "v8::Integer::New()"); |
6223 return v8::Integer::New(value, reinterpret_cast<Isolate*>(isolate)); | 6230 return v8::Integer::New(value, reinterpret_cast<Isolate*>(isolate)); |
6224 } | 6231 } |
6225 | 6232 |
(...skipping 1641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7867 | 7874 |
7868 v->VisitPointers(blocks_.first(), first_block_limit_); | 7875 v->VisitPointers(blocks_.first(), first_block_limit_); |
7869 | 7876 |
7870 for (int i = 1; i < blocks_.length(); i++) { | 7877 for (int i = 1; i < blocks_.length(); i++) { |
7871 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); | 7878 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); |
7872 } | 7879 } |
7873 } | 7880 } |
7874 | 7881 |
7875 | 7882 |
7876 } } // namespace v8::internal | 7883 } } // namespace v8::internal |
OLD | NEW |