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 <stdlib.h> | 5 #include <stdlib.h> |
6 #include <limits> | 6 #include <limits> |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
(...skipping 4437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4448 } | 4448 } |
4449 RUNTIME_ASSERT(end >= start); | 4449 RUNTIME_ASSERT(end >= start); |
4450 RUNTIME_ASSERT(start >= 0); | 4450 RUNTIME_ASSERT(start >= 0); |
4451 RUNTIME_ASSERT(end <= string->length()); | 4451 RUNTIME_ASSERT(end <= string->length()); |
4452 isolate->counters()->sub_string_runtime()->Increment(); | 4452 isolate->counters()->sub_string_runtime()->Increment(); |
4453 | 4453 |
4454 return *isolate->factory()->NewSubString(string, start, end); | 4454 return *isolate->factory()->NewSubString(string, start, end); |
4455 } | 4455 } |
4456 | 4456 |
4457 | 4457 |
| 4458 RUNTIME_FUNCTION(Runtime_InternalizeString) { |
| 4459 HandleScope handles(isolate); |
| 4460 RUNTIME_ASSERT(args.length() == 1); |
| 4461 CONVERT_ARG_HANDLE_CHECKED(String, string, 0); |
| 4462 return *isolate->factory()->InternalizeString(string); |
| 4463 } |
| 4464 |
| 4465 |
4458 RUNTIME_FUNCTION(Runtime_StringMatch) { | 4466 RUNTIME_FUNCTION(Runtime_StringMatch) { |
4459 HandleScope handles(isolate); | 4467 HandleScope handles(isolate); |
4460 ASSERT(args.length() == 3); | 4468 ASSERT(args.length() == 3); |
4461 | 4469 |
4462 CONVERT_ARG_HANDLE_CHECKED(String, subject, 0); | 4470 CONVERT_ARG_HANDLE_CHECKED(String, subject, 0); |
4463 CONVERT_ARG_HANDLE_CHECKED(JSRegExp, regexp, 1); | 4471 CONVERT_ARG_HANDLE_CHECKED(JSRegExp, regexp, 1); |
4464 CONVERT_ARG_HANDLE_CHECKED(JSArray, regexp_info, 2); | 4472 CONVERT_ARG_HANDLE_CHECKED(JSArray, regexp_info, 2); |
4465 | 4473 |
4466 RUNTIME_ASSERT(regexp_info->HasFastObjectElements()); | 4474 RUNTIME_ASSERT(regexp_info->HasFastObjectElements()); |
4467 | 4475 |
(...skipping 10614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15082 } | 15090 } |
15083 return NULL; | 15091 return NULL; |
15084 } | 15092 } |
15085 | 15093 |
15086 | 15094 |
15087 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15095 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
15088 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15096 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
15089 } | 15097 } |
15090 | 15098 |
15091 } } // namespace v8::internal | 15099 } } // namespace v8::internal |
OLD | NEW |