Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(708)

Unified Diff: src/jsregexp.cc

Issue 6697023: Merge 6800:7180 from the bleeding edge branch to the experimental/gc branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/json.js ('k') | src/lithium.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/jsregexp.cc
===================================================================
--- src/jsregexp.cc (revision 7180)
+++ src/jsregexp.cc (working copy)
@@ -97,9 +97,10 @@
Handle<String> pattern,
Handle<String> error_text,
const char* message) {
- Handle<JSArray> array = Factory::NewJSArray(2);
- SetElement(array, 0, pattern);
- SetElement(array, 1, error_text);
+ Handle<FixedArray> elements = Factory::NewFixedArray(2);
+ elements->set(0, *pattern);
+ elements->set(1, *error_text);
+ Handle<JSArray> array = Factory::NewJSArrayWithElements(elements);
Handle<Object> regexp_err = Factory::NewSyntaxError(message, array);
Top::Throw(*regexp_err);
}
@@ -325,11 +326,12 @@
is_ascii);
if (result.error_message != NULL) {
// Unable to compile regexp.
- Handle<JSArray> array = Factory::NewJSArray(2);
- SetElement(array, 0, pattern);
- SetElement(array,
- 1,
- Factory::NewStringFromUtf8(CStrVector(result.error_message)));
+ Handle<FixedArray> elements = Factory::NewFixedArray(2);
+ elements->set(0, *pattern);
+ Handle<String> error_message =
+ Factory::NewStringFromUtf8(CStrVector(result.error_message));
+ elements->set(1, *error_message);
+ Handle<JSArray> array = Factory::NewJSArrayWithElements(elements);
Handle<Object> regexp_err =
Factory::NewSyntaxError("malformed_regexp", array);
Top::Throw(*regexp_err);
@@ -858,9 +860,11 @@
if (reg_exp_too_big_) return IrregexpRegExpTooBig();
Handle<Object> code = macro_assembler_->GetCode(pattern);
-
work_list_ = NULL;
#ifdef DEBUG
+ if (FLAG_print_code) {
+ Handle<Code>::cast(code)->Disassemble(*pattern->ToCString());
+ }
if (FLAG_trace_regexp_assembler) {
delete macro_assembler_;
}
« no previous file with comments | « src/json.js ('k') | src/lithium.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698