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

Side by Side Diff: runtime/vm/raw_object_snapshot.cc

Issue 1201383002: Port irregexp bytecode compiler and interpreter from V8 r24065. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/regexp.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/object.h" 5 #include "vm/object.h"
6 #include "vm/object_store.h" 6 #include "vm/object_store.h"
7 #include "vm/snapshot.h" 7 #include "vm/snapshot.h"
8 #include "vm/stub_code.h" 8 #include "vm/stub_code.h"
9 #include "vm/symbols.h" 9 #include "vm/symbols.h"
10 #include "vm/visitor.h" 10 #include "vm/visitor.h"
(...skipping 2962 matching lines...) Expand 10 before | Expand all | Expand 10 after
2973 reader->AddBackRef(object_id, &regex, kIsDeserialized); 2973 reader->AddBackRef(object_id, &regex, kIsDeserialized);
2974 2974
2975 // Set the object tags. 2975 // Set the object tags.
2976 regex.set_tags(tags); 2976 regex.set_tags(tags);
2977 2977
2978 // Read and Set all the other fields. 2978 // Read and Set all the other fields.
2979 regex.StoreSmi(&regex.raw_ptr()->num_bracket_expressions_, 2979 regex.StoreSmi(&regex.raw_ptr()->num_bracket_expressions_,
2980 reader->ReadAsSmi()); 2980 reader->ReadAsSmi());
2981 *reader->StringHandle() ^= reader->ReadObjectImpl(); 2981 *reader->StringHandle() ^= reader->ReadObjectImpl();
2982 regex.set_pattern(*reader->StringHandle()); 2982 regex.set_pattern(*reader->StringHandle());
2983 regex.StoreNonPointer(&regex.raw_ptr()->num_registers_,
2984 reader->Read<int32_t>());
2983 regex.StoreNonPointer(&regex.raw_ptr()->type_flags_, 2985 regex.StoreNonPointer(&regex.raw_ptr()->type_flags_,
2984 reader->Read<int8_t>()); 2986 reader->Read<int8_t>());
2985 2987
2986 // TODO(18854): Need to implement a way of recreating the irrexp functions. 2988 // TODO(18854): Need to implement a way of recreating the irrexp functions.
2987 return regex.raw(); 2989 return regex.raw();
2988 } 2990 }
2989 2991
2990 2992
2991 void RawJSRegExp::WriteTo(SnapshotWriter* writer, 2993 void RawJSRegExp::WriteTo(SnapshotWriter* writer,
2992 intptr_t object_id, 2994 intptr_t object_id,
2993 Snapshot::Kind kind) { 2995 Snapshot::Kind kind) {
2994 ASSERT(writer != NULL); 2996 ASSERT(writer != NULL);
2995 ASSERT(kind == Snapshot::kMessage); 2997 ASSERT(kind == Snapshot::kMessage);
2996 2998
2997 // Write out the serialization header value for this object. 2999 // Write out the serialization header value for this object.
2998 writer->WriteInlinedObjectHeader(object_id); 3000 writer->WriteInlinedObjectHeader(object_id);
2999 3001
3000 // Write out the class and tags information. 3002 // Write out the class and tags information.
3001 writer->WriteIndexedObject(kJSRegExpCid); 3003 writer->WriteIndexedObject(kJSRegExpCid);
3002 writer->WriteTags(writer->GetObjectTags(this)); 3004 writer->WriteTags(writer->GetObjectTags(this));
3003 3005
3004 // Write out all the other fields. 3006 // Write out all the other fields.
3005 writer->Write<RawObject*>(ptr()->num_bracket_expressions_); 3007 writer->Write<RawObject*>(ptr()->num_bracket_expressions_);
3006 writer->WriteObjectImpl(ptr()->pattern_); 3008 writer->WriteObjectImpl(ptr()->pattern_);
3009 writer->Write<int32_t>(ptr()->num_registers_);
3007 writer->Write<int8_t>(ptr()->type_flags_); 3010 writer->Write<int8_t>(ptr()->type_flags_);
3008 } 3011 }
3009 3012
3010 3013
3011 RawWeakProperty* WeakProperty::ReadFrom(SnapshotReader* reader, 3014 RawWeakProperty* WeakProperty::ReadFrom(SnapshotReader* reader,
3012 intptr_t object_id, 3015 intptr_t object_id,
3013 intptr_t tags, 3016 intptr_t tags,
3014 Snapshot::Kind kind) { 3017 Snapshot::Kind kind) {
3015 ASSERT(reader != NULL); 3018 ASSERT(reader != NULL);
3016 3019
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
3094 // We do not allow objects with native fields in an isolate message. 3097 // We do not allow objects with native fields in an isolate message.
3095 writer->SetWriteException(Exceptions::kArgument, 3098 writer->SetWriteException(Exceptions::kArgument,
3096 "Illegal argument in isolate message" 3099 "Illegal argument in isolate message"
3097 " : (object is a UserTag)"); 3100 " : (object is a UserTag)");
3098 } else { 3101 } else {
3099 UNREACHABLE(); 3102 UNREACHABLE();
3100 } 3103 }
3101 } 3104 }
3102 3105
3103 } // namespace dart 3106 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/regexp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698