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 4458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4469 } | 4469 } |
4470 RUNTIME_ASSERT(end >= start); | 4470 RUNTIME_ASSERT(end >= start); |
4471 RUNTIME_ASSERT(start >= 0); | 4471 RUNTIME_ASSERT(start >= 0); |
4472 RUNTIME_ASSERT(end <= string->length()); | 4472 RUNTIME_ASSERT(end <= string->length()); |
4473 isolate->counters()->sub_string_runtime()->Increment(); | 4473 isolate->counters()->sub_string_runtime()->Increment(); |
4474 | 4474 |
4475 return *isolate->factory()->NewSubString(string, start, end); | 4475 return *isolate->factory()->NewSubString(string, start, end); |
4476 } | 4476 } |
4477 | 4477 |
4478 | 4478 |
| 4479 RUNTIME_FUNCTION(Runtime_InternalizeString) { |
| 4480 HandleScope handles(isolate); |
| 4481 RUNTIME_ASSERT(args.length() == 1); |
| 4482 CONVERT_ARG_HANDLE_CHECKED(String, string, 0); |
| 4483 return *isolate->factory()->InternalizeString(string); |
| 4484 } |
| 4485 |
| 4486 |
4479 RUNTIME_FUNCTION(Runtime_StringMatch) { | 4487 RUNTIME_FUNCTION(Runtime_StringMatch) { |
4480 HandleScope handles(isolate); | 4488 HandleScope handles(isolate); |
4481 ASSERT(args.length() == 3); | 4489 ASSERT(args.length() == 3); |
4482 | 4490 |
4483 CONVERT_ARG_HANDLE_CHECKED(String, subject, 0); | 4491 CONVERT_ARG_HANDLE_CHECKED(String, subject, 0); |
4484 CONVERT_ARG_HANDLE_CHECKED(JSRegExp, regexp, 1); | 4492 CONVERT_ARG_HANDLE_CHECKED(JSRegExp, regexp, 1); |
4485 CONVERT_ARG_HANDLE_CHECKED(JSArray, regexp_info, 2); | 4493 CONVERT_ARG_HANDLE_CHECKED(JSArray, regexp_info, 2); |
4486 | 4494 |
4487 RUNTIME_ASSERT(regexp_info->HasFastObjectElements()); | 4495 RUNTIME_ASSERT(regexp_info->HasFastObjectElements()); |
4488 | 4496 |
(...skipping 10622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15111 } | 15119 } |
15112 return NULL; | 15120 return NULL; |
15113 } | 15121 } |
15114 | 15122 |
15115 | 15123 |
15116 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15124 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
15117 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15125 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
15118 } | 15126 } |
15119 | 15127 |
15120 } } // namespace v8::internal | 15128 } } // namespace v8::internal |
OLD | NEW |