| 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 6021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6032 bool fits_into_int32_t = (value & (1 << 31)) == 0; | 6032 bool fits_into_int32_t = (value & (1 << 31)) == 0; |
| 6033 if (fits_into_int32_t) { | 6033 if (fits_into_int32_t) { |
| 6034 return Integer::New(static_cast<int32_t>(value), isolate); | 6034 return Integer::New(static_cast<int32_t>(value), isolate); |
| 6035 } | 6035 } |
| 6036 ENTER_V8(internal_isolate); | 6036 ENTER_V8(internal_isolate); |
| 6037 i::Handle<i::Object> result = internal_isolate->factory()->NewNumber(value); | 6037 i::Handle<i::Object> result = internal_isolate->factory()->NewNumber(value); |
| 6038 return Utils::IntegerToLocal(result); | 6038 return Utils::IntegerToLocal(result); |
| 6039 } | 6039 } |
| 6040 | 6040 |
| 6041 | 6041 |
| 6042 #ifdef DEBUG |
| 6043 v8::AssertNoGCScope::AssertNoGCScope(v8::Isolate* isolate) |
| 6044 : isolate_(isolate), |
| 6045 data_(i::EnterAllocationScope( |
| 6046 reinterpret_cast<i::Isolate*>(isolate), false)) { |
| 6047 STATIC_ASSERT(sizeof(data_) == sizeof(i::AllocationScopeData)); |
| 6048 } |
| 6049 |
| 6050 v8::AssertNoGCScope::~AssertNoGCScope() { |
| 6051 i::ExitAllocationScope(reinterpret_cast<i::Isolate*>(isolate_), data_); |
| 6052 } |
| 6053 #endif |
| 6054 |
| 6055 |
| 6042 void V8::IgnoreOutOfMemoryException() { | 6056 void V8::IgnoreOutOfMemoryException() { |
| 6043 EnterIsolateIfNeeded()->set_ignore_out_of_memory(true); | 6057 EnterIsolateIfNeeded()->set_ignore_out_of_memory(true); |
| 6044 } | 6058 } |
| 6045 | 6059 |
| 6046 | 6060 |
| 6047 bool V8::AddMessageListener(MessageCallback that, Handle<Value> data) { | 6061 bool V8::AddMessageListener(MessageCallback that, Handle<Value> data) { |
| 6048 i::Isolate* isolate = i::Isolate::Current(); | 6062 i::Isolate* isolate = i::Isolate::Current(); |
| 6049 EnsureInitializedForIsolate(isolate, "v8::V8::AddMessageListener()"); | 6063 EnsureInitializedForIsolate(isolate, "v8::V8::AddMessageListener()"); |
| 6050 ON_BAILOUT(isolate, "v8::V8::AddMessageListener()", return false); | 6064 ON_BAILOUT(isolate, "v8::V8::AddMessageListener()", return false); |
| 6051 ENTER_V8(isolate); | 6065 ENTER_V8(isolate); |
| (...skipping 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7635 | 7649 |
| 7636 v->VisitPointers(blocks_.first(), first_block_limit_); | 7650 v->VisitPointers(blocks_.first(), first_block_limit_); |
| 7637 | 7651 |
| 7638 for (int i = 1; i < blocks_.length(); i++) { | 7652 for (int i = 1; i < blocks_.length(); i++) { |
| 7639 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); | 7653 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); |
| 7640 } | 7654 } |
| 7641 } | 7655 } |
| 7642 | 7656 |
| 7643 | 7657 |
| 7644 } } // namespace v8::internal | 7658 } } // namespace v8::internal |
| OLD | NEW |