| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/api.h" | 5 #include "src/api.h" |
| 6 | 6 |
| 7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
| 8 #ifdef V8_USE_ADDRESS_SANITIZER | 8 #ifdef V8_USE_ADDRESS_SANITIZER |
| 9 #include <sanitizer/asan_interface.h> | 9 #include <sanitizer/asan_interface.h> |
| 10 #endif // V8_USE_ADDRESS_SANITIZER | 10 #endif // V8_USE_ADDRESS_SANITIZER |
| (...skipping 6129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6140 | 6140 |
| 6141 | 6141 |
| 6142 // Assert that the static flags cast in GetFlags is valid. | 6142 // Assert that the static flags cast in GetFlags is valid. |
| 6143 #define REGEXP_FLAG_ASSERT_EQ(api_flag, internal_flag) \ | 6143 #define REGEXP_FLAG_ASSERT_EQ(api_flag, internal_flag) \ |
| 6144 STATIC_ASSERT(static_cast<int>(v8::RegExp::api_flag) == \ | 6144 STATIC_ASSERT(static_cast<int>(v8::RegExp::api_flag) == \ |
| 6145 static_cast<int>(i::JSRegExp::internal_flag)) | 6145 static_cast<int>(i::JSRegExp::internal_flag)) |
| 6146 REGEXP_FLAG_ASSERT_EQ(kNone, NONE); | 6146 REGEXP_FLAG_ASSERT_EQ(kNone, NONE); |
| 6147 REGEXP_FLAG_ASSERT_EQ(kGlobal, GLOBAL); | 6147 REGEXP_FLAG_ASSERT_EQ(kGlobal, GLOBAL); |
| 6148 REGEXP_FLAG_ASSERT_EQ(kIgnoreCase, IGNORE_CASE); | 6148 REGEXP_FLAG_ASSERT_EQ(kIgnoreCase, IGNORE_CASE); |
| 6149 REGEXP_FLAG_ASSERT_EQ(kMultiline, MULTILINE); | 6149 REGEXP_FLAG_ASSERT_EQ(kMultiline, MULTILINE); |
| 6150 REGEXP_FLAG_ASSERT_EQ(kSticky, STICKY); | |
| 6151 REGEXP_FLAG_ASSERT_EQ(kUnicode, UNICODE_ESCAPES); | |
| 6152 #undef REGEXP_FLAG_ASSERT_EQ | 6150 #undef REGEXP_FLAG_ASSERT_EQ |
| 6153 | 6151 |
| 6154 v8::RegExp::Flags v8::RegExp::GetFlags() const { | 6152 v8::RegExp::Flags v8::RegExp::GetFlags() const { |
| 6155 i::Handle<i::JSRegExp> obj = Utils::OpenHandle(this); | 6153 i::Handle<i::JSRegExp> obj = Utils::OpenHandle(this); |
| 6156 return static_cast<RegExp::Flags>(obj->GetFlags().value()); | 6154 return static_cast<RegExp::Flags>(obj->GetFlags().value()); |
| 6157 } | 6155 } |
| 6158 | 6156 |
| 6159 | 6157 |
| 6160 Local<v8::Array> v8::Array::New(Isolate* isolate, int length) { | 6158 Local<v8::Array> v8::Array::New(Isolate* isolate, int length) { |
| 6161 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); | 6159 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
| (...skipping 2356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8518 Address callback_address = | 8516 Address callback_address = |
| 8519 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8517 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 8520 VMState<EXTERNAL> state(isolate); | 8518 VMState<EXTERNAL> state(isolate); |
| 8521 ExternalCallbackScope call_scope(isolate, callback_address); | 8519 ExternalCallbackScope call_scope(isolate, callback_address); |
| 8522 callback(info); | 8520 callback(info); |
| 8523 } | 8521 } |
| 8524 | 8522 |
| 8525 | 8523 |
| 8526 } // namespace internal | 8524 } // namespace internal |
| 8527 } // namespace v8 | 8525 } // namespace v8 |
| OLD | NEW |